39#define MSG_OK (msg_t)0
40#define MSG_TIMEOUT (msg_t)-1
42#define MSG_RESET (msg_t)-2
50#define NOPRIO (tprio_t)0
52#define IDLEPRIO (tprio_t)1
53#define LOWPRIO (tprio_t)2
54#define NORMALPRIO (tprio_t)128
55#define HIGHPRIO (tprio_t)255
62#define CH_STATE_READY (tstate_t)0
64#define CH_STATE_CURRENT (tstate_t)1
65#define CH_STATE_WTSTART (tstate_t)2
66#define CH_STATE_SUSPENDED (tstate_t)3
67#define CH_STATE_QUEUED (tstate_t)4
68#define CH_STATE_WTSEM (tstate_t)5
69#define CH_STATE_WTMTX (tstate_t)6
70#define CH_STATE_WTCOND (tstate_t)7
71#define CH_STATE_SLEEPING (tstate_t)8
72#define CH_STATE_WTEXIT (tstate_t)9
73#define CH_STATE_WTOREVT (tstate_t)10
74#define CH_STATE_WTANDEVT (tstate_t)11
75#define CH_STATE_SNDMSGQ (tstate_t)12
77#define CH_STATE_SNDMSG (tstate_t)13
79#define CH_STATE_WTMSG (tstate_t)14
81#define CH_STATE_FINAL (tstate_t)15
88#define CH_STATE_NAMES \
89 "READY", "CURRENT", "WTSTART", "SUSPENDED", "QUEUED", "WTSEM", "WTMTX", \
90 "WTCOND", "SLEEPING", "WTEXIT", "WTOREVT", "WTANDEVT", "SNDMSGQ", \
91 "SNDMSG", "WTMSG", "FINAL"
98#define CH_FLAG_MODE_MASK (tmode_t)3U
100#define CH_FLAG_MODE_STATIC (tmode_t)0U
101#define CH_FLAG_MODE_HEAP (tmode_t)1U
103#define CH_FLAG_MODE_MPOOL (tmode_t)2U
105#define CH_FLAG_TERMINATE (tmode_t)4U
130#define firstprio(rlp) ((rlp)->next->prio)
137#define __sch_get_currthread() __instance_get_currthread(currcore)
161#if CH_CFG_OPTIMIZE_SPEED == FALSE
174#if CH_CFG_OPTIMIZE_SPEED == TRUE
180 }
while ((cp != qp) &&
#define chSchWakeupS(ntp, msg)
Wakes up a thread.
#define chSchGoSleepS(newstate)
Puts the current thread to sleep into the specified state.
struct ch_queue ch_queue_t
Type of a generic bidirectional linked list header and element.
#define threadref(p)
Safe cast of a queue pointer to a thread pointer.
struct ch_os_instance os_instance_t
Type of an OS instance structure.
struct ch_os_instance_config os_instance_config_t
Type of an system instance configuration.
struct ch_thread thread_t
Type of a thread structure.
thread_t * chSchSelectFirst(void)
Makes runnable the fist thread in the ready list, does not reschedule internally.
void chSchRescheduleS(void)
Performs a reschedule if a higher priority thread is runnable.
thread_t * chSchReadyI(thread_t *tp)
Inserts a thread in the Ready List placing it behind its peers.
void chSchObjectInit(os_instance_t *oip, const os_instance_config_t *oicp)
void chSchDoYieldS(void)
Yields the time slot.
void chSchPreemption(void)
All-in-one preemption code.
bool chSchIsPreemptionRequired(void)
Evaluates if preemption is required.
void ch_sch_prio_insert(ch_queue_t *qp, ch_queue_t *tp)
Inserts a thread into a priority ordered queue.
void chSchDoPreemption(void)
Switches to the first thread on the runnable queue.
msg_t chSchGoSleepTimeoutS(tstate_t newstate, sysinterval_t timeout)
Puts the current thread to sleep into the specified state with timeout specification.
uint64_t sysinterval_t
Type of time interval.
ch_queue_t * prev
Previous in the queue.
ch_queue_t * next
Next in the list/queue.