diff options
Diffstat (limited to 'testsuites/validation/tx-call-within-isr.c')
-rw-r--r-- | testsuites/validation/tx-call-within-isr.c | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/testsuites/validation/tx-call-within-isr.c b/testsuites/validation/tx-call-within-isr.c index 91560b70b0..8bbe0e7c29 100644 --- a/testsuites/validation/tx-call-within-isr.c +++ b/testsuites/validation/tx-call-within-isr.c @@ -3,7 +3,7 @@ /** * @file * - * @ingroup RTEMSTestSuites + * @ingroup RTEMSTestSuitesValidation * * @brief This source file contains the implementation of CallWithinISRClear(), * CallWithinISRGetVector(), CallWithinISR(), CallWithinISRRaise(), @@ -11,7 +11,7 @@ */ /* - * Copyright (C) 2021, 2022 embedded brains GmbH + * Copyright (C) 2021, 2022 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -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,38 @@ rtems_vector_number CallWithinISRGetVector( void ) } return UINT32_MAX; +#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 ) |