Go to the documentation of this file.
52 #if (CH_CFG_NO_IDLE_THREAD == FALSE) || defined(__DOXYGEN__)
59 #if CH_DBG_ENABLE_STACK_CHECK == TRUE
60 extern stkalign_t __main_thread_stack_base__, __main_thread_stack_end__;
68 #if CH_DBG_ENABLE_STACK_CHECK == TRUE
69 .mainthread_base = &__main_thread_stack_base__,
70 .mainthread_end = &__main_thread_stack_end__,
71 #elif CH_CFG_USE_DYNAMIC == TRUE
72 .mainthread_base = NULL,
73 .mainthread_end = NULL,
75 #if CH_CFG_NO_IDLE_THREAD == FALSE
82 #if (PORT_CORES_NUMBER > 1) || defined(__DOXYGEN__)
88 #if (CH_CFG_NO_IDLE_THREAD == FALSE) || defined(__DOXYGEN__)
96 #if CH_DBG_ENABLE_STACK_CHECK == TRUE
97 extern stkalign_t __c1_main_thread_stack_base__, __c1_main_thread_stack_end__;
105 #if CH_DBG_ENABLE_STACK_CHECK == TRUE
106 .mainthread_base = &__c1_main_thread_stack_base__,
107 .mainthread_end = &__c1_main_thread_stack_end__,
108 #elif CH_CFG_USE_DYNAMIC == TRUE
109 .mainthread_base = NULL,
110 .mainthread_end = NULL,
112 #if CH_CFG_NO_IDLE_THREAD == FALSE
164 for (i = 0U; i < (unsigned)PORT_CORES_NUMBER; i++) {
168 #if CH_CFG_USE_TM == TRUE
173 #if (CH_CFG_USE_REGISTRY == TRUE) && (CH_CFG_SMP_MODE == TRUE)
178 #if CH_CFG_SMP_MODE == TRUE
222 #if defined(PORT_SYSTEM_HALT_HOOK)
225 PORT_SYSTEM_HALT_HOOK();
267 if ((testmask & CH_INTEGRITY_RLIST) != 0U) {
292 if ((testmask & CH_INTEGRITY_VTLIST) != 0U) {
316 #if CH_CFG_USE_REGISTRY == TRUE
317 if ((testmask & CH_INTEGRITY_REGISTRY) != 0U) {
346 #if defined(PORT_INTEGRITY_CHECK)
347 if ((testmask & CH_INTEGRITY_PORT) != 0U) {
348 PORT_INTEGRITY_CHECK();
367 #if (CH_CFG_TIME_QUANTUM > 0) || (CH_DBG_THREADS_PROFILING == TRUE)
373 #if CH_CFG_TIME_QUANTUM > 0
380 #if CH_DBG_THREADS_PROFILING == TRUE
436 #if (PORT_SUPPORTS_RT == TRUE) || defined(__DOXYGEN__)
void chVTDoTickI(void)
Virtual timers ticker.
void chSysRestoreStatusX(syssts_t sts)
Restores the specified execution status and leaves a critical zone.
void chSysHalt(const char *reason)
Halts the system.
bool chSysIsCounterWithinX(rtcnt_t cnt, rtcnt_t start, rtcnt_t end)
Realtime window test.
ch_queue_t * next
Next in the list/queue.
static bool port_irq_enabled(syssts_t sts)
Checks the interrupt status.
const char * name
Instance name.
rfcu_t rfcu
Runtime Faults Collection Unit.
port_stkalign_t stkalign_t
virtual_timers_list_t vtlist
Virtual timers delta list header.
#define currcore
Access to current core's instance structure.
#define CH_CFG_SYSTEM_HALT_HOOK(reason)
System halt hook.
#define chSysUnlockFromISR()
Leaves the kernel lock state from within an interrupt handler.
system_state_t
Global state of the operating system.
void __trace_halt(const char *reason)
Inserts in the circular debug trace buffer an halt record.
#define chSysLockFromISR()
Enters the kernel lock state from within an interrupt handler.
System instance data structure.
void chInstanceObjectInit(os_instance_t *oip, const os_instance_config_t *oicp)
Initializes a system instance.
void chSysTimerHandlerI(void)
Handles time ticks for round robin preemption and timer increments.
bool chSysIntegrityCheckI(unsigned testmask)
System integrity check.
void chSysWaitSystemState(system_state_t state)
Waits for the system state to be equal to the specified one.
static bool port_is_isr_context(void)
Determines the current execution context.
#define CH_CFG_SYSTEM_TICK_HOOK()
System tick event hook.
#define CH_CFG_SYSTEM_INIT_HOOK()
System initialization hook.
#define chSysGetRealtimeCounterX()
Returns the current value of the system real time counter.
tm_calibration_t tmc
Time measurement calibration data.
#define PORT_IDLE_THREAD_STACK_SIZE
Stack size for the system idle thread.
CH_SYS_CORE1_MEMORY os_instance_t ch1
Core 1 OS instance.
const os_instance_config_t ch_core0_cfg
Core 0 OS instance configuration.
const os_instance_config_t ch_core1_cfg
Core 1 OS instance configuration.
Type of system data structure.
Structure representing a thread.
void chSysPolledDelayX(rtcnt_t cycles)
Polled delay.
ch_delta_list_t dlist
Delta list header.
ch_system_t ch_system
System root object.
tslices_t ticks
Number of ticks remaining to this thread.
#define THD_WORKING_AREA_BASE(s)
Base of a working area casted to the correct type.
registry_t reglist
Registry header.
ch_delta_list_t * next
Next in the delta list.
static void __tm_calibration_object_init(tm_calibration_t *tcp)
Time measurement initialization.
static syssts_t port_get_irq_status(void)
Returns a word encoding the current interrupts status.
#define THD_WORKING_AREA_END(s)
End of a working area casted to the correct type.
Structure representing a generic bidirectional linked list header and element.
syssts_t chSysGetStatusAndLockX(void)
Returns the execution status and enters a critical zone.
void chSchRescheduleS(void)
Performs a reschedule if a higher priority thread is runnable.
volatile systime_t time
Thread consumed time in ticks.
static void port_disable(void)
Disables all the interrupt sources.
static void __rfcu_object_init(rfcu_t *rfcup)
Runtime Faults Collection Unit initialization.
ch_priority_queue_t * next
Next in the queue.
#define REG_HEADER(oip)
Access to the registry list header.
void chSysInit(void)
System initialization.
ch_queue_t * prev
Previous in the queue.
ch_delta_list_t * prev
Previous in the delta list.
ch_priority_queue_t * prev
Previous in the queue.
system_state_t state
Operating system state.
Type of an system instance configuration.
os_instance_t * instances[PORT_CORES_NUMBER]
Initialized OS instances or NULL.
#define CH_SYS_CORE0_MEMORY
Core zero memory affinity macro.
static void __oslib_init(void)
Initialization of all library modules.
ready_list_t rlist
Ready list header.
CH_SYS_CORE0_MEMORY os_instance_t ch0
Core 0 OS instance.
static CH_SYS_CORE0_MEMORY THD_WORKING_AREA(ch_c0_idle_thread_wa, PORT_IDLE_THREAD_STACK_SIZE)
Working area for core 0 idle thread.
static void __reg_object_init(registry_t *rp)
Initializes a registry.
Structure representing a generic priority-ordered bidirectional linked list header and element.
Delta list element and header structure.
#define chSysUnlock()
Leaves the kernel lock state.
ch_priority_queue_t pqueue
Threads ordered queues header.
#define chThdGetSelfX()
Returns a pointer to the current thread_t.
#define CH_SYS_CORE1_MEMORY
Core one memory affinity macro.
#define chSysLock()
Enters the kernel lock state.