diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-05-14 17:33:24 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-05-17 08:05:31 +0200 |
commit | 2cc25cf1b22f36c00c774c3abff94b4ba5dcf26c (patch) | |
tree | 1cdc947b93a5c411c39421ab990a2538d46dc11a /cpukit/include/rtems/score/percpu.h | |
parent | score: Improve parameters in _Thread_Change_life() (diff) | |
download | rtems-2cc25cf1b22f36c00c774c3abff94b4ba5dcf26c.tar.bz2 |
score: Add and use _Per_CPU_Is_ISR_in_progress()
Add _Per_CPU_Is_ISR_in_progress() as an optimized version of
_ISR_Is_in_progress().
Diffstat (limited to 'cpukit/include/rtems/score/percpu.h')
-rw-r--r-- | cpukit/include/rtems/score/percpu.h | 10 |
1 files changed, 10 insertions, 0 deletions
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 ) |