aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/include
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-11-14 11:07:04 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-11-14 11:07:04 +0000
commit1409bd15bd3bfa57c042caaed6d4b755e23ca235 (patch)
treef48570162d8e519978a3f50584f37a159c6fb95e /os/rt/include
parent79a15865134fdc2522db29995bd5417e7b00a0d6 (diff)
downloadChibiOS-1409bd15bd3bfa57c042caaed6d4b755e23ca235.tar.gz
ChibiOS-1409bd15bd3bfa57c042caaed6d4b755e23ca235.tar.bz2
ChibiOS-1409bd15bd3bfa57c042caaed6d4b755e23ca235.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7507 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/include')
-rw-r--r--os/rt/include/chdebug.h13
-rw-r--r--os/rt/include/chschd.h64
-rw-r--r--os/rt/include/chsystypes.h5
-rw-r--r--os/rt/include/chtm.h10
4 files changed, 54 insertions, 38 deletions
diff --git a/os/rt/include/chdebug.h b/os/rt/include/chdebug.h
index d0223ef10..d8643ea64 100644
--- a/os/rt/include/chdebug.h
+++ b/os/rt/include/chdebug.h
@@ -71,13 +71,6 @@
/* Derived constants and error checks. */
/*===========================================================================*/
-#if CH_DBG_ENABLE_ASSERTS || CH_DBG_ENABLE_CHECKS || \
- CH_DBG_ENABLE_STACK_CHECK || CH_DBG_SYSTEM_STATE_CHECK
-#define CH_DBG_ENABLED TRUE
-#else
-#define CH_DBG_ENABLED FALSE
-#endif
-
/*===========================================================================*/
/* Module data structures and types. */
/*===========================================================================*/
@@ -129,8 +122,8 @@ typedef struct {
/*===========================================================================*/
#if CH_DBG_SYSTEM_STATE_CHECK
-#define _dbg_enter_lock() (ch.dbg_lock_cnt = 1)
-#define _dbg_leave_lock() (ch.dbg_lock_cnt = 0)
+#define _dbg_enter_lock() (ch.dbg.lock_cnt = 1)
+#define _dbg_leave_lock() (ch.dbg.lock_cnt = 0)
#endif
/* When the state checker feature is disabled then the following functions
@@ -221,7 +214,7 @@ extern "C" {
void chDbgCheckClassS(void);
#endif
#if CH_DBG_ENABLE_TRACE || defined(__DOXYGEN__)
- void _trace_init(void);
+ void _dbg_trace_init(void);
void _dbg_trace(thread_t *otp);
#endif
#ifdef __cplusplus
diff --git a/os/rt/include/chschd.h b/os/rt/include/chschd.h
index 8a7a59aae..f2deb3b92 100644
--- a/os/rt/include/chschd.h
+++ b/os/rt/include/chschd.h
@@ -285,6 +285,36 @@ struct ch_ready_list {
};
/**
+ * @brief System debug data structure.
+ */
+struct ch_system_debug {
+ /**
+ * @brief Pointer to the panic message.
+ * @details This pointer is meant to be accessed through the debugger, it is
+ * written once and then the system is halted.
+ * @note Accesses to this pointer must never be optimized out so the
+ * field itself is declared volatile.
+ */
+ const char * volatile panic_msg;
+#if CH_DBG_SYSTEM_STATE_CHECK || defined(__DOXYGEN__)
+ /**
+ * @brief ISR nesting level.
+ */
+ cnt_t isr_cnt;
+ /**
+ * @brief Lock nesting level.
+ */
+ cnt_t lock_cnt;
+#endif
+#if CH_DBG_ENABLE_TRACE || defined(__DOXYGEN__)
+ /**
+ * @brief Public trace buffer.
+ */
+ ch_trace_buffer_t trace_buffer;
+#endif
+};
+
+/**
* @brief System data structure.
* @note This structure contain all the data areas used by the OS except
* stacks.
@@ -298,11 +328,15 @@ struct ch_system {
* @brief Virtual timers delta list header.
*/
virtual_timers_list_t vtlist;
+ /**
+ * @brief System debug.
+ */
+ system_debug_t dbg;
#if CH_CFG_USE_TM || defined(__DOXYGEN__)
/**
- * @brief Measurement calibration value.
+ * @brief Time measurement calibration data.
*/
- rtcnt_t measurement_offset;
+ tm_calibration_t tm;
#endif
#if CH_DBG_STATISTICS || defined(__DOXYGEN__)
/**
@@ -310,32 +344,6 @@ struct ch_system {
*/
kernel_stats_t kernel_stats;
#endif
-#if CH_DBG_ENABLED || defined(__DOXYGEN__)
- /**
- * @brief Pointer to the panic message.
- * @details This pointer is meant to be accessed through the debugger, it is
- * written once and then the system is halted.
- * @note Accesses to this pointer must never be optimized out so the
- * field itself is declared volatile.
- */
- const char * volatile dbg_panic_msg;
-#endif
-#if CH_DBG_SYSTEM_STATE_CHECK || defined(__DOXYGEN__)
- /**
- * @brief ISR nesting level.
- */
- cnt_t dbg_isr_cnt;
- /**
- * @brief Lock nesting level.
- */
- cnt_t dbg_lock_cnt;
-#endif
-#if CH_DBG_ENABLE_TRACE || defined(__DOXYGEN__)
- /**
- * @brief Public trace buffer.
- */
- ch_trace_buffer_t dbg_trace_buffer;
-#endif
};
/*===========================================================================*/
diff --git a/os/rt/include/chsystypes.h b/os/rt/include/chsystypes.h
index 2a64488db..cf42b80bc 100644
--- a/os/rt/include/chsystypes.h
+++ b/os/rt/include/chsystypes.h
@@ -98,6 +98,11 @@ typedef struct ch_virtual_timer virtual_timer_t;
typedef struct ch_virtual_timers_list virtual_timers_list_t;
/**
+ * @brief Type of a system debug structure.
+ */
+typedef struct ch_system_debug system_debug_t;
+
+/**
* @brief Type of system data structure.
*/
typedef struct ch_system ch_system_t;
diff --git a/os/rt/include/chtm.h b/os/rt/include/chtm.h
index 73850aad7..1bcd4b452 100644
--- a/os/rt/include/chtm.h
+++ b/os/rt/include/chtm.h
@@ -52,6 +52,16 @@
/*===========================================================================*/
/**
+ * @brief Type of a time measurement calibration data.
+ */
+typedef struct {
+ /**
+ * @brief Measurement calibration value.
+ */
+ rtcnt_t offset;
+} tm_calibration_t;
+
+/**
* @brief Type of a Time Measurement object.
* @note The maximum measurable time period depends on the implementation
* of the realtime counter and its clock frequency.