41 #define CH_INTEGRITY_RLIST 1U 42 #define CH_INTEGRITY_VTLIST 2U 43 #define CH_INTEGRITY_REGISTRY 4U 44 #define CH_INTEGRITY_PORT 8U 77 #if defined(PORT_IRQ_IS_VALID_PRIORITY) || defined(__DOXYGEN__) 78 #define CH_IRQ_IS_VALID_PRIORITY(prio) \ 79 PORT_IRQ_IS_VALID_PRIORITY(prio) 81 #define CH_IRQ_IS_VALID_PRIORITY(prio) false 95 #if defined(PORT_IRQ_IS_VALID_KERNEL_PRIORITY) || defined(__DOXYGEN__) 96 #define CH_IRQ_IS_VALID_KERNEL_PRIORITY(prio) \ 97 PORT_IRQ_IS_VALID_KERNEL_PRIORITY(prio) 99 #define CH_IRQ_IS_VALID_KERNEL_PRIORITY(prio) false 109 #define CH_IRQ_PROLOGUE() \ 110 PORT_IRQ_PROLOGUE(); \ 111 CH_CFG_IRQ_PROLOGUE_HOOK(); \ 112 _stats_increase_irq(); \ 113 _trace_isr_enter(__func__); \ 114 _dbg_check_enter_isr() 124 #define CH_IRQ_EPILOGUE() \ 125 _dbg_check_leave_isr(); \ 126 _trace_isr_leave(__func__); \ 127 CH_CFG_IRQ_EPILOGUE_HOOK(); \ 137 #define CH_IRQ_HANDLER(id) PORT_IRQ_HANDLER(id) 151 #define CH_FAST_IRQ_HANDLER(id) PORT_FAST_IRQ_HANDLER(id) 169 #define S2RTC(freq, sec) ((freq) * (sec)) 183 #define MS2RTC(freq, msec) (rtcnt_t)((((freq) + 999UL) / 1000UL) * (msec)) 197 #define US2RTC(freq, usec) (rtcnt_t)((((freq) + 999999UL) / 1000000UL) * (usec)) 211 #define RTC2S(freq, n) ((((n) - 1UL) / (freq)) + 1UL) 225 #define RTC2MS(freq, n) ((((n) - 1UL) / ((freq) / 1000UL)) + 1UL) 239 #define RTC2US(freq, n) ((((n) - 1UL) / ((freq) / 1000000UL)) + 1UL) 252 #if (PORT_SUPPORTS_RT == TRUE) || defined(__DOXYGEN__) 253 #define chSysGetRealtimeCounterX() (rtcnt_t)port_rt_get_counter_value() 266 #define chSysSwitch(ntp, otp) { \ 268 _trace_switch(ntp, otp); \ 269 _stats_ctxswc(ntp, otp); \ 270 CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp); \ 271 port_switch(ntp, otp); \ 278 #if !defined(__DOXYGEN__) 279 extern stkalign_t ch_idle_thread_wa[];
290 #if PORT_SUPPORTS_RT == TRUE 376 "priority order violation");
395 port_lock_from_isr();
417 port_unlock_from_isr();
429 if (port_irq_enabled(port_get_irq_status())) {
443 if (!port_irq_enabled(port_get_irq_status())) {
448 #if (CH_CFG_NO_IDLE_THREAD == FALSE) || defined(__DOXYGEN__) void _dbg_check_lock_from_isr(void)
Guard code for chSysLockFromIsr().
void _dbg_check_lock(void)
Guard code for chSysLock().
void _dbg_check_enable(void)
Guard code for chSysEnable().
static void chSysLock(void)
Enters the kernel lock state.
void chSysPolledDelayX(rtcnt_t cycles)
Polled delay.
void _stats_start_measure_crit_thd(void)
Starts the measurement of a thread critical zone.
static void chSysUnlock(void)
Leaves the kernel lock state.
void _stats_stop_measure_crit_thd(void)
Stops the measurement of a thread critical zone.
void _dbg_check_disable(void)
Guard code for chSysDisable().
static void chSysUnconditionalUnlock(void)
Unconditionally leaves the kernel lock state.
void _dbg_check_unlock(void)
Guard code for chSysUnlock().
void chSysTimerHandlerI(void)
Handles time ticks for round robin preemption and timer increments.
bool chSysIntegrityCheckI(unsigned testmask)
System integrity check.
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.
#define chDbgAssert(c, r)
Condition assertion.
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.
static thread_t * chSysGetIdleThreadX(void)
Returns a pointer to the idle thread.
bool chSysIsCounterWithinX(rtcnt_t cnt, rtcnt_t start, rtcnt_t end)
Realtime window test.
void _stats_start_measure_crit_isr(void)
Starts the measurement of an ISR critical zone.
static void chSysEnable(void)
Lowers the system interrupt priority mask to user level.
void _dbg_check_unlock_from_isr(void)
Guard code for chSysUnlockFromIsr().
static void chSysDisable(void)
Raises the system interrupt priority mask to the maximum level.
void _dbg_check_suspend(void)
Guard code for chSysSuspend().
static void chSysUnconditionalLock(void)
Unconditionally enters the kernel lock state.
void _stats_stop_measure_crit_isr(void)
Stops the measurement of an ISR critical zone.
static void chSysSuspend(void)
Raises the system interrupt priority mask to system level.
Structure representing a thread.