diff options
Diffstat (limited to 'cpukit/score/cpu/nios2')
-rw-r--r-- | cpukit/score/cpu/nios2/nios2-isr-get-level.c | 12 | ||||
-rw-r--r-- | cpukit/score/cpu/nios2/rtems/score/cpu.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/cpukit/score/cpu/nios2/nios2-isr-get-level.c b/cpukit/score/cpu/nios2/nios2-isr-get-level.c index 498bc791ef..7c7f6a2b71 100644 --- a/cpukit/score/cpu/nios2/nios2-isr-get-level.c +++ b/cpukit/score/cpu/nios2/nios2-isr-get-level.c @@ -19,6 +19,18 @@ #include <rtems/score/interr.h> #include <rtems/score/nios2-utility.h> +bool _CPU_ISR_Is_enabled( uint32_t level ) +{ + switch ( _Nios2_ISR_Get_status_mask() ) { + case NIOS2_ISR_STATUS_MASK_EIC_IL: + return ((status & NIOS2_STATUS_IL_MASK) >> NIOS2_STATUS_IL_OFFSET) == 0; + case NIOS2_ISR_STATUS_MASK_EIC_RSIE: + return (status & NIOS2_STATUS_RSIE) != 0; + default: + return (status & NIOS2_STATUS_PIE) != 0; + } +} + uint32_t _CPU_ISR_Get_level( void ) { uint32_t status = _Nios2_Get_ctlreg_status(); diff --git a/cpukit/score/cpu/nios2/rtems/score/cpu.h b/cpukit/score/cpu/nios2/rtems/score/cpu.h index b1defd2ef9..1e9b7b3801 100644 --- a/cpukit/score/cpu/nios2/rtems/score/cpu.h +++ b/cpukit/score/cpu/nios2/rtems/score/cpu.h @@ -241,6 +241,8 @@ typedef struct { __builtin_wrctl( 0, _status ); \ } while ( 0 ) +bool _CPU_ISR_Is_enabled( uint32_t level ); + /** * @brief Sets the interrupt level for the executing thread. * |