Go to the documentation of this file.
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) &&
ch_queue_t * next
Next in the list/queue.
thread_t * chSchReadyI(thread_t *tp)
Inserts a thread in the Ready List placing it behind its peers.
System instance data structure.
msg_t chSchGoSleepTimeoutS(tstate_t newstate, sysinterval_t timeout)
Puts the current thread to sleep into the specified state with timeout specification.
void chSchPreemption(void)
All-in-one preemption code.
void chSchDoYieldS(void)
Yields the time slot.
Structure representing a thread.
void chSchGoSleepS(tstate_t newstate)
Puts the current thread to sleep into the specified state.
Structure representing a generic bidirectional linked list header and element.
void chSchRescheduleS(void)
Performs a reschedule if a higher priority thread is runnable.
void ch_sch_prio_insert(ch_queue_t *qp, ch_queue_t *tp)
Inserts a thread into a priority ordered queue.
thread_t * chSchSelectFirstI(void)
Makes runnable the fist thread in the ready list, does not reschedule internally.
void chSchDoPreemption(void)
Switches to the first thread on the runnable queue.
bool chSchIsPreemptionRequired(void)
Evaluates if preemption is required.
uint64_t sysinterval_t
Type of time interval.
Type of an system instance configuration.
void chSchWakeupS(thread_t *ntp, msg_t msg)
Wakes up a thread.