diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-08-22 15:11:04 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-08-22 15:11:04 +0000 |
commit | d51331c78ad8c4c5ad4769d6271cb0e06c11beb1 (patch) | |
tree | 5daa533b98381972de75076bd89c13007aef261e /os/kernel/src/chregistry.c | |
parent | 4bdf358424068f452a4d5a450e6001a03ca4f819 (diff) | |
download | ChibiOS-d51331c78ad8c4c5ad4769d6271cb0e06c11beb1.tar.gz ChibiOS-d51331c78ad8c4c5ad4769d6271cb0e06c11beb1.tar.bz2 ChibiOS-d51331c78ad8c4c5ad4769d6271cb0e06c11beb1.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4614 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/src/chregistry.c')
-rw-r--r-- | os/kernel/src/chregistry.c | 57 |
1 files changed, 26 insertions, 31 deletions
diff --git a/os/kernel/src/chregistry.c b/os/kernel/src/chregistry.c index 5036a52bc..4a383a379 100644 --- a/os/kernel/src/chregistry.c +++ b/os/kernel/src/chregistry.c @@ -50,34 +50,11 @@ #if CH_USE_REGISTRY || defined(__DOXYGEN__)
-/* Converting configuration options in bit masks in order to be encoded in
- the global variable ch_root.*/
-#if CH_DBG_ENABLE_STACK_CHECK
-#define MSK_DBG_ENABLE_STACK_CHECK 1
-#else
-#define MSK_DBG_ENABLE_STACK_CHECK 0
-#endif
-
-#if CH_USE_DYNAMIC
-#define MSK_USE_DYNAMIC 2
-#else
-#define MSK_USE_DYNAMIC 0
-#endif
-
-#if CH_TIME_QUANTUM > 0
-#define MSK_TIME_QUANTUM 4
-#else
-#define MSK_TIME_QUANTUM 0
-#endif
-
-#if CH_DBG_THREADS_PROFILING
-#define MSK_DBG_THREADS_PROFILING 8
-#else
-#define MSK_DBG_THREADS_PROFILING 0
-#endif
+#define THD_OFFSET(field) (uint8_t)((size_t)&_mainthread.field - \
+ (size_t)&_mainthread)
-/**
- * @brief OS signature in ROM plus debug-related information.
+/*
+ * OS signature in ROM plus debug-related information.
*/
ROMCONST chroot_t ch_root = {
"CHRT",
@@ -87,12 +64,30 @@ ROMCONST chroot_t ch_root = { (CH_KERNEL_MINOR << 6) |
(CH_KERNEL_PATCH) << 0),
(uint8_t)sizeof (void *),
- (uint8_t)(MSK_DBG_THREADS_PROFILING | MSK_TIME_QUANTUM |
- MSK_USE_DYNAMIC | MSK_DBG_ENABLE_STACK_CHECK),
+ (uint8_t)sizeof (systime_t),
+ THD_OFFSET(p_prio),
+ THD_OFFSET(p_ctx),
+ THD_OFFSET(p_newer),
+ THD_OFFSET(p_older),
+ THD_OFFSET(p_name),
+#if CH_DBG_ENABLE_STACK_CHECK
+ THD_OFFSET(p_stklimit),
+#else
(uint8_t)0,
+#endif
+ THD_OFFSET(p_state),
+ THD_OFFSET(p_flags),
+#if CH_USE_DYNAMIC
+ THD_OFFSET(p_refs),
+#else
+ (uint8_t)0,
+#endif
+#if CH_TIME_QUANTUM > 0
+ THD_OFFSET(p_preempt),
+#else
(uint8_t)0,
- &rlist,
- &vtlist
+#endif
+ THD_OFFSET(p_time)
};
/**
|