ChibiOS  21.6.0
System Management
Collaboration diagram for System Management:

Detailed Description

System related APIs and services:

Macros

#define CH_SYS_CORE0_MEMORY   PORT_CORE0_BSS_SECTION
 Core zero memory affinity macro. More...
 
#define CH_SYS_CORE1_MEMORY   PORT_CORE1_BSS_SECTION
 Core one memory affinity macro. More...
 
#define currcore   ch_system.instances[port_get_core_id()]
 Access to current core's instance structure. More...
 
#define chSysGetRealtimeCounterX()   (rtcnt_t)port_rt_get_counter_value()
 Returns the current value of the system real time counter. More...
 
#define chSysSwitch(ntp, otp)
 Performs a context switch. More...
 

Masks of executable integrity checks.

#define CH_INTEGRITY_RLIST   1U
 
#define CH_INTEGRITY_VTLIST   2U
 
#define CH_INTEGRITY_REGISTRY   4U
 
#define CH_INTEGRITY_PORT   8U
 

ISRs abstraction macros

#define CH_IRQ_IS_VALID_PRIORITY(prio)   PORT_IRQ_IS_VALID_PRIORITY(prio)
 Priority level validation macro. More...
 
#define CH_IRQ_IS_VALID_KERNEL_PRIORITY(prio)   PORT_IRQ_IS_VALID_KERNEL_PRIORITY(prio)
 Priority level validation macro. More...
 
#define CH_IRQ_PROLOGUE()
 IRQ handler enter code. More...
 
#define CH_IRQ_EPILOGUE()
 IRQ handler exit code. More...
 
#define CH_IRQ_HANDLER(id)   PORT_IRQ_HANDLER(id)
 Standard normal IRQ handler declaration. More...
 

Fast ISRs abstraction macros

#define CH_FAST_IRQ_HANDLER(id)   PORT_FAST_IRQ_HANDLER(id)
 Standard fast IRQ handler declaration. More...
 

Time conversion utilities for the realtime counter

#define S2RTC(freq, sec)   ((freq) * (sec))
 Seconds to realtime counter. More...
 
#define MS2RTC(freq, msec)   (rtcnt_t)((((freq) + 999UL) / 1000UL) * (msec))
 Milliseconds to realtime counter. More...
 
#define US2RTC(freq, usec)   (rtcnt_t)((((freq) + 999999UL) / 1000000UL) * (usec))
 Microseconds to realtime counter. More...
 
#define RTC2S(freq, n)   ((((n) - 1UL) / (freq)) + 1UL)
 Realtime counter cycles to seconds. More...
 
#define RTC2MS(freq, n)   ((((n) - 1UL) / ((freq) / 1000UL)) + 1UL)
 Realtime counter cycles to milliseconds. More...
 
#define RTC2US(freq, n)   ((((n) - 1UL) / ((freq) / 1000000UL)) + 1UL)
 Realtime counter cycles to microseconds. More...
 

Functions

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. More...
 
static CH_SYS_CORE1_MEMORY THD_WORKING_AREA (ch_c1_idle_thread_wa, PORT_IDLE_THREAD_STACK_SIZE)
 Working area for core 1 idle thread. More...
 
void chSysWaitSystemState (system_state_t state)
 Waits for the system state to be equal to the specified one. More...
 
void chSysInit (void)
 System initialization. More...
 
void chSysHalt (const char *reason)
 Halts the system. More...
 
bool chSysIntegrityCheckI (unsigned testmask)
 System integrity check. More...
 
void chSysTimerHandlerI (void)
 Handles time ticks for round robin preemption and timer increments. More...
 
syssts_t chSysGetStatusAndLockX (void)
 Returns the execution status and enters a critical zone. More...
 
void chSysRestoreStatusX (syssts_t sts)
 Restores the specified execution status and leaves a critical zone. More...
 
bool chSysIsCounterWithinX (rtcnt_t cnt, rtcnt_t start, rtcnt_t end)
 Realtime window test. More...
 
void chSysPolledDelayX (rtcnt_t cycles)
 Polled delay. More...
 
static void chSysDisable (void)
 Raises the system interrupt priority mask to the maximum level. More...
 
static void chSysSuspend (void)
 Raises the system interrupt priority mask to system level. More...
 
static void chSysEnable (void)
 Lowers the system interrupt priority mask to user level. More...
 
static void chSysLock (void)
 Enters the kernel lock state. More...
 
