From 2cc25cf1b22f36c00c774c3abff94b4ba5dcf26c Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 May 2021 17:33:24 +0200 Subject: 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(). --- cpukit/include/rtems/score/percpu.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cpukit/include/rtems/score/percpu.h') 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 ) -- cgit v1.2.3