pub trait PortToKernel {
    // Required methods
    unsafe fn boot() -> !;
    unsafe fn choose_running_task();
    unsafe fn timer_tick();
}
Expand description

Methods intended to be called by a port.

Safety

These are only meant to be called by the port.

Required Methods§

source

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

source

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

source

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

Implementors§

source§

impl<Traits: KernelTraits> PortToKernel for Traits