From 03b900d3ed120ea919ea3eded7edbece3488cff3 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 18 Feb 2016 08:36:26 +0100 Subject: score: Replace watchdog handler implementation Use a red-black tree instead of delta chains. Close #2344. Update #2554. Update #2555. Close #2606. --- cpukit/score/include/rtems/score/percpu.h | 53 +++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) (limited to 'cpukit/score/include/rtems/score/percpu.h') diff --git a/cpukit/score/include/rtems/score/percpu.h b/cpukit/score/include/rtems/score/percpu.h index 39be1e3367..22017889b3 100644 --- a/cpukit/score/include/rtems/score/percpu.h +++ b/cpukit/score/include/rtems/score/percpu.h @@ -23,10 +23,11 @@ #include #else #include - #include + #include #include #include #include + #include #endif #ifdef __cplusplus @@ -41,7 +42,7 @@ extern "C" { * processor. */ #if defined( RTEMS_PROFILING ) - #define PER_CPU_CONTROL_SIZE_LOG2 8 + #define PER_CPU_CONTROL_SIZE_LOG2 9 #else #define PER_CPU_CONTROL_SIZE_LOG2 7 #endif @@ -225,6 +226,32 @@ typedef struct { #endif /* defined( RTEMS_PROFILING ) */ } Per_CPU_Stats; +/** + * @brief Per-CPU watchdog header index. + */ +typedef enum { + /** + * @brief Index for relative per-CPU watchdog header. + * + * The reference time point for this header is current ticks value + * during insert. Time is measured in clock ticks. + */ + PER_CPU_WATCHDOG_RELATIVE, + + /** + * @brief Index for absolute per-CPU watchdog header. + * + * The reference time point for this header is the POSIX Epoch. Time is + * measured in nanoseconds since POSIX Epoch. + */ + PER_CPU_WATCHDOG_ABSOLUTE, + + /** + * @brief Count of per-CPU watchdog headers. + */ + PER_CPU_WATCHDOG_COUNT +} Per_CPU_Watchdog_index; + /** * @brief Per CPU Core Structure * @@ -309,6 +336,28 @@ typedef struct Per_CPU_Control { /** This is the time of the last context switch on this CPU. */ Timestamp_Control time_of_last_context_switch; + /** + * @brief Watchdog state for this processor. + */ + struct { + /** + * @brief Protects all watchdog operations on this processor. + */ + ISR_LOCK_MEMBER( Lock ) + + /** + * @brief Watchdog ticks on this processor used for relative watchdogs. + */ + uint64_t ticks; + + /** + * @brief Header for watchdogs. + * + * @see Per_CPU_Watchdog_index. + */ + Watchdog_Header Header[ PER_CPU_WATCHDOG_COUNT ]; + } Watchdog; + #if defined( RTEMS_SMP ) /** * @brief This lock protects some parts of the low-level thread dispatching. -- cgit v1.2.3