ChibiOS 21.11.4
|
Data Structures | |
struct | ch_list |
Structure representing a generic single link list header and element. More... | |
struct | ch_queue |
Structure representing a generic bidirectional linked list header and element. More... | |
struct | ch_priority_queue |
Structure representing a generic priority-ordered bidirectional linked list header and element. More... | |
struct | ch_delta_list |
Delta list element and header structure. More... |
Macros | |
#define | __CH_QUEUE_DATA(name) |
Data part of a static queue object initializer. | |
#define | CH_QUEUE_DECL(name) |
Static queue object initializer. |
Typedefs | |
typedef struct ch_list | ch_list_t |
Type of a generic single link list header and element. | |
typedef struct ch_queue | ch_queue_t |
Type of a generic bidirectional linked list header and element. | |
typedef struct ch_priority_queue | ch_priority_queue_t |
Type of a generic priority-ordered bidirectional linked list header and element. | |
typedef struct ch_delta_list | ch_delta_list_t |
Type of a generic bidirectional linked delta list header and element. |
Functions | |
static void | ch_list_init (ch_list_t *lp) |
List initialization. | |
static bool | ch_list_isempty (ch_list_t *lp) |
Evaluates to true if the specified list is empty. | |
static bool | ch_list_notempty (ch_list_t *lp) |
Evaluates to true if the specified list is not empty. | |
static void | ch_list_link (ch_list_t *lp, ch_list_t *p) |
Pushes an element on top of a stack list. | |
static ch_list_t * | ch_list_unlink (ch_list_t *lp) |
Pops an element from the top of a stack list and returns it. | |
static void | ch_queue_init (ch_queue_t *qp) |
Queue initialization. | |
static bool | ch_queue_isempty (const ch_queue_t *qp) |
Evaluates to true if the specified queue is empty. | |
static bool | ch_queue_notempty (const ch_queue_t *qp) |
Evaluates to true if the specified queue is not empty. | |
static void | ch_queue_insert (ch_queue_t *qp, ch_queue_t *p) |
Inserts an element into a queue. | |
static ch_queue_t * | ch_queue_fifo_remove (ch_queue_t *qp) |
Removes the first-out element from a queue and returns it. | |
static ch_queue_t * | ch_queue_lifo_remove (ch_queue_t *qp) |
Removes the last-out element from a queue and returns it. | |
static ch_queue_t * | ch_queue_dequeue (ch_queue_t *p) |
Removes an element from a queue and returns it. | |
static void | ch_pqueue_init (ch_priority_queue_t *pqp) |
Priority queue initialization. | |
static ch_priority_queue_t * | ch_pqueue_remove_highest (ch_priority_queue_t *pqp) |
Removes the highest priority element from a priority queue and returns it. | |
static ch_priority_queue_t * | ch_pqueue_insert_behind (ch_priority_queue_t *pqp, ch_priority_queue_t *p) |
Inserts an element in the priority queue placing it behind its peers. | |
static ch_priority_queue_t * | ch_pqueue_insert_ahead (ch_priority_queue_t *pqp, ch_priority_queue_t *p) |
Inserts an element in the priority queue placing it ahead of its peers. | |
static void | ch_dlist_init (ch_delta_list_t *dlhp) |
Delta list initialization. | |
static bool | ch_dlist_isempty (ch_delta_list_t *dlhp) |
Evaluates to true if the specified delta list is empty. | |
static bool | ch_dlist_notempty (ch_delta_list_t *dlhp) |
Evaluates to true if the specified queue is not empty. | |
static bool | ch_dlist_islast (ch_delta_list_t *dlhp, ch_delta_list_t *dlp) |
Last element in the delta list check. | |
static bool | ch_dlist_isfirst (ch_delta_list_t *dlhp, ch_delta_list_t *dlp) |
Fist element in the delta list check. | |
static void | ch_dlist_insert_after (ch_delta_list_t *dlhp, ch_delta_list_t *dlp, sysinterval_t delta) |
Inserts an element after another header element. | |
static void | ch_dlist_insert_before (ch_delta_list_t *dlhp, ch_delta_list_t *dlp, sysinterval_t delta) |
Inserts an element before another header element. | |
static void | ch_dlist_insert (ch_delta_list_t *dlhp, ch_delta_list_t *dlep, sysinterval_t delta) |
Inserts an element in a delta list. | |
static ch_delta_list_t * | ch_dlist_remove_first (ch_delta_list_t *dlhp) |
Dequeues an element from the delta list. | |
static ch_delta_list_t * | ch_dlist_dequeue (ch_delta_list_t *dlp) |
Dequeues an element from the delta list. |
#define __CH_QUEUE_DATA | ( | name | ) |
Data part of a static queue object initializer.
This macro should be used when statically initializing a queue that is part of a bigger structure.
[in] | name | the name of the queue variable |
#define CH_QUEUE_DECL | ( | name | ) |
Static queue object initializer.
Statically initialized queues require no explicit initialization using queue_init()
.
[in] | name | the name of the queue variable |
typedef struct ch_queue ch_queue_t |
typedef struct ch_priority_queue ch_priority_queue_t |
typedef struct ch_delta_list ch_delta_list_t |
|
inlinestatic |
List initialization.
[out] | lp | pointer to the list header |
Definition at line 153 of file chlists.h.
References ch_list::next.
Referenced by __thd_object_init().
|
inlinestatic |
Evaluates to true
if the specified list is empty.
[in] | lp | pointer to the list header |
Definition at line 166 of file chlists.h.
References ch_list::next.
|
inlinestatic |
Evaluates to true
if the specified list is not empty.
[in] | lp | pointer to the list header |
Definition at line 179 of file chlists.h.
References ch_list::next.
Referenced by chThdExitS().
Pushes an element on top of a stack list.
[in] | lp | the pointer to the list header |
[in] | p | the pointer to the element to be inserted in the list |
Definition at line 192 of file chlists.h.
References ch_list::next.
Referenced by chThdWait().
Pops an element from the top of a stack list and returns it.
[in] | lp | the pointer to the list header |
Definition at line 207 of file chlists.h.
References ch_list::next.
Referenced by chThdExitS().
|
inlinestatic |
Queue initialization.
[out] | qp | pointer to the queue header |
Definition at line 222 of file chlists.h.
References ch_queue::next, and ch_queue::prev.
Referenced by __reg_object_init(), __thd_object_init(), chCondObjectInit(), chMtxObjectInit(), chSemObjectInit(), and chThdQueueObjectInit().
|
inlinestatic |
Evaluates to true
if the specified queue is empty.
[in] | qp | pointer to the queue header |
Definition at line 236 of file chlists.h.
References ch_queue::next.
Referenced by chSemAddCounterI(), chSemResetWithMessageI(), chSemSignal(), chSemSignalI(), chSemSignalWait(), chSemWaitS(), chSemWaitTimeoutS(), and chThdQueueIsEmptyI().
|
inlinestatic |
Evaluates to true
if the specified queue is not empty.
[in] | qp | pointer to the queue header |
Definition at line 249 of file chlists.h.
References ch_queue::next.
Referenced by chCondBroadcastI(), chCondSignal(), chCondSignalI(), chMtxQueueNotEmptyS(), chSemAddCounterI(), chSemResetWithMessageI(), chSemSignal(), chSemSignalI(), chSemSignalWait(), chSemWaitS(), chSemWaitTimeoutS(), chThdDequeueAllI(), chThdDequeueNextI(), and chThdDoDequeueNextI().
|
inlinestatic |
Inserts an element into a queue.
[in] | qp | the pointer to the queue header |
[in] | p | the pointer to the element to be inserted in the queue |
Definition at line 262 of file chlists.h.
References ch_queue::next, and ch_queue::prev.
Referenced by chThdEnqueueTimeoutS().
|
inlinestatic |
Removes the first-out element from a queue and returns it.
[in] | qp | the pointer to the queue list header |
Definition at line 280 of file chlists.h.
References ch_queue::next, and ch_queue::prev.
Referenced by chCondBroadcastI(), chCondSignal(), chCondSignalI(), chMsgPollS(), chMsgWaitS(), chMsgWaitTimeoutS(), chMtxUnlock(), chMtxUnlockAllS(), chMtxUnlockS(), chSemAddCounterI(), chSemSignal(), chSemSignalI(), chSemSignalWait(), and chThdDoDequeueNextI().
|
inlinestatic |
Removes the last-out element from a queue and returns it.
[in] | qp | the pointer to the queue list header |
Definition at line 299 of file chlists.h.
References ch_queue::next, and ch_queue::prev.
Referenced by chSemResetWithMessageI().
|
inlinestatic |
Removes an element from a queue and returns it.
The element is removed from the queue regardless of its relative position and regardless the used insertion method.
[in] | p | the pointer to the element to be removed from the queue |
Definition at line 318 of file chlists.h.
References ch_queue::next, and ch_queue::prev.
Referenced by __sch_wakeup(), and chMtxLockS().
|
inlinestatic |
Priority queue initialization.
[out] | pqp | pointer to the priority queue header |
Definition at line 336 of file chlists.h.
References ch_priority_queue::next, ch_priority_queue::prev, and ch_priority_queue::prio.
Referenced by chInstanceObjectInit().
|
inlinestatic |
Removes the highest priority element from a priority queue and returns it.
[in] | pqp | the pointer to the priority queue list header |
Definition at line 352 of file chlists.h.
References ch_priority_queue::next, and ch_priority_queue::prev.
Referenced by __sch_reschedule_ahead(), __sch_reschedule_behind(), chSchDoPreemption(), chSchGoSleepS(), and chSchSelectFirst().
|
inlinestatic |
Inserts an element in the priority queue placing it behind its peers.
The element is positioned behind all elements with higher or equal priority.
[in] | pqp | the pointer to the priority queue list header |
[in] | p | the pointer to the element to be inserted in the queue |
Definition at line 373 of file chlists.h.
References ch_priority_queue::next, ch_priority_queue::prev, ch_priority_queue::prio, and unlikely.
Referenced by __sch_ready_behind().
|
inlinestatic |
Inserts an element in the priority queue placing it ahead of its peers.
The element is positioned ahead of all elements with higher or equal priority.
[in] | pqp | the pointer to the priority queue list header |
[in] | p | the pointer to the element to be inserted in the queue |
Definition at line 402 of file chlists.h.
References ch_priority_queue::next, ch_priority_queue::prev, ch_priority_queue::prio, and unlikely.
Referenced by __sch_ready_ahead().
|
inlinestatic |
Delta list initialization.
[out] | dlhp | pointer to the delta list header |
Definition at line 426 of file chlists.h.
References ch_delta_list::delta, ch_delta_list::next, and ch_delta_list::prev.
Referenced by __vt_object_init().
|
inlinestatic |
Evaluates to true
if the specified delta list is empty.
[in] | dlhp | pointer to the delta list header |
Definition at line 441 of file chlists.h.
References ch_delta_list::next.
Referenced by chVTDoResetI(), chVTDoTickI(), and vt_enqueue().
|
inlinestatic |
Evaluates to true
if the specified queue is not empty.
[in] | dlhp | pointer to the delta list header |
Definition at line 454 of file chlists.h.
References ch_delta_list::next.
Referenced by chVTDoTickI().
|
inlinestatic |
Last element in the delta list check.
[in] | dlhp | pointer to the delta list header |
[in] | dlp | pointer to the delta list element |
Definition at line 467 of file chlists.h.
References ch_delta_list::next.
|
inlinestatic |
Fist element in the delta list check.
[in] | dlhp | pointer to the delta list header |
[in] | dlp | pointer to the delta list element |
Definition at line 481 of file chlists.h.
References ch_delta_list::next.
Referenced by chVTDoResetI().
|
inlinestatic |
Inserts an element after another header element.
[in] | dlhp | pointer to the delta list header element |
[in] | dlp | element to be inserted after the header element |
[in] | delta | delta of the element to be inserted |
Definition at line 496 of file chlists.h.
References ch_delta_list::delta, ch_delta_list::next, and ch_delta_list::prev.
Referenced by vt_insert_first().
|
inlinestatic |
Inserts an element before another header element.
[in] | dlhp | pointer to the delta list header element |
[in] | dlp | element to be inserted before the header element |
[in] | delta | delta of the element to be inserted |
Definition at line 516 of file chlists.h.
References ch_delta_list::delta, ch_delta_list::next, and ch_delta_list::prev.
Referenced by ch_dlist_insert().
|
inlinestatic |
Inserts an element in a delta list.
[in] | dlhp | pointer to the delta list header element |
[in] | dlep | element to be inserted before the header element |
[in] | delta | delta of the element to be inserted |
Definition at line 536 of file chlists.h.
References ch_dlist_insert_before(), chDbgAssert, ch_delta_list::delta, likely, and ch_delta_list::next.
Referenced by chVTDoTickI(), and vt_enqueue().
|
inlinestatic |
Dequeues an element from the delta list.
[in] | dlhp | pointer to the delta list header |
Definition at line 571 of file chlists.h.
References ch_delta_list::next, and ch_delta_list::prev.
Referenced by chVTDoResetI().
|
inlinestatic |
Dequeues an element from the delta list.
[in] | dlp | pointer to the delta list element |
Definition at line 587 of file chlists.h.
References ch_delta_list::next, and ch_delta_list::prev.
Referenced by chVTDoResetI(), and chVTDoTickI().