tm27: Add optional TM27_INTERRUPT_VECTOR_DEFAULT

Let the BSP define TM27_INTERRUPT_VECTOR_DEFAULT to more efficiently and
reliably get the TM27 default interrupt vector.

Update #3716.
This commit is contained in:
Sebastian Huber
2023-12-18 12:02:30 +01:00
parent d4b369814a
commit 2e71bd08ba
4 changed files with 27 additions and 2 deletions

View File

@@ -55,6 +55,8 @@
#define ARM_GIC_TM27_IRQ_HIGH ARM_GIC_IRQ_SGI_13
#endif
#define TM27_INTERRUPT_VECTOR_DEFAULT ARM_GIC_TM27_IRQ_LOW
#define ARM_GIC_TM27_PRIO_LOW 0x80
#define ARM_GIC_TM27_PRIO_HIGH 0x00

View File

@@ -89,6 +89,7 @@ extern uint32_t Interrupt_nest;
#define TEST_INTERRUPT_SOURCE 5
#define TEST_INTERRUPT_SOURCE2 6
#define MUST_WAIT_FOR_INTERRUPT 1
#define TM27_INTERRUPT_VECTOR_DEFAULT TEST_INTERRUPT_SOURCE
static inline void Install_tm27_vector( rtems_interrupt_handler handler )
{

View File

@@ -43,7 +43,23 @@
*
* @ingroup RTEMSDeviceDrivers
*
* @brief Time Test 27 Support
* @brief The Time Test 27 (TM27) support is used to measure the timing of
* the interrupt processing.
*
* The TMS27 support should provide two software generated interrupt requests,
* one low priority request raised by Cause_tm27_intr() and one higher priority
* request raised by Lower_tm27_intr(). Both requests should be cleared by
* Clear_tm27_intr(). A handler provided by the test should be installed
* through Install_tm27_vector(). This function should initialize the system
* so that the software generated interrupt requests can be raised and cleared.
*
* If the raise functions Cause_tm27_intr() and Lower_tm27_intr() do not
* trigger the interrupt immediately, then the TM27 support shall define
* MUST_WAIT_FOR_INTERRUPT to one, otherwise MUST_WAIT_FOR_INTERRUPT shall be
* defined to zero.
*
* The TM27 support may define TM27_INTERRUPT_VECTOR_DEFAULT to indicate the
* interrupt vector of the interrupt request raised by Cause_tm27_intr().
*/
/**

View File

@@ -140,6 +140,7 @@ void CallWithinISRWait( const CallWithinISRRequest *request )
}
}
#if !defined( TM27_INTERRUPT_VECTOR_DEFAULT )
static void CallWithinISRIsHandlerInstalled(
void *arg,
const char *info,
@@ -152,13 +153,17 @@ static void CallWithinISRIsHandlerInstalled(
(void) option;
(void) handler_arg;
if ( handler == CallWithinISRHandler ) {
if ( handler == CallWithinISRHandler && handler_arg == NULL ) {
*(bool *) arg = true;
}
}
#endif
rtems_vector_number CallWithinISRGetVector( void )
{
#if defined( TM27_INTERRUPT_VECTOR_DEFAULT )
return TM27_INTERRUPT_VECTOR_DEFAULT;
#else
rtems_vector_number vector;
for ( vector = 0; vector < BSP_INTERRUPT_VECTOR_COUNT; ++vector ) {
@@ -177,6 +182,7 @@ rtems_vector_number CallWithinISRGetVector( void )
}
return UINT32_MAX;
#endif
}
static void CallWithinISRInitialize( void )