diff options
Diffstat (limited to '')
-rw-r--r-- | cpukit/rtems/include/rtems/rtems/ratemon.h | 33 | ||||
-rw-r--r-- | cpukit/rtems/include/rtems/rtems/ratemonimpl.h | 13 |
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, |