42 #if (CH_CFG_NO_IDLE_THREAD == FALSE) || defined(__DOXYGEN__) 61 #if (CH_CFG_NO_IDLE_THREAD == FALSE) || defined(__DOXYGEN__) 79 port_wait_for_interrupt();
106 #if CH_DBG_SYSTEM_STATE_CHECK == TRUE 110 #if CH_CFG_USE_TM == TRUE 113 #if CH_CFG_USE_MEMCORE == TRUE 116 #if CH_CFG_USE_HEAP == TRUE 119 #if CH_CFG_USE_FACTORY == TRUE 122 #if CH_DBG_STATISTICS == TRUE 126 #if CH_CFG_NO_IDLE_THREAD == FALSE 128 #if CH_CFG_USE_REGISTRY == TRUE 138 #if CH_DBG_ENABLE_STACK_CHECK == TRUE 142 extern stkalign_t __main_thread_stack_base__;
143 currp->wabase = &__main_thread_stack_base__;
145 #elif CH_CFG_USE_DYNAMIC == TRUE 146 currp->wabase = NULL;
156 #if CH_DBG_STATISTICS == TRUE 167 #if CH_CFG_NO_IDLE_THREAD == FALSE 246 if ((testmask & CH_INTEGRITY_RLIST) != 0U) {
271 if ((testmask & CH_INTEGRITY_VTLIST) != 0U) {
295 #if CH_CFG_USE_REGISTRY == TRUE 296 if ((testmask & CH_INTEGRITY_REGISTRY) != 0U) {
321 #if defined(PORT_INTEGRITY_CHECK) 322 if ((testmask & CH_INTEGRITY_PORT) != 0U) {
323 PORT_INTEGRITY_CHECK();
345 #if CH_CFG_TIME_QUANTUM > 0 347 if (
currp->ticks > (tslices_t)0) {
352 #if CH_DBG_THREADS_PROFILING == TRUE 374 syssts_t sts = port_get_irq_status();
375 if (port_irq_enabled(sts)) {
376 if (port_is_isr_context()) {
397 if (port_irq_enabled(sts)) {
398 if (port_is_isr_context()) {
408 #if (PORT_SUPPORTS_RT == TRUE) || defined(__DOXYGEN__) 429 return (
bool)((cnt - start) < (end - start));
445 rtcnt_t end = start + cycles;
void _scheduler_init(void)
Scheduler initialization.
#define chSysGetRealtimeCounterX()
Returns the current value of the system real time counter.
cnt_t lock_cnt
Lock nesting level.
#define CH_CFG_SYSTEM_TICK_HOOK()
System tick event hook.
static void chSysLock(void)
Enters the kernel lock state.
#define CH_CFG_SYSTEM_INIT_HOOK()
System initialization hook.
system_debug_t dbg
System debug.
void chSysPolledDelayX(rtcnt_t cycles)
Polled delay.
Type of a thread descriptor.
#define IDLEPRIO
Idle priority.
static void _idle_thread(void *p)
This function implements the idle thread infinite loop.
#define NORMALPRIO
Normal priority.
virtual_timer_t * prev
Previous timer in the list.
void _core_init(void)
Low level memory manager initialization.
#define CH_STATE_CURRENT
Currently running.
#define currp
Current thread pointer access macro.
void _tm_init(void)
Initializes the time measurement unit.
static void chSysUnlock(void)
Leaves the kernel lock state.
thread_t mainthread
Main thread descriptor.
void chSysHalt(const char *reason)
Halts the system.
virtual_timers_list_t vtlist
Virtual timers delta list header.
#define THD_WORKING_AREA_END(s)
End of a working area casted to the correct type.
#define THD_WORKING_AREA_BASE(s)
Base of a working area casted to the correct type.
void _trace_halt(const char *reason)
Inserts in the circular debug trace buffer an halt record.
void chSchRescheduleS(void)
Performs a reschedule if a higher priority thread is runnable.
void chSysTimerHandlerI(void)
Handles time ticks for round robin preemption and timer increments.
thread_t * next
Next in the list/queue.
bool chSysIntegrityCheckI(unsigned testmask)
System integrity check.
void _trace_init(void)
Trace circular buffer subsystem initialization.
void _vt_init(void)
Virtual Timers initialization.
THD_WORKING_AREA(ch_idle_thread_wa, PORT_IDLE_THREAD_STACK_SIZE)
Idle thread working area.
ready_list_t rlist
Ready list header.
void chSysInit(void)
ChibiOS/RT initialization.
ch_system_t ch
System data structures.
static void chSysUnlockFromISR(void)
Leaves the kernel lock state from within an interrupt handler.
NOINLINE void chTMStartMeasurementX(time_measurement_t *tmp)
Starts a measurement.
thread_t * prev
Previous in the queue.
void _stats_init(void)
Initializes the statistics module.
syssts_t chSysGetStatusAndLockX(void)
Returns the execution status and enters a critical zone.
static void chSysLockFromISR(void)
Enters the kernel lock state from within an interrupt handler.
void chSysRestoreStatusX(syssts_t sts)
Restores the specified execution status and leaves a critical zone.
Virtual Timer descriptor structure.
bool chSysIsCounterWithinX(rtcnt_t cnt, rtcnt_t start, rtcnt_t end)
Realtime window test.
thread_t * older
Older registry element.
cnt_t isr_cnt
ISR nesting level.
virtual_timer_t * next
Next timer in the delta list.
static void chSysEnable(void)
Lowers the system interrupt priority mask to user level.
thread_t * _thread_init(thread_t *tp, const char *name, tprio_t prio)
Initializes a thread structure.
virtual_timer_t * next
Next timer in the list.
void chDbgCheckClassI(void)
I-class functions context check.
thread_t * chThdCreate(const thread_descriptor_t *tdp)
Creates a new thread into a static memory area.
static void chVTDoTickI(void)
Virtual timers ticker.
const char *volatile panic_msg
Pointer to the panic message.
#define CH_CFG_IDLE_LOOP_HOOK()
Idle Loop hook.
virtual_timer_t * prev
Last timer in the delta list.
#define CH_CFG_SYSTEM_HALT_HOOK(reason)
System halt hook.
void _factory_init(void)
Initializes the objects factory.
ChibiOS/RT main include file.
void _heap_init(void)
Initializes the default heap.
threads_queue_t queue
Threads queue header.
thread_t * newer
Newer registry element.
Structure representing a thread.