aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/include
diff options
context:
space:
mode:
Diffstat (limited to 'os/kernel/include')
-rw-r--r--os/kernel/include/ch.h1
-rw-r--r--os/kernel/include/scheduler.h16
-rw-r--r--os/kernel/include/threads.h18
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)
/**