static void chSysUnlock (void)
 Leaves the kernel lock state. More...
 
static void chSysLockFromISR (void)
 Enters the kernel lock state from within an interrupt handler. More...
 
static void chSysUnlockFromISR (void)
 Leaves the kernel lock state from within an interrupt handler. More...
 
static void chSysUnconditionalLock (void)
 Unconditionally enters the kernel lock state. More...
 
static void chSysUnconditionalUnlock (void)
 Unconditionally leaves the kernel lock state. More...
 
static void chSysNotifyInstance (os_instance_t *oip)
 Notifies an OS instance to check for reschedule. More...
 
static thread_tchSysGetIdleThreadX (void)
 Returns a pointer to the idle thread. More...
 

Variables

ch_system_t ch_system
 System root object. More...
 
CH_SYS_CORE0_MEMORY os_instance_t ch0
 Core 0 OS instance. More...
 
const os_instance_config_t ch_core0_cfg
 Core 0 OS instance configuration. More...
 
CH_SYS_CORE1_MEMORY os_instance_t ch1
 Core 1 OS instance. More...
 
const os_instance_config_t ch_core1_cfg
 Core 1 OS instance configuration. More...
 

Macro Definition Documentation

◆ CH_SYS_CORE0_MEMORY

#define CH_SYS_CORE0_MEMORY   PORT_CORE0_BSS_SECTION

Core zero memory affinity macro.

Note
The memory is meant to be reachable by both cores but preferred by core zero.
Only uninitialized variables can be tagged with this attribute.

Definition at line 62 of file chsys.h.

◆ CH_SYS_CORE1_MEMORY

#define CH_SYS_CORE1_MEMORY   PORT_CORE1_BSS_SECTION

Core one memory affinity macro.

Note
The memory is meant to be reachable by both cores but preferred by core one.
Only uninitialized variables can be tagged with this attribute.

Definition at line 74 of file chsys.h.

◆ currcore

#define currcore   ch_system.instances[port_get_core_id()]

Access to current core's instance structure.

Definition at line 90 of file chsys.h.

◆ CH_IRQ_IS_VALID_PRIORITY

#define CH_IRQ_IS_VALID_PRIORITY (   prio)    PORT_IRQ_IS_VALID_PRIORITY(prio)

Priority level validation macro.

This macro determines if the passed value is a valid priority level for the underlying architecture.

Parameters
[in]priothe priority level
Returns
Priority range result.
Return values
falseif the priority is invalid or if the architecture does not support priorities.
trueif the priority is valid.

Definition at line 116 of file chsys.h.

◆ CH_IRQ_IS_VALID_KERNEL_PRIORITY

#define CH_IRQ_IS_VALID_KERNEL_PRIORITY (   prio)    PORT_IRQ_IS_VALID_KERNEL_PRIORITY(prio)

Priority level validation macro.

This macro determines if the passed value is a valid priority level that cannot preempt the kernel critical zone.

Parameters
[in]priothe priority level
Returns
Priority range result.
Return values
falseif the priority is invalid or if the architecture does not support priorities.
trueif the priority is valid.

Definition at line 134 of file chsys.h.

◆ CH_IRQ_PROLOGUE

#define CH_IRQ_PROLOGUE ( )
Value:
CH_CFG_IRQ_PROLOGUE_HOOK(); \
__stats_increase_irq(); \
__trace_isr_enter(__func__); \
__dbg_check_enter_isr()

IRQ handler enter code.

Note
Usually IRQ handlers functions are also declared naked.
On some architectures this macro can be empty.
Function Class:
Special function, this function has special requirements see the notes.

Definition at line 147 of file chsys.h.

◆ CH_IRQ_EPILOGUE

#define CH_IRQ_EPILOGUE ( )
Value:
__dbg_check_leave_isr(); \
__trace_isr_leave(__func__); \
CH_CFG_IRQ_EPILOGUE_HOOK(); \
PORT_IRQ_EPILOGUE()

IRQ handler exit code.

Note
Usually IRQ handlers function are also declared naked.
This macro usually performs the final reschedule by using chSchIsPreemptionRequired() and chSchDoReschedule().
Function Class:
Special function, this function has special requirements see the notes.

Definition at line 162 of file chsys.h.

◆ CH_IRQ_HANDLER

#define CH_IRQ_HANDLER (   id)    PORT_IRQ_HANDLER(id)

