diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2024-01-16 10:47:35 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2024-03-11 14:40:06 +0100 |
commit | 85b55a7624bb8c16eb0745eb4dc8cc90bfec8d59 (patch) | |
tree | 88491d4028a5cb7428f396979ea4ad6aeb22ee05 /bsps | |
parent | validation/tc-sched-smp: Fix synchronization issue (diff) | |
download | rtems-85b55a7624bb8c16eb0745eb4dc8cc90bfec8d59.tar.bz2 |
bsps/clock: Fix fast idle for SMP
Diffstat (limited to 'bsps')
-rw-r--r-- | bsps/shared/dev/clock/clockimpl.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bsps/shared/dev/clock/clockimpl.h b/bsps/shared/dev/clock/clockimpl.h index e922c0b320..c58a6eb079 100644 --- a/bsps/shared/dev/clock/clockimpl.h +++ b/bsps/shared/dev/clock/clockimpl.h @@ -139,6 +139,21 @@ volatile uint32_t Clock_driver_ticks; #error "Clock_driver_support_shutdown_hardware() is no longer supported" #endif +#if CLOCK_DRIVER_USE_FAST_IDLE +static bool _Clock_Has_watchdogs(const Per_CPU_Control *cpu) +{ + size_t i; + + for (i = 0; i < RTEMS_ARRAY_SIZE(cpu->Watchdog.Header); ++i) { + if (_Watchdog_Header_first(&cpu->Watchdog.Header[i]) != NULL) { + return true; + } + } + + return false; +} +#endif + /** * @brief Clock_isr * @@ -182,6 +197,7 @@ rtems_isr Clock_isr( cpu_self->thread_dispatch_disable_level == cpu_self->isr_nest_level && cpu_self->heir == cpu_self->executing && cpu_self->executing->is_idle + && _Clock_Has_watchdogs(cpu_self) ) { ISR_lock_Context lock_context; |