69 #if CH_CFG_USE_REGISTRY == TRUE 75 #if (CH_CFG_OPTIMIZE_SPEED == FALSE) || defined(__DOXYGEN__) 231 }
while (cp->prio >= tp->prio);
270 }
while (cp->prio > tp->prio);
295 otp->
state = newstate;
297 #if CH_CFG_TIME_QUANTUM > 0 319 static void wakeup(
void *p) {
332 #if CH_CFG_USE_SEMAPHORES == TRUE 339 #if (CH_CFG_USE_CONDVARS == TRUE) && (CH_CFG_USE_CONDVARS_TIMEOUT == TRUE) 392 return currp->u.rdymsg;
418 (ch.
rlist.current->prio >= ch.
rlist.queue.next->prio),
419 "priority order violation");
465 #if !defined(CH_SCH_IS_PREEMPTION_REQUIRED_HOOKED) 481 tprio_t p2 =
currp->prio;
483 #if CH_CFG_TIME_QUANTUM > 0 488 return (
currp->ticks > (tslices_t)0) ? (p1 > p2) : (p1 >= p2);
519 #if CH_CFG_TIME_QUANTUM > 0 559 #if !defined(CH_SCH_DO_RESCHEDULE_HOOKED) 582 #if CH_CFG_TIME_QUANTUM > 0 585 if (
currp->ticks == (tslices_t)0) {
void _scheduler_init(void)
Scheduler initialization.
uint64_t sysinterval_t
Type of time interval.
tprio_t prio
Thread priority.
#define NOPRIO
Ready list header priority.
void chSchDoRescheduleBehind(void)
Switches to the first thread on the runnable queue.
thread_t * chSchReadyI(thread_t *tp)
Inserts a thread in the Ready List placing it behind its peers.
void queue_prio_insert(thread_t *tp, threads_queue_t *tqp)
Inserts a thread into a priority ordered queue.
#define IDLEPRIO
Idle priority.
#define CH_STATE_SUSPENDED
Suspended state.
#define CH_STATE_CURRENT
Currently running.
#define firstprio(rlp)
Returns the priority of the first thread on the given ready list.
Generic threads bidirectional linked list header and element.
#define currp
Current thread pointer access macro.
msg_t rdymsg
Thread wakeup code.
#define CH_STATE_WTCOND
On a cond.variable.
#define CH_CFG_IDLE_ENTER_HOOK()
Idle thread enter hook.
thread_t * next
Next in the list/queue.
#define MSG_TIMEOUT
Wakeup caused by a timeout condition.
static void chSemFastSignalI(semaphore_t *sp)
Increases the semaphore counter.
void chSchRescheduleS(void)
Performs a reschedule if a higher priority thread is runnable.
void chVTDoSetI(virtual_timer_t *vtp, sysinterval_t delay, vtfunc_t vtfunc, void *par)
Enables a virtual timer.
thread_t * next
Next in the list/queue.
#define chDbgCheck(c)
Function parameters check.
void chVTDoResetI(virtual_timer_t *vtp)
Disables a Virtual Timer.
#define CH_STATE_FINAL
Thread terminated.
bool chSchIsPreemptionRequired(void)
Evaluates if preemption is required.
tslices_t ticks
Number of ticks remaining to this thread.
void chSchGoSleepS(tstate_t newstate)
Puts the current thread to sleep into the specified state.
static void queue_init(threads_queue_t *tqp)
Threads queue initialization.
#define TIME_INFINITE
Infinite interval specification for all functions with a timeout specification.
msg_t chSchGoSleepTimeoutS(tstate_t newstate, sysinterval_t timeout)
Puts the current thread to sleep into the specified state with timeout specification.
thread_t * list_remove(threads_list_t *tlp)
Pops a thread from the top of a stack list and returns it.
static bool chSchIsRescRequiredI(void)
Determines if the current thread must reschedule.
static bool chVTIsArmedI(const virtual_timer_t *vtp)
Returns true if the specified timer is armed.
ready_list_t rlist
Ready list header.
ch_system_t ch
System data structures.
static void chSysUnlockFromISR(void)
Leaves the kernel lock state from within an interrupt handler.
Generic threads single link list, it works like a stack.
void queue_insert(thread_t *tp, threads_queue_t *tqp)
Inserts a thread into a queue.
thread_t * prev
Previous in the queue.
thread_t * queue_lifo_remove(threads_queue_t *tqp)
Removes the last-out thread from a queue and returns it.
static void chSysLockFromISR(void)
Enters the kernel lock state from within an interrupt handler.
#define CH_STATE_READY
Waiting on the ready list.
void chSchDoRescheduleAhead(void)
Switches to the first thread on the runnable queue.
tstate_t state
Current thread state.
#define CH_STATE_WTSEM
On a semaphore.
Virtual Timer descriptor structure.
union ch_thread::@0 u
State-specific fields.
#define CH_CFG_TIME_QUANTUM
Round robin interval.
#define CH_CFG_IDLE_LEAVE_HOOK()
Idle thread leave hook.
struct ch_semaphore * wtsemp
Pointer to a generic semaphore object.
void chDbgCheckClassI(void)
I-class functions context check.
thread_t * queue_dequeue(thread_t *tp)
Removes a thread from a queue and returns it.
void chSchWakeupS(thread_t *ntp, msg_t msg)
Wakes up a thread.
#define chDbgAssert(c, r)
Condition assertion.
#define CH_STATE_QUEUED
On a queue.
void chDbgCheckClassS(void)
S-class functions context check.
thread_t * chSchReadyAheadI(thread_t *tp)
Inserts a thread in the Ready List placing it ahead its peers.
void list_insert(thread_t *tp, threads_list_t *tlp)
Pushes a thread_t on top of a stack list.
thread_reference_t * wttrp
Pointer to a generic thread reference object.
ChibiOS/RT main include file.
thread_t * queue_fifo_remove(threads_queue_t *tqp)
Removes the first-out thread from a queue and returns it.
#define chSysSwitch(ntp, otp)
Performs a context switch.
threads_queue_t queue
Threads queue header.
void chSchDoReschedule(void)
Switches to the first thread on the runnable queue.
Structure representing a thread.