Standard normal IRQ handler declaration.

Note
id can be a function name or a vector number depending on the port implementation.
Function Class:
Special function, this function has special requirements see the notes.

Definition at line 175 of file chsys.h.

◆ CH_FAST_IRQ_HANDLER

#define CH_FAST_IRQ_HANDLER (   id)    PORT_FAST_IRQ_HANDLER(id)

Standard fast IRQ handler declaration.

Note
id can be a function name or a vector number depending on the port implementation.
Not all architectures support fast interrupts.
Function Class:
Special function, this function has special requirements see the notes.

Definition at line 190 of file chsys.h.

◆ S2RTC

#define S2RTC (   freq,
  sec 
)    ((freq) * (sec))

Seconds to realtime counter.

Converts from seconds to realtime counter cycles.

Note
The macro assumes that freq >= 1.
Parameters
[in]freqclock frequency, in Hz, of the realtime counter
[in]secnumber of seconds
Returns
The number of cycles.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 208 of file chsys.h.

◆ MS2RTC

#define MS2RTC (   freq,
  msec 
)    (rtcnt_t)((((freq) + 999UL) / 1000UL) * (msec))

Milliseconds to realtime counter.

Converts from milliseconds to realtime counter cycles.

Note
The result is rounded upward to the next millisecond boundary.
The macro assumes that freq >= 1000.
Parameters
[in]freqclock frequency, in Hz, of the realtime counter
[in]msecnumber of milliseconds
Returns
The number of cycles.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 222 of file chsys.h.

◆ US2RTC

#define US2RTC (   freq,
  usec 
)    (rtcnt_t)((((freq) + 999999UL) / 1000000UL) * (usec))

Microseconds to realtime counter.

Converts from microseconds to realtime counter cycles.

Note
The result is rounded upward to the next microsecond boundary.
The macro assumes that freq >= 1000000.
Parameters
[in]freqclock frequency, in Hz, of the realtime counter
[in]usecnumber of microseconds
Returns
The number of cycles.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 236 of file chsys.h.

◆ RTC2S

#define RTC2S (   freq,
 
)    ((((n) - 1UL) / (freq)) + 1UL)

Realtime counter cycles to seconds.

Converts from realtime counter cycles number to seconds.

Note
The result is rounded up to the next second boundary.
The macro assumes that freq >= 1.
Parameters
[in]freqclock frequency, in Hz, of the realtime counter
[in]nnumber of cycles
Returns
The number of seconds.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 250 of file chsys.h.

◆ RTC2MS

#define RTC2MS (   freq,
 
)    ((((n) - 1UL) / ((freq) / 1000UL)) + 1UL)

Realtime counter cycles to milliseconds.

Converts from realtime counter cycles number to milliseconds.

Note
The result is rounded up to the next millisecond boundary.
The macro assumes that freq >= 1000.
Parameters
[in]freqclock frequency, in Hz, of the realtime counter
[in]nnumber of cycles
Returns
The number of milliseconds.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 264 of file chsys.h.

◆ RTC2US

#define RTC2US (   freq,
 
)    ((((n) - 1UL) / ((freq) / 1000000UL)) + 1UL)

Realtime counter cycles to microseconds.

Converts from realtime counter cycles number to microseconds.

Note
The result is rounded up to the next microsecond boundary.
The macro assumes that freq >= 1000000.
Parameters
[in]freqclock frequency, in Hz, of the realtime counter
[in]nnumber of cycles
Returns
The number of microseconds.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 278 of file chsys.h.

◆ chSysGetRealtimeCounterX

#define chSysGetRealtimeCounterX ( )    (rtcnt_t)port_rt_get_counter_value()

Returns the current value of the system real time counter.

Note
This function is only available if the port layer supports the option PORT_SUPPORTS_RT.
Returns
The value of the system realtime counter of type rtcnt_t.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 292 of file chsys.h.

◆ chSysSwitch

#define chSysSwitch (   ntp,
  otp 
)
Value:
{ \
__trace_switch(ntp, otp); \
__stats_ctxswc(ntp, otp); \
CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp); \
port_switch(ntp, otp); \
}

Performs a context switch.

Note
Not a user function, it is meant to be invoked by the scheduler itself or from within the port layer.
Parameters
[in]ntpthe thread to be switched in
[in]otpthe thread to be switched out
Function Class:
Special function, this function has special requirements see the notes.

