[][src]Struct kernel::Kernel

pub struct Kernel { /* fields omitted */ }

Main object for the kernel. Each board will need to create one.

Implementations

impl Kernel[src]

pub fn new(processes: &'static [Option<&'static dyn ProcessType>]) -> Kernel[src]

pub fn increment_work_external(
    &self,
    _capability: &dyn ExternalProcessCapability
)
[src]

Something was scheduled for a process, so there is more work to do.

This is exposed publicly, but restricted with a capability. The intent is that external implementations of ProcessType need to be able to indicate there is more process work to do.

pub fn decrement_work_external(
    &self,
    _capability: &dyn ExternalProcessCapability
)
[src]

Something finished for a process, so we decrement how much work there is to do.

This is exposed publicly, but restricted with a capability. The intent is that external implementations of ProcessType need to be able to indicate that some process work has finished.

pub fn process_each_capability<F>(
    &'static self,
    _capability: &dyn ProcessManagementCapability,
    closure: F
) where
    F: Fn(&dyn ProcessType), 
[src]

Run a closure on every valid process. This will iterate the array of processes and call the closure on every process that exists.

This is functionally the same as process_each(), but this method is available outside the kernel crate and requires a ProcessManagementCapability to use.

pub fn create_grant<T: Default>(
    &'static self,
    _capability: &dyn MemoryAllocationCapability
) -> Grant<T>
[src]

Create a new grant. This is used in board initialization to setup grants that capsules use to interact with processes.

Grants must only be created before processes are initialized. Processes use the number of grants that have been allocated to correctly initialize the process's memory with a pointer for each grant. If a grant is created after processes are initialized this will panic.

Calling this function is restricted to only certain users, and to enforce this calling this function requires the MemoryAllocationCapability capability.

pub fn get_grant_count_and_finalize_external(
    &self,
    _capability: &dyn ExternalProcessCapability
) -> usize
[src]

Returns the number of grants that have been setup in the system and marks the grants as "finalized". This means that no more grants can be created because data structures have been setup based on the number of grants when this function is called.

In practice, this is called when processes are created, and the process memory is setup based on the number of current grants.

This is exposed publicly, but restricted with a capability. The intent is that external implementations of ProcessType need to be able to retrieve the final number of grants.

pub fn hardfault_all_apps<C: ProcessManagementCapability>(&self, _c: &C)[src]

Cause all apps to fault.

This will call set_fault_state() on each app, causing the app to enter the state as if it had crashed (for example with an MPU violation). If the process is configured to be restarted it will be.

Only callers with the ProcessManagementCapability can call this function. This restricts general capsules from being able to call this function, since capsules should not be able to arbitrarily restart all apps.

pub fn kernel_loop<P: Platform, C: Chip, SC: Scheduler<C>>(
    &self,
    platform: &P,
    chip: &C,
    ipc: Option<&IPC>,
    scheduler: &SC,
    _capability: &dyn MainLoopCapability
) -> !
[src]

Main loop of the OS.

Most of the behavior of this loop is controlled by the Scheduler implementation in use.

Auto Trait Implementations

impl !Send for Kernel

impl !Sync for Kernel

impl Unpin for Kernel

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.