diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-02-02 20:20:12 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-02-02 20:20:12 +0000 |
commit | e515bcf581c92643c21eb6ed53ba0d0b1604fe4b (patch) | |
tree | efae1098d4db1532fcf51f1387add77747ffc061 /os/kernel/include | |
parent | ce91c3f44a3f0b9cacd07972a052c7360fb24053 (diff) | |
download | ChibiOS-e515bcf581c92643c21eb6ed53ba0d0b1604fe4b.tar.gz ChibiOS-e515bcf581c92643c21eb6ed53ba0d0b1604fe4b.tar.bz2 ChibiOS-e515bcf581c92643c21eb6ed53ba0d0b1604fe4b.zip |
Implemented registry subsystem (still in progress).
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1558 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/include')
-rw-r--r-- | os/kernel/include/ch.h | 1 | ||||
-rw-r--r-- | os/kernel/include/scheduler.h | 16 | ||||
-rw-r--r-- | os/kernel/include/threads.h | 18 |
3 files changed, 27 insertions, 8 deletions
diff --git a/os/kernel/include/ch.h b/os/kernel/include/ch.h index 683c69cc6..109040262 100644 --- a/os/kernel/include/ch.h +++ b/os/kernel/include/ch.h @@ -79,6 +79,7 @@ #include "heap.h"
#include "mempools.h"
#include "threads.h"
+#include "registry.h"
#include "inline.h"
#include "queues.h"
#include "streams.h"
diff --git a/os/kernel/include/scheduler.h b/os/kernel/include/scheduler.h index 539c678fa..9d8af9ecc 100644 --- a/os/kernel/include/scheduler.h +++ b/os/kernel/include/scheduler.h @@ -64,19 +64,27 @@ * @extends ThreadsQueue */ typedef struct { - ThreadsQueue r_queue; /**< Threads queue.*/ + ThreadsQueue r_queue; /**< Threads queue. */ tprio_t r_prio; /**< This field must be initialized to - zero.*/ + zero. */ + struct context p_ctx; /**< Not used, present because + offsets. */ +#if CH_USE_REGISTRY + Thread *p_newer; /**< Newer registry element. */ + Thread *p_older; /**< Older registry element. */ +#endif /* End of the fields shared with the Thread structure.*/ #if CH_TIME_QUANTUM > 0 - cnt_t r_preempt; /**< Round robin counter.*/ + cnt_t r_preempt; /**< Round robin counter. */ #endif #ifndef CH_CURRP_REGISTER_CACHE - Thread *r_current; /**< The currently running thread.*/ + Thread *r_current; /**< The currently running thread. */ #endif } ReadyList; +#if !defined(__DOXYGEN__) extern ReadyList rlist; +#endif #ifdef CH_CURRP_REGISTER_CACHE register Thread *currp asm(CH_CURRP_REGISTER_CACHE); diff --git a/os/kernel/include/threads.h b/os/kernel/include/threads.h index a9209e6ea..24b79a3cd 100644 --- a/os/kernel/include/threads.h +++ b/os/kernel/include/threads.h @@ -53,13 +53,17 @@ struct Thread { queue. */ /* End of the fields shared with the ThreadsQueue structure. */ tprio_t p_prio; /**< Thread priority. */ + struct context p_ctx; /**< Processor context. */ +#if CH_USE_REGISTRY + Thread *p_newer; /**< Newer registry element. */ + Thread *p_older; /**< Older registry element. */ +#endif /* End of the fields shared with the ReadyList structure. */ #if CH_USE_DYNAMIC trefs_t p_refs; /**< References to this thread. */ #endif tstate_t p_state; /**< Current thread state. */ tmode_t p_flags; /**< Various thread flags. */ - struct context p_ctx; /**< Processor context. */ #if CH_USE_NESTED_LOCKS cnt_t p_locks; /**< Number of nested locks. */ #endif @@ -181,13 +185,19 @@ extern "C" { } #endif -/** Returns the pointer to the @p Thread currently in execution.*/ +/** + * Returns a pointer to the current @p Thread. + */ #define chThdSelf() currp -/** Returns the current thread priority.*/ +/** + * Returns the current thread priority. + */ #define chThdGetPriority() (currp->p_prio) -/** Returns the pointer to the @p Thread local storage area, if any.*/ +/** + * Returns the pointer to the @p Thread local storage area, if any. + */ #define chThdLS() (void *)(currp + 1) /** |