Definition at line 305 of file chsys.h.

Function Documentation

◆ THD_WORKING_AREA() [1/2]

static CH_SYS_CORE0_MEMORY THD_WORKING_AREA ( ch_c0_idle_thread_wa  ,
PORT_IDLE_THREAD_STACK_SIZE   
)
static

Working area for core 0 idle thread.

◆ THD_WORKING_AREA() [2/2]

static CH_SYS_CORE1_MEMORY THD_WORKING_AREA ( ch_c1_idle_thread_wa  ,
PORT_IDLE_THREAD_STACK_SIZE   
)
static

Working area for core 1 idle thread.

◆ chSysWaitSystemState()

void chSysWaitSystemState ( system_state_t  state)

Waits for the system state to be equal to the specified one.

Note
Can be called before chSchObjectInit() in order to wait for system initialization by another core.
Function Class:
Special function, this function has special requirements see the notes.

Definition at line 142 of file chsys.c.

References ch_system::state.

◆ chSysInit()

void chSysInit ( void  )

System initialization.

After executing this function the current instructions stream becomes the main thread.

Precondition
Interrupts must disabled before invoking this function.
Postcondition
The main thread is created with priority NORMALPRIO and interrupts are enabled.
the system is in ch_sys_running state.
Function Class:
Special function, this function has special requirements see the notes.

Definition at line 159 of file chsys.c.

References ch_system::state.

◆ chSysHalt()

void chSysHalt ( const char *  reason)

Halts the system.

This function is invoked by the operating system when an unrecoverable error is detected, for example because a programming error in the application code that triggers an assertion while in debug mode.

Note
Can be invoked from any system state.
Parameters
[in]reasonpointer to an error string
Function Class:
Special function, this function has special requirements see the notes.

Definition at line 209 of file chsys.c.

Referenced by __dbg_check_disable(), __dbg_check_enable(), __dbg_check_enter_isr(), __dbg_check_leave_isr(), __dbg_check_lock(), __dbg_check_lock_from_isr(), __dbg_check_suspend(), __dbg_check_unlock(), __dbg_check_unlock_from_isr(), chDbgCheckClassI(), and chDbgCheckClassS().

◆ chSysIntegrityCheckI()

bool chSysIntegrityCheckI ( unsigned  testmask)

System integrity check.

Performs an integrity check of the important ChibiOS/RT data structures.

Note
The appropriate action in case of failure is to halt the system before releasing the critical zone.
If the system is corrupted then one possible outcome of this function is an exception caused by NULL or corrupted pointers in list elements. Exception vectors must be monitored as well.
This function is not used internally, it is up to the application to define if and where to perform system checking.
Performing all tests at once can be a slow operation and can degrade the system response time. It is suggested to execute one test at time and release the critical zone in between tests.
Parameters
[in]testmaskEach bit in this mask is associated to a test to be performed.
Returns
The test result.
Return values
falseThe test succeeded.
trueTest failed.
Function Class:
This is an I-Class API, this function can be invoked from within a system lock zone by both threads and interrupt handlers.

Definition at line 260 of file chsys.c.

References currcore.

◆ chSysTimerHandlerI()

void chSysTimerHandlerI ( void  )

Handles time ticks for round robin preemption and timer increments.

Decrements the remaining time quantum of the running thread and preempts it when the quantum is used up. Increments system time and manages the timers.

Note
The frequency of the timer determines the system tick granularity and, together with the CH_CFG_TIME_QUANTUM macro, the round robin interval.
Function Class:
This is an I-Class API, this function can be invoked from within a system lock zone by both threads and interrupt handlers.

Definition at line 366 of file chsys.c.

References chThdGetSelfX.

◆ chSysGetStatusAndLockX()

syssts_t chSysGetStatusAndLockX ( void  )

Returns the execution status and enters a critical zone.

This functions enters into a critical zone and can be called from any context. Because its flexibility it is less efficient than chSysLock() which is preferable when the calling context is known.

Postcondition
The system is in a critical zone.
Returns
The previous system status, the encoding of this status word is architecture-dependent and opaque.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 400 of file chsys.c.

References chSysLock, chSysLockFromISR, port_get_irq_status(), port_irq_enabled(), and port_is_isr_context().

Here is the call graph for this function:

◆ chSysRestoreStatusX()

void chSysRestoreStatusX ( syssts_t  sts)

Restores the specified execution status and leaves a critical zone.

