|
PebbleOS
|
Interface between the kernel and the SoC's tickless idle code. More...
Functions | |
| void | pbl_soc_idle (pbl_tick_t max_ticks) |
| Idle the CPU. | |
| bool | pbl_soc_tick_enable (void) |
| Set up the tick interrupt. | |
| bool | pbl_idle_confirm (void) |
| Confirm that the CPU may still go to sleep. | |
| void | pbl_idle_slept (pbl_tick_t elapsed) |
| Account for a sleep during which no tick interrupt ran. | |
| void | pbl_kernel_tick_isr (void) |
| Tick interrupt body, for SoCs that own the SysTick handler. | |
Interface between the kernel and the SoC's tickless idle code.
The SoC implements pbl_soc_idle() and pbl_soc_tick_enable(); the kernel provides the rest. A typical pbl_soc_idle():
| bool pbl_idle_confirm | ( | void | ) |
Confirm that the CPU may still go to sleep.
Call with interrupts masked.
| void pbl_idle_slept | ( | pbl_tick_t | elapsed | ) |
Account for a sleep during which no tick interrupt ran.
Advances the tick count and expires the timeouts that fell due.
| elapsed | Ticks slept. |
| void pbl_kernel_tick_isr | ( | void | ) |
Tick interrupt body, for SoCs that own the SysTick handler.
| void pbl_soc_idle | ( | pbl_tick_t | max_ticks | ) |
Idle the CPU.
Implemented by the SoC. Runs on the idle thread when nothing is runnable, only for gaps of at least two ticks; may sleep. Once interrupts are masked it must check pbl_idle_confirm() before sleeping, and report through pbl_idle_slept() any ticks that passed while the tick interrupt was off.
| max_ticks | Ticks until the next timeout, PBL_TICK_FOREVER if none. |
| bool pbl_soc_tick_enable | ( | void | ) |
Set up the tick interrupt.
Implemented by the SoC; called when the scheduler starts. A SoC that drives the tick itself calls pbl_kernel_tick_isr() from its handler.