diff options
Diffstat (limited to 'cpukit/score/include/rtems/score/profiling.h')
-rw-r--r-- | cpukit/score/include/rtems/score/profiling.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/profiling.h b/cpukit/score/include/rtems/score/profiling.h index f5fa6cc241..a6ab283ae6 100644 --- a/cpukit/score/include/rtems/score/profiling.h +++ b/cpukit/score/include/rtems/score/profiling.h @@ -24,6 +24,7 @@ #define _RTEMS_SCORE_PROFILING #include <rtems/score/percpu.h> +#include <rtems/score/isrlock.h> #ifdef __cplusplus extern "C" { @@ -55,6 +56,26 @@ static inline void _Profiling_Thread_dispatch_disable( #endif } +static inline void _Profiling_Thread_dispatch_disable_critical( + Per_CPU_Control *cpu, + uint32_t previous_thread_dispatch_disable_level, + const ISR_lock_Context *lock_context +) +{ +#if defined( RTEMS_PROFILING ) + if ( previous_thread_dispatch_disable_level == 0 ) { + Per_CPU_Stats *stats = &cpu->Stats; + + stats->thread_dispatch_disabled_instant = lock_context->ISR_disable_instant; + ++stats->thread_dispatch_disabled_count; + } +#else + (void) cpu; + (void) previous_thread_dispatch_disable_level; + (void) lock_context; +#endif +} + static inline void _Profiling_Thread_dispatch_enable( Per_CPU_Control *cpu, uint32_t new_thread_dispatch_disable_level |