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:
Sebastian Huber
2023-12-18 12:02:31 +01:00
parent 2e71bd08ba
commit 93f927de26
5 changed files with 51 additions and 6 deletions

View File

@@ -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.
*/
/**

View File

@@ -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 );
}
}

View File

@@ -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 );

View File

@@ -139,6 +139,10 @@ rtems_vector_number GetTestableInterruptVector(
}
}
if ( vector == BSP_INTERRUPT_VECTOR_COUNT ) {
vector = GetSoftwareInterruptVector();
}
return vector;
}

View File

@@ -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 );
/**