diff options
Diffstat (limited to 'cpukit/include')
-rw-r--r-- | cpukit/include/rtems/score/isr.h | 12 | ||||
-rw-r--r-- | cpukit/include/rtems/score/isrlevel.h | 11 | ||||
-rw-r--r-- | cpukit/include/rtems/score/percpu.h | 10 |
3 files changed, 21 insertions, 12 deletions
diff --git a/cpukit/include/rtems/score/isr.h b/cpukit/include/rtems/score/isr.h index 3c6a9f1e2c..47c24f3a72 100644 --- a/cpukit/include/rtems/score/isr.h +++ b/cpukit/include/rtems/score/isr.h @@ -147,18 +147,6 @@ void _ISR_Handler_initialization ( void ); */ void _ISR_Handler( void ); -/** - * @brief Checks if an ISR in progress. - * - * This function returns true if the processor is currently servicing - * and interrupt and false otherwise. A return value of true indicates - * that the caller is an interrupt service routine, NOT a thread. - * - * @retval true Returns true when called from an ISR. - * @retval false Returns false when not called from an ISR. - */ -bool _ISR_Is_in_progress( void ); - #ifdef __cplusplus } #endif diff --git a/cpukit/include/rtems/score/isrlevel.h b/cpukit/include/rtems/score/isrlevel.h index 3981f2c688..d578a32c48 100644 --- a/cpukit/include/rtems/score/isrlevel.h +++ b/cpukit/include/rtems/score/isrlevel.h @@ -144,6 +144,17 @@ typedef uint32_t ISR_Level; RTEMS_COMPILER_MEMORY_BARRIER(); \ } while (0) +/** + * @brief Checks if an ISR in progress. + * + * This function returns true, if the processor is currently servicing + * and interrupt, and false otherwise. A return value of true indicates + * that the caller is an interrupt service routine, **not** a thread. + * + * @return true Returns true, if called from within an ISR, otherwise false. + */ +bool _ISR_Is_in_progress( void ); + /** @} */ #ifdef __cplusplus diff --git a/cpukit/include/rtems/score/percpu.h b/cpukit/include/rtems/score/percpu.h index 58a89ec7a9..1aed17ab19 100644 --- a/cpukit/include/rtems/score/percpu.h +++ b/cpukit/include/rtems/score/percpu.h @@ -683,6 +683,16 @@ static inline struct _Thread_Control *_Per_CPU_Get_executing( return cpu->executing; } +static inline bool _Per_CPU_Is_ISR_in_progress( const Per_CPU_Control *cpu ) +{ +#if CPU_PROVIDES_ISR_IS_IN_PROGRESS == TRUE + (void) cpu; + return _ISR_Is_in_progress(); +#else + return cpu->isr_nest_level != 0; +#endif +} + static inline bool _Per_CPU_Is_processor_online( const Per_CPU_Control *cpu ) |