aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/include
diff options
context:
space:
mode:
Diffstat (limited to 'os/kernel/include')
-rw-r--r--os/kernel/include/chstats.h19
-rw-r--r--os/kernel/include/chsys.h12
-rw-r--r--os/kernel/include/chtm.h10
3 files changed, 22 insertions, 19 deletions
diff --git a/os/kernel/include/chstats.h b/os/kernel/include/chstats.h
index dee5c9bec..d2a83e1b6 100644
--- a/os/kernel/include/chstats.h
+++ b/os/kernel/include/chstats.h
@@ -55,12 +55,15 @@
* @brief Type of a kernel statistics structure.
*/
typedef struct {
- ucnt_t nirq; /**< @brief IRQ number.
- @note Fast Interrupts are not
- accounted for. */
- ucnt_t nctxswc; /**< @brief Context switch number. */
- time_measurement_t critical; /**< @brief Critical zones measurement. */
- time_measurement_t isr; /**< @brief ISR measurement. */
+ time_measurement_t *current; /**< @brief Currently under measurement.*/
+ ucnt_t n_irq; /**< @brief Number of IRQs. */
+ ucnt_t n_ctxswc; /**< @brief Number of context switches. */
+ time_measurement_t m_crit_thd; /**< @brief Measurement of threads
+ critical zones duration. */
+ time_measurement_t m_crit_isr; /**< @brief Measurement of ISRs critical
+ zones duration. */
+ time_measurement_t m_isr; /**< @brief Measurement of ISRs total
+ duration. */
} kernel_stats_t;
/*===========================================================================*/
@@ -70,12 +73,12 @@ typedef struct {
/**
* @brief Increases the IRQ counter.
*/
-#define _stats_increase_irq() kernel_stats.nirq++
+#define _stats_increase_irq() kernel_stats.n_irq++
/**
* @brief Increases the context switch counter.
*/
-#define _stats_increase_ctxswc() kernel_stats.nctxswc++
+#define _stats_increase_ctxswc() kernel_stats.n_ctxswc++
/*===========================================================================*/
/* External declarations. */
diff --git a/os/kernel/include/chsys.h b/os/kernel/include/chsys.h
index 0fd07b96b..722323d54 100644
--- a/os/kernel/include/chsys.h
+++ b/os/kernel/include/chsys.h
@@ -182,18 +182,16 @@
/**
* @brief Returns the current value of the system real time counter.
- * @note This function can be called from any context.
+ * @note This function is only available if the port layer supports the
+ * option @p CH_PORT_SUPPORTS_RT.
*
* @return The value of the system realtime counter of
- * type rtcnt_t. If the port does not support a
- * realtime counter then zero is returned.
+ * type rtcnt_t.
*
* @xclass
*/
#if CH_PORT_SUPPORTS_RT || defined(__DOXYGEN__)
#define chSysGetRealtimeCounterX() (rtcnt_t)port_rt_get_counter_value()
-#else
-#define chSysGetRealtimeCounterX() 0
#endif
/*===========================================================================*/
@@ -208,6 +206,10 @@ extern "C" {
void chSysTimerHandlerI(void);
syssts_t chSysGetAndLockX(void);
void chSysRestoreLockX(syssts_t sts);
+#if CH_PORT_SUPPORTS_RT
+ bool chSysIsCounterWithinX(rtcnt_t cnt, rtcnt_t start, rtcnt_t end);
+ void chSysPolledDelayX(rtcnt_t cycles);
+#endif
#ifdef __cplusplus
}
#endif
diff --git a/os/kernel/include/chtm.h b/os/kernel/include/chtm.h
index bd1d73dd9..8d8d021fd 100644
--- a/os/kernel/include/chtm.h
+++ b/os/kernel/include/chtm.h
@@ -81,13 +81,11 @@ typedef struct {
extern "C" {
#endif
void _tm_init(void);
- bool chTMIsCounterWithinX(rtcnt_t cnt, rtcnt_t start, rtcnt_t end);
- void chTMPolledDelayX(rtcnt_t cycles);
void chTMObjectInit(time_measurement_t *tmp);
- NOINLINE void chTMStartX(time_measurement_t *tmp);
- NOINLINE void chTMStopX(time_measurement_t *tmp);
- NOINLINE void chTMChainToX(time_measurement_t *tmp1,
- time_measurement_t *tmp2);
+ NOINLINE void chTMStartMeasurementX(time_measurement_t *tmp);
+ NOINLINE void chTMStopMeasurementX(time_measurement_t *tmp);
+ NOINLINE void chTMChainMeasurementToX(time_measurement_t *tmp1,
+ time_measurement_t *tmp2);
#ifdef __cplusplus
}
#endif