aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/include
diff options
context:
space:
mode:
Diffstat (limited to 'os/rt/include')
-rw-r--r--os/rt/include/chschd.h41
-rw-r--r--os/rt/include/chtrace.h6
2 files changed, 22 insertions, 25 deletions
diff --git a/os/rt/include/chschd.h b/os/rt/include/chschd.h
index a00b2fa5a..79ff437a1 100644
--- a/os/rt/include/chschd.h
+++ b/os/rt/include/chschd.h
@@ -152,10 +152,7 @@ struct ch_threads_queue {
* by shrinking this structure.
*/
struct ch_thread {
- thread_t *next; /**< @brief Next in the list/queue. */
- /* End of the fields shared with the threads_list_t structure.*/
- thread_t *prev; /**< @brief Previous in the queue. */
- /* End of the fields shared with the threads_queue_t structure.*/
+ threads_queue_t queue; /**< @brief Threads queue header. */
tprio_t prio; /**< @brief Thread priority. */
struct port_context ctx; /**< @brief Processor context. */
#if (CH_CFG_USE_REGISTRY == TRUE) || defined(__DOXYGEN__)
@@ -399,7 +396,7 @@ struct ch_system_debug {
*/
cnt_t lock_cnt;
#endif
-#if (CH_DBG_TRACE_MASK != CH_DBG_TRACE_MASK_NONE) || defined(__DOXYGEN__)
+#if (CH_DBG_TRACE_MASK != CH_DBG_TRACE_MASK_DISABLED) || defined(__DOXYGEN__)
/**
* @brief Public trace buffer.
*/
@@ -585,14 +582,14 @@ static inline bool queue_notempty(const threads_queue_t *tqp) {
#if CH_CFG_OPTIMIZE_SPEED == TRUE
static inline void list_insert(thread_t *tp, threads_list_t *tlp) {
- tp->next = tlp->next;
+ tp->queue.next = tlp->next;
tlp->next = tp;
}
static inline thread_t *list_remove(threads_list_t *tlp) {
thread_t *tp = tlp->next;
- tlp->next = tp->next;
+ tlp->next = tp->queue.next;
return tp;
}
@@ -601,27 +598,27 @@ static inline void queue_prio_insert(thread_t *tp, threads_queue_t *tqp) {
thread_t *cp = (thread_t *)tqp;
do {
- cp = cp->next;
+ cp = cp->queue.next;
} while ((cp != (thread_t *)tqp) && (cp->prio >= tp->prio));
- tp->next = cp;
- tp->prev = cp->prev;
- tp->prev->next = tp;
- cp->prev = tp;
+ tp->queue.next = cp;
+ tp->queue.prev = cp->queue.prev;
+ tp->queue.prev->queue.next = tp;
+ cp->queue.prev = tp;
}
static inline void queue_insert(thread_t *tp, threads_queue_t *tqp) {
- tp->next = (thread_t *)tqp;
- tp->prev = tqp->prev;
- tp->prev->next = tp;
- tqp->prev = tp;
+ tp->queue.next = (thread_t *)tqp;
+ tp->queue.prev = tqp->prev;
+ tp->queue.prev->queue.next = tp;
+ tqp->prev = tp;
}
static inline thread_t *queue_fifo_remove(threads_queue_t *tqp) {
thread_t *tp = tqp->next;
- tqp->next = tp->next;
- tqp->next->prev = (thread_t *)tqp;
+ tqp->next = tp->queue.next;
+ tqp->next->queue.prev = (thread_t *)tqp;
return tp;
}
@@ -629,16 +626,16 @@ static inline thread_t *queue_fifo_remove(threads_queue_t *tqp) {
static inline thread_t *queue_lifo_remove(threads_queue_t *tqp) {
thread_t *tp = tqp->prev;
- tqp->prev = tp->prev;
- tqp->prev->next = (thread_t *)tqp;
+ tqp->prev = tp->queue.prev;
+ tqp->prev->queue.next = (thread_t *)tqp;
return tp;
}
static inline thread_t *queue_dequeue(thread_t *tp) {
- tp->prev->next = tp->next;
- tp->next->prev = tp->prev;
+ tp->queue.prev->queue.next = tp->queue.next;
+ tp->queue.next->queue.prev = tp->queue.prev;
return tp;
}
diff --git a/os/rt/include/chtrace.h b/os/rt/include/chtrace.h
index 2b1afcb4c..43d8a6eac 100644
--- a/os/rt/include/chtrace.h
+++ b/os/rt/include/chtrace.h
@@ -78,7 +78,7 @@
/**
* @brief Trace buffer entries.
* @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
- * different from @p CH_DBG_TRACE_MASK_NONE.
+ * different from @p CH_DBG_TRACE_MASK_DISABLED.
*/
#if !defined(CH_DBG_TRACE_BUFFER_SIZE) || defined(__DOXYGEN__)
#define CH_DBG_TRACE_BUFFER_SIZE 128
@@ -97,7 +97,7 @@
/* Module data structures and types. */
/*===========================================================================*/
-#if (CH_DBG_TRACE_MASK != CH_DBG_TRACE_MASK_NONE) || defined(__DOXYGEN__)
+#if (CH_DBG_TRACE_MASK != CH_DBG_TRACE_MASK_DISABLED) || defined(__DOXYGEN__)
/*lint -save -e46 [6.1] An uint32_t is required.*/
/**
* @brief Trace buffer record.
@@ -191,7 +191,7 @@ typedef struct {
*/
ch_trace_event_t buffer[CH_DBG_TRACE_BUFFER_SIZE];
} ch_trace_buffer_t;
-#endif /* CH_DBG_TRACE_MASK != CH_DBG_TRACE_MASK_NONE */
+#endif /* CH_DBG_TRACE_MASK != CH_DBG_TRACE_MASK_DISABLED */
/*===========================================================================*/
/* Module macros. */