summaryrefslogtreecommitdiffstats
path: root/cpukit/include
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-02-14 12:58:21 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-02-25 07:15:18 +0100
commit308a2e0fdcde94b8549dcf9dcdd42eea3cdc9f27 (patch)
tree8506b6d215e4b4578627c749befdf2c98bb0b5b2 /cpukit/include
parentconfig: Add _Watchdog_Microseconds_per_tick (diff)
downloadrtems-308a2e0fdcde94b8549dcf9dcdd42eea3cdc9f27.tar.bz2
config: Add _Watchdog_Ticks_per_timeslice
Move the ticks per timeslice configuration constant out of the configuration table. Add WATCHDOG_TICKS_PER_TIMESLICE_DEFAULT and use it to provide a default definition of the watchdog ticks per timeslice constant. Update #3875.
Diffstat (limited to 'cpukit/include')
-rw-r--r--cpukit/include/rtems/confdefs.h11
-rw-r--r--cpukit/include/rtems/config.h7
-rw-r--r--cpukit/include/rtems/score/watchdogticks.h13
3 files changed, 22 insertions, 9 deletions
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 1254e3d209..b1c3a4a2d2 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -1967,10 +1967,16 @@ extern "C" {
#endif
/** The configures the number of clock ticks per timeslice. */
-#ifndef CONFIGURE_TICKS_PER_TIMESLICE
- #define CONFIGURE_TICKS_PER_TIMESLICE 50
+#if defined(CONFIGURE_TICKS_PER_TIMESLICE) && \
+ CONFIGURE_TICKS_PER_TIMESLICE != WATCHDOG_TICKS_PER_TIMESLICE_DEFAULT
+
+#ifdef CONFIGURE_INIT
+ const uint32_t _Watchdog_Ticks_per_timeslice =
+ CONFIGURE_TICKS_PER_TIMESLICE;
#endif
+#endif /* CONFIGURE_TICKS_PER_TIMESLICE */
+
/**@}*/ /* end of General Configuration */
/*
@@ -2626,7 +2632,6 @@ struct _reent *__getreent(void)
*/
const rtems_configuration_table Configuration = {
CONFIGURE_EXECUTIVE_RAM_SIZE, /* required RTEMS workspace */
- CONFIGURE_TICKS_PER_TIMESLICE, /* ticks per timeslice quantum */
CONFIGURE_IDLE_TASK_BODY, /* user's IDLE task */
CONFIGURE_IDLE_TASK_STACK_SIZE, /* IDLE task stack size */
#ifdef CONFIGURE_UNIFIED_WORK_AREAS /* true for unified work areas */
diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h
index 84917366f3..31a667a1d6 100644
--- a/cpukit/include/rtems/config.h
+++ b/cpukit/include/rtems/config.h
@@ -87,11 +87,6 @@ typedef struct {
uintptr_t work_space_size;
/**
- * This field specifies the number of ticks in each task's timeslice.
- */
- uint32_t ticks_per_timeslice;
-
- /**
* This element points to the BSP's optional idle task which may override
* the default one provided with RTEMS.
*/
@@ -163,7 +158,7 @@ uint32_t rtems_configuration_get_maximum_extensions( void );
(_Watchdog_Nanoseconds_per_tick)
#define rtems_configuration_get_ticks_per_timeslice() \
- (Configuration.ticks_per_timeslice)
+ (_Watchdog_Ticks_per_timeslice)
#define rtems_configuration_get_idle_task() \
(Configuration.idle_task)
diff --git a/cpukit/include/rtems/score/watchdogticks.h b/cpukit/include/rtems/score/watchdogticks.h
index 226de39c24..ea2651954c 100644
--- a/cpukit/include/rtems/score/watchdogticks.h
+++ b/cpukit/include/rtems/score/watchdogticks.h
@@ -43,6 +43,11 @@ typedef uint32_t Watchdog_Interval;
#define WATCHDOG_NO_TIMEOUT 0
/**
+ * @brief Default value for the watchdog ticks per timeslice.
+ */
+#define WATCHDOG_TICKS_PER_TIMESLICE_DEFAULT 50
+
+/**
* @brief The watchdog ticks counter.
*
* With a 1ms watchdog tick, this counter overflows after 50 days since boot.
@@ -73,6 +78,14 @@ extern const uint32_t _Watchdog_Nanoseconds_per_tick;
*/
extern const uint32_t _Watchdog_Ticks_per_second;
+/**
+ * @brief The watchdog ticks per timeslice.
+ *
+ * This constant is defined by the application configuration via
+ * <rtems/confdefs.h>.
+ */
+extern const uint32_t _Watchdog_Ticks_per_timeslice;
+
/** @} */
#ifdef __cplusplus