Struct r3::kernel::cfg::Cfg

source ·
pub struct Cfg<'c, C>where
    C: CfgBase,{ /* private fields */ }
Expand description

Wraps a raw_cfg::CfgBase to provide higher-level services.

Implementations§

source§

impl<'c, C> Cfg<'c, C>where C: CfgBase,

source

pub const fn raw(&mut self) -> &mut C

Mutably borrow the underlying C.

source

pub const fn num_task_priority_levels(&mut self, new_value: usize)where C: CfgBase,

Specify the number of task priority levels.

The RAM consumption by task ready queues is expected to be proportional to the number of task priority levels. In addition, the scheduler may be heavily optimized for the cases where the number is very small (e.g., < 16). This optimization can provide a significant performance improvement if the target processor does not have a CTZ (count trailing zero) instruction, barrel shifter, or hardware multiplier.

Kernels may set an arbitrary upper bound for the number of task priority levels.

source

pub const fn finish_phase1(&mut self) -> CfgPhase1Data<<C as CfgBase>::System>where C: CfgBase,

Finalize self for the phase 1 configuration.

This method constructs CfgPhase1Data, which must be passed to attach_phase1! to proceed with the kernel-independent configuration process.

source

pub const fn finish_phase2(&mut self) -> CfgPhase2Data<<C as CfgBase>::System>where C: CfgBase,

Finalize self for the phase 2 configuration.

This method constructs CfgPhase2Data, which must be passed to attach_phase2! to proceed with the kernel-independent configuration process.

source

pub const fn finish_phase3_interrupt(&mut self)where C: CfgInterruptLine, <C as CfgBase>::System: CfgPhase2<<C as CfgBase>::System> + KernelInterruptLine,

Perform additional finalization tasks for interrupt line configuration.

This method must be called before Self::finish_phase3 if C implements CfgInterruptLine.

source

pub const fn finish_phase3(self) -> CfgPhase3Data<<C as CfgBase>::System>where C: CfgBase, <C as CfgBase>::System: CfgPhase2<<C as CfgBase>::System>,

Finalize self for the phase 3 configuration.

This method makes the last set of changes to the referenced C: impl CfgBase. It also constructs CfgPhase3Data, which must be passed to attach_phase3! to complete the kernel-independent configuration process.

Auto Trait Implementations§

§

impl<'c, C> !RefUnwindSafe for Cfg<'c, C>

§

impl<'c, C> !Send for Cfg<'c, C>

§

impl<'c, C> !Sync for Cfg<'c, C>

§

impl<'c, C> Unpin for Cfg<'c, C>

§

impl<'c, C> !UnwindSafe for Cfg<'c, C>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.