Trait r3_kernel::PortToKernel
source · pub trait PortToKernel {
// Required methods
unsafe fn boot() -> !;
unsafe fn choose_running_task();
unsafe fn timer_tick();
}
Expand description
Required Methods§
sourceunsafe fn boot() -> !
unsafe fn boot() -> !
Initialize runtime structures.
Should be called for exactly once by the port before calling into any user (application) or kernel code.
Precondition: CPU Lock active, Preboot phase
sourceunsafe fn choose_running_task()
unsafe fn choose_running_task()
Determine the next task to run and store it in State::running_task_ptr
.
Precondition: CPU Lock active / Postcondition: CPU Lock active
sourceunsafe fn timer_tick()
unsafe fn timer_tick()
Called by a port timer driver to “announce” new ticks.
This method can be called anytime, but the driver is expected to attempt
to ensure the calls occur near tick boundaries. For an optimal
operation, the driver should implement pend_tick_after
and handle
the calls made by the kernel to figure out the optimal moment to call
timer_tick
.
This method will call pend_tick
or pend_tick_after
.
Precondition: CPU Lock inactive, an interrupt context