summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/include/rtems/rtems
diff options
context:
space:
mode:
authorKuan-Hsun Chen <c0066c@gmail.com>2016-12-21 17:42:39 +0100
committerGedare Bloom <gedare@rtems.org>2017-01-13 13:55:13 -0500
commit3a46b72455721c223ad1501c209a9e414d409f7a (patch)
tree3c5eb108d65ec14ffcc93063627bad2ec4b97fdc /cpukit/rtems/include/rtems/rtems
parentposix: shared memory support (diff)
downloadrtems-3a46b72455721c223ad1501c209a9e414d409f7a.tar.bz2
Enhancement of the RMS manager for the overrun handling.
Three additional functions: rtems_rate_monotonic_postponed_job_count, _Rate_monotonic_Renew_deadline, and _Rate_monotonic_Release_postponed_job. Four refined functions: _Rate_monotonic_Activate, _Rate_monotonic_Block_while_expired, rtems_rate_monotonic_period, _Rate_monotonic_Timeout. Rate_monotonic_Control contains one counter for counting the postponed jobs and one for recording the recent deadline. Update #2795.
Diffstat (limited to '')
-rw-r--r--cpukit/rtems/include/rtems/rtems/ratemon.h33
-rw-r--r--cpukit/rtems/include/rtems/rtems/ratemonimpl.h13
2 files changed, 46 insertions, 0 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/ratemon.h b/cpukit/rtems/include/rtems/rtems/ratemon.h
index 50b847840f..2eadfc2a7c 100644
--- a/cpukit/rtems/include/rtems/rtems/ratemon.h
+++ b/cpukit/rtems/include/rtems/rtems/ratemon.h
@@ -18,10 +18,12 @@
* - delete a rate monotonic timer
* - conclude current and start the next period
* - obtain status information on a period
+ * - obtain the number of postponed jobs
*/
/* COPYRIGHT (c) 1989-2009, 2016.
* On-Line Applications Research Corporation (OAR).
+ * COPYRIGHT (c) 2016 Kuan-Hsun Chen.
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
@@ -240,6 +242,18 @@ typedef struct {
* This field contains the statistics maintained for the period.
*/
Rate_monotonic_Statistics Statistics;
+
+ /**
+ * This field contains the number of postponed jobs.
+ * When the watchdog timeout, this variable will be increased immediately.
+ */
+ uint32_t postponed_jobs;
+
+ /**
+ * This field contains the tick of the latest deadline decided by the period
+ * watchdog.
+ */
+ uint64_t latest_deadline;
} Rate_monotonic_Control;
/**
@@ -403,6 +417,25 @@ rtems_status_code rtems_rate_monotonic_period(
rtems_interval length
);
+/**
+ * @brief RTEMS Return the number of postponed jobs
+ *
+ * This is a helper function for runtime monitoring to return
+ * the number of postponed jobs in this given period. This number
+ * is only increased by the corresponding watchdog,
+ * and is decreased by RMS manager with the postponed job releasing.
+ *
+ * @param[in] id is the period id
+ *
+ * @retval This helper function returns the number of postponed
+ * jobs with a given period_id.
+ *
+ */
+uint32_t rtems_rate_monotonic_postponed_num(
+ rtems_id period_id
+);
+
+
/**@}*/
#ifdef __cplusplus
diff --git a/cpukit/rtems/include/rtems/rtems/ratemonimpl.h b/cpukit/rtems/include/rtems/rtems/ratemonimpl.h
index b6b3ffd404..c4133c7e03 100644
--- a/cpukit/rtems/include/rtems/rtems/ratemonimpl.h
+++ b/cpukit/rtems/include/rtems/rtems/ratemonimpl.h
@@ -9,6 +9,7 @@
/* COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
* Copyright (c) 2016 embedded brains GmbH.
+ * COPYRIGHT (c) 2016 Kuan-Hsun Chen.
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
@@ -116,6 +117,18 @@ bool _Rate_monotonic_Get_status(
Timestamp_Control *cpu_since_last_period
);
+/**
+ * @brief Renew the watchdog deadline
+ *
+ * This routine is prepared for the watchdog timeout to renew its deadline
+ * without releasing jobs.
+ */
+void _Rate_monotonic_Renew_deadline(
+ Rate_monotonic_Control *the_period,
+ Thread_Control *owner,
+ ISR_lock_Context *lock_context
+);
+
void _Rate_monotonic_Restart(
Rate_monotonic_Control *the_period,
Thread_Control *owner,