Note
A call to chSchRescheduleS() is automatically performed if exiting the critical zone and if not in ISR context.
Parameters
[in]ststhe system status to be restored.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 423 of file chsys.c.

References chSchRescheduleS(), chSysUnlock, chSysUnlockFromISR, port_irq_enabled(), and port_is_isr_context().

Here is the call graph for this function:

◆ chSysIsCounterWithinX()

bool chSysIsCounterWithinX ( rtcnt_t  cnt,
rtcnt_t  start,
rtcnt_t  end 
)

Realtime window test.

This function verifies if the current realtime counter value lies within the specified range or not. The test takes care of the realtime counter wrapping to zero on overflow.

Note
When start==end then the function returns always false because a null time range is specified.
This function is only available if the port layer supports the option PORT_SUPPORTS_RT.
Parameters
[in]cntthe counter value to be tested
[in]startthe start of the time window (inclusive)
[in]endthe end of the time window (non inclusive)
Return values
truecurrent time within the specified time window.
falsecurrent time not within the specified time window.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 455 of file chsys.c.

Referenced by chSysPolledDelayX().

◆ chSysPolledDelayX()

void chSysPolledDelayX ( rtcnt_t  cycles)

Polled delay.

Note
The real delay is always few cycles in excess of the specified value.
This function is only available if the port layer supports the option PORT_SUPPORTS_RT.
Parameters
[in]cyclesnumber of cycles
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 472 of file chsys.c.

References chSysGetRealtimeCounterX, and chSysIsCounterWithinX().

Here is the call graph for this function:

◆ chSysDisable()

static void chSysDisable ( void  )
inlinestatic

Raises the system interrupt priority mask to the maximum level.

All the maskable interrupt sources are disabled regardless their hardware priority.

Note
Do not invoke this API from within a kernel lock.
This API is no replacement for chSysLock()and chSysUnock() which could do more than just disable interrupts.
Function Class:
Special function, this function has special requirements see the notes.

Definition at line 361 of file chsys.h.

References port_disable().

Here is the call graph for this function:

◆ chSysSuspend()

static void chSysSuspend ( void  )
inlinestatic

Raises the system interrupt priority mask to system level.

The interrupt sources that should not be able to preempt the kernel are disabled, interrupt sources with higher priority are still enabled.

Note
Do not invoke this API from within a kernel lock.
This API is no replacement for chSysLock() which could do more than just disable interrupts.
Function Class:
Special function, this function has special requirements see the notes.

Definition at line 378 of file chsys.h.

References port_suspend().

Here is the call graph for this function:

◆ chSysEnable()

static void chSysEnable ( void  )
inlinestatic

Lowers the system interrupt priority mask to user level.

All the interrupt sources are enabled.

Note
Do not invoke this API from within a kernel lock.
This API is no replacement for chSysUnlock() which could do more than just enable interrupts.
Function Class:
Special function, this function has special requirements see the notes.

Definition at line 393 of file chsys.h.

◆ chSysLock()

static void chSysLock ( void  )
inlinestatic

Enters the kernel lock state.

Note
The exact behavior of this function is port-dependent and could not be limited to disabling interrupts.
Function Class:
Special function, this function has special requirements see the notes.

Definition at line 406 of file chsys.h.

References __stats_start_measure_crit_thd(), and port_lock().

Referenced by chSysUnconditionalLock().

Here is the call graph for this function:

◆ chSysUnlock()

static void chSysUnlock ( void  )
inlinestatic

Leaves the kernel lock state.

Note
The exact behavior of this function is port-dependent and could not be limited to enabling interrupts.
Function Class:
Special function, this function has special requirements see the notes.

Definition at line 420 of file chsys.h.

Referenced by chSysUnconditionalUnlock().

◆ chSysLockFromISR()

static void chSysLockFromISR ( void  )
inlinestatic

Enters the kernel lock state from within an interrupt handler.

Note
This API may do nothing on some architectures, it is required because on ports that support preemptable interrupt handlers it is required to raise the interrupt mask to the same level of the system mutual exclusion zone.
It is good practice to invoke this API before invoking any I-class syscall from an interrupt handler.
The exact behavior of this function is port-dependent and could not be limited to disabling interrupts.
This API must be invoked exclusively from interrupt handlers.
Function Class:
Special function, this function has special requirements see the notes.

Definition at line 450 of file chsys.h.

References __stats_start_measure_crit_isr(), and port_lock_from_isr().

Here is the call graph for this function:

◆ chSysUnlockFromISR()

static void chSysUnlockFromISR ( void  )
inlinestatic

Leaves the kernel lock state from within an interrupt handler.

Note
This API may do nothing on some architectures, it is required because on ports that support preemptable interrupt handlers it is required to raise the interrupt mask to the same level of the system mutual exclusion zone.
It is good practice to invoke this API after invoking any I-class syscall from an interrupt handler.
The exact behavior of this function is port-dependent and could not be limited to enabling interrupts.
This API must be invoked exclusively from interrupt handlers.
Function Class:
Special function, this function has special requirements see the notes.

Definition at line 472 of file chsys.h.

◆ chSysUnconditionalLock()

static void chSysUnconditionalLock ( void  )
inlinestatic

Unconditionally enters the kernel lock state.

Note
Can be called without previous knowledge of the current lock state. The final state is "s-locked".
Function Class:
Special function, this function has special requirements see the notes.

Definition at line 486 of file chsys.h.

References chSysLock(), port_get_irq_status(), and port_irq_enabled().

Here is the call graph for this function:

◆ chSysUnconditionalUnlock()

static void chSysUnconditionalUnlock ( void  )
inlinestatic

Unconditionally leaves the kernel lock state.

Note
Can be called without previous knowledge of the current lock state. The final state is "normal".
Function Class:
Special function, this function has special requirements see the notes.

Definition at line 500 of file chsys.h.

References chSysUnlock(), port_get_irq_status(), and port_irq_enabled().

Here is the call graph for this function:

◆ chSysNotifyInstance()

static void chSysNotifyInstance ( os_instance_t oip)
inlinestatic

Notifies an OS instance to check for reschedule.

An OS instance is notified to check if a reschedule is required, the implementation is port-dependent.

Parameters
[in]oippointer to the instance to be notified

Definition at line 515 of file chsys.h.

◆ chSysGetIdleThreadX()

static thread_t* chSysGetIdleThreadX ( void  )
inlinestatic

Returns a pointer to the idle thread.

Precondition
In order to use this function the option CH_CFG_NO_IDLE_THREAD must be disabled.
Note
The reference counter of the idle thread is not incremented but it is not strictly required being the idle thread a static object.
Returns
Pointer to the idle thread.
Function Class:
This is an X-Class API, this function can be invoked from any context.

Definition at line 534 of file chsys.h.

References currcore.

Variable Documentation

◆ ch_system

System root object.

Definition at line 45 of file chsys.c.

◆ ch0

Core 0 OS instance.

Definition at line 50 of file chsys.c.

◆ ch_core0_cfg

const os_instance_config_t ch_core0_cfg
Initial value:
= {
.name = "c0",
.mainthread_base = &__main_thread_stack_base__,
.mainthread_end = &__main_thread_stack_end__,
.idlethread_base = THD_WORKING_AREA_BASE(ch_c0_idle_thread_wa),
.idlethread_end = THD_WORKING_AREA_END(ch_c0_idle_thread_wa)
}

Core 0 OS instance configuration.

Definition at line 66 of file chsys.c.

◆ ch1

Core 1 OS instance.

Definition at line 86 of file chsys.c.

◆ ch_core1_cfg

const os_instance_config_t ch_core1_cfg
Initial value:
= {
.name = "c1",
.mainthread_base = &__c1_main_thread_stack_base__,
.mainthread_end = &__c1_main_thread_stack_end__,
.idlethread_base = THD_WORKING_AREA_BASE(ch_c1_idle_thread_wa),
.idlethread_end = THD_WORKING_AREA_END(ch_c1_idle_thread_wa)
}

Core 1 OS instance configuration.

Definition at line 103 of file chsys.c.

PORT_IRQ_PROLOGUE
#define PORT_IRQ_PROLOGUE()
IRQ prologue code.
Definition: chcore.h:226
THD_WORKING_AREA_BASE
#define THD_WORKING_AREA_BASE(s)
Base of a working area casted to the correct type.
Definition: chthreads.h:150
THD_WORKING_AREA_END
#define THD_WORKING_AREA_END(s)
End of a working area casted to the correct type.
Definition: chthreads.h:157
__trace_switch
void __trace_switch(thread_t *ntp, thread_t *otp)
Inserts in the circular debug trace buffer a context switch record.
Definition: chtrace.c:127