mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-03-27 13:49:56 +00:00
tm27: Add TM27_INTERRUPT_VECTOR_ALTERNATIVE
The TM27 support may define TM27_INTERRUPT_VECTOR_ALTERNATIVE to provide an alternative software generated interrupt request which is raised by _TM27_Raise_alternative() and cleared by _TM27_Clear_alternative(). Both functions shall return an RTEMS status code. This interrupt vector may be used to test the interrupt controller support on targets which do not provide generic software generated interrupts. Update #3716.
This commit is contained in:
@@ -60,6 +60,13 @@
|
||||
*
|
||||
* The TM27 support may define TM27_INTERRUPT_VECTOR_DEFAULT to indicate the
|
||||
* interrupt vector of the interrupt request raised by Cause_tm27_intr().
|
||||
*
|
||||
* The TM27 support may define TM27_INTERRUPT_VECTOR_ALTERNATIVE to provide an
|
||||
* alternative software generated interrupt request which is raised by
|
||||
* _TM27_Raise_alternative() and cleared by _TM27_Clear_alternative(). Both
|
||||
* functions shall return an RTEMS status code. This interrupt vector may be
|
||||
* used to test the interrupt controller support on targets which do not
|
||||
* provide generic software generated interrupts.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -431,11 +431,8 @@ static void Routine( Context *ctx, uint32_t counter )
|
||||
|
||||
ctx->handler_counter = counter;
|
||||
|
||||
if (
|
||||
ctx->attributes.can_clear &&
|
||||
!ctx->attributes.cleared_by_acknowledge
|
||||
) {
|
||||
sc = rtems_interrupt_clear( ctx->test_vector );
|
||||
if ( !ctx->attributes.cleared_by_acknowledge ) {
|
||||
sc = ClearSoftwareInterrupt( ctx->test_vector );
|
||||
T_rsc_success( sc );
|
||||
}
|
||||
|
||||
@@ -544,7 +541,7 @@ static void Action( void *arg )
|
||||
T_rsc_success( sc );
|
||||
|
||||
if ( ctx->status == RTEMS_SUCCESSFUL ) {
|
||||
sc = rtems_interrupt_raise( ctx->test_vector );
|
||||
sc = RaiseSoftwareInterrupt( ctx->test_vector );
|
||||
T_rsc_success( sc );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,6 +185,37 @@ rtems_vector_number CallWithinISRGetVector( void )
|
||||
#endif
|
||||
}
|
||||
|
||||
rtems_vector_number GetSoftwareInterruptVector( void )
|
||||
{
|
||||
#if defined( TM27_INTERRUPT_VECTOR_ALTERNATIVE )
|
||||
return TM27_INTERRUPT_VECTOR_ALTERNATIVE;
|
||||
#else
|
||||
return UINT32_MAX;
|
||||
#endif
|
||||
}
|
||||
|
||||
rtems_status_code RaiseSoftwareInterrupt( rtems_vector_number vector )
|
||||
{
|
||||
#if defined( TM27_INTERRUPT_VECTOR_ALTERNATIVE )
|
||||
if ( vector == TM27_INTERRUPT_VECTOR_ALTERNATIVE ) {
|
||||
return _TM27_Raise_alternative();
|
||||
}
|
||||
#endif
|
||||
|
||||
return rtems_interrupt_raise( vector );
|
||||
}
|
||||
|
||||
rtems_status_code ClearSoftwareInterrupt( rtems_vector_number vector )
|
||||
{
|
||||
#if defined( TM27_INTERRUPT_VECTOR_ALTERNATIVE )
|
||||
if ( vector == TM27_INTERRUPT_VECTOR_ALTERNATIVE ) {
|
||||
return _TM27_Clear_alternative();
|
||||
}
|
||||
#endif
|
||||
|
||||
return rtems_interrupt_clear( vector );
|
||||
}
|
||||
|
||||
static void CallWithinISRInitialize( void )
|
||||
{
|
||||
Install_tm27_vector( CallWithinISRHandler );
|
||||
|
||||
@@ -139,6 +139,10 @@ rtems_vector_number GetTestableInterruptVector(
|
||||
}
|
||||
}
|
||||
|
||||
if ( vector == BSP_INTERRUPT_VECTOR_COUNT ) {
|
||||
vector = GetSoftwareInterruptVector();
|
||||
}
|
||||
|
||||
return vector;
|
||||
}
|
||||
|
||||
|
||||
@@ -396,6 +396,8 @@ void CallWithinISRClear( void );
|
||||
|
||||
rtems_vector_number CallWithinISRGetVector( void );
|
||||
|
||||
rtems_vector_number GetSoftwareInterruptVector( void );
|
||||
|
||||
typedef struct {
|
||||
Thread_queue_Operations tq_ops;
|
||||
const Thread_queue_Operations *wrapped_ops;
|
||||
@@ -437,6 +439,10 @@ rtems_vector_number GetTestableInterruptVector(
|
||||
const rtems_interrupt_attributes *required
|
||||
);
|
||||
|
||||
rtems_status_code RaiseSoftwareInterrupt( rtems_vector_number vector );
|
||||
|
||||
rtems_status_code ClearSoftwareInterrupt( rtems_vector_number vector );
|
||||
|
||||
bool HasInterruptVectorEntriesInstalled( rtems_vector_number vector );
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user