Struct EarlGrey

Source
pub struct EarlGrey<'a, const MPU_REGIONS: usize, I: InterruptService + 'a, CFG: EarlGreyConfig + 'static, PINMUX: EarlGreyPinmuxConfig, PMP: TORUserPMP<MPU_REGIONS> + Display + 'static> {
    pub mpu: PMPUserMPU<MPU_REGIONS, PMP>,
    /* private fields */
}

Fields§

§mpu: PMPUserMPU<MPU_REGIONS, PMP>

Implementations§

Source§

impl<'a, const MPU_REGIONS: usize, I: InterruptService + 'a, CFG: EarlGreyConfig, PINMUX: EarlGreyPinmuxConfig, PMP: TORUserPMP<MPU_REGIONS> + Display + 'static> EarlGrey<'a, MPU_REGIONS, I, CFG, PINMUX, PMP>

Source

pub unsafe fn new( plic_interrupt_service: &'a I, timer: &'static RvTimer<'_, CFG>, pmp: PMP, ) -> Self

Source

pub unsafe fn enable_plic_interrupts(&self)

Trait Implementations§

Source§

impl<'a, const MPU_REGIONS: usize, I: InterruptService + 'a, CFG: EarlGreyConfig, PINMUX: EarlGreyPinmuxConfig, PMP: TORUserPMP<MPU_REGIONS> + Display + 'static> Chip for EarlGrey<'a, MPU_REGIONS, I, CFG, PINMUX, PMP>

Source§

type MPU = PMPUserMPU<MPU_REGIONS, PMP>

The particular Memory Protection Unit (MPU) for this chip.
Source§

type UserspaceKernelBoundary = SysCall

The implementation of the interface between userspace and the kernel for this specific chip. Likely this is architecture specific, but individual chips may have various custom requirements.
Source§

fn mpu(&self) -> &Self::MPU

Returns a reference to the implementation for the MPU on this chip.
Source§

fn userspace_kernel_boundary(&self) -> &SysCall

Returns a reference to the implementation for the interface between userspace and kernelspace.
Source§

fn service_pending_interrupts(&self)

The kernel calls this function to tell the chip to check for all pending interrupts and to correctly dispatch them to the peripheral drivers for the chip. Read more
Source§

fn has_pending_interrupts(&self) -> bool

Ask the chip to check if there are any pending interrupts.
Source§

fn sleep(&self)

Called when there is nothing left for the chip to do and it should enter a low power sleep state. This low power sleep state should allow interrupts to still be active so that the next interrupt event wakes the chip and resumes the scheduler.
Source§

unsafe fn atomic<F, R>(&self, f: F) -> R
where F: FnOnce() -> R,

Run a function in an atomic state, which means that interrupts are disabled so that an interrupt will not fire during the passed in function’s execution.
Source§

unsafe fn print_state(&self, writer: &mut dyn Write)

Print out chip state (system registers) to a supplied writer. This does not print out the execution context (data registers), as this depends on how they are stored; that is implemented by syscall::UserspaceKernelBoundary::print_context. This also does not print out a process memory state, that is implemented by process::Process::print_memory_map. The MPU state is printed by the MPU’s implementation of the Display trait. Used by panic.

Auto Trait Implementations§

§

impl<'a, const MPU_REGIONS: usize, I, CFG, PINMUX, PMP> !Freeze for EarlGrey<'a, MPU_REGIONS, I, CFG, PINMUX, PMP>

§

impl<'a, const MPU_REGIONS: usize, I, CFG, PINMUX, PMP> !RefUnwindSafe for EarlGrey<'a, MPU_REGIONS, I, CFG, PINMUX, PMP>

§

impl<'a, const MPU_REGIONS: usize, I, CFG, PINMUX, PMP> !Send for EarlGrey<'a, MPU_REGIONS, I, CFG, PINMUX, PMP>

§

impl<'a, const MPU_REGIONS: usize, I, CFG, PINMUX, PMP> !Sync for EarlGrey<'a, MPU_REGIONS, I, CFG, PINMUX, PMP>

§

impl<'a, const MPU_REGIONS: usize, I, CFG, PINMUX, PMP> Unpin for EarlGrey<'a, MPU_REGIONS, I, CFG, PINMUX, PMP>
where PMP: Unpin, CFG: Unpin, PINMUX: Unpin,

§

impl<'a, const MPU_REGIONS: usize, I, CFG, PINMUX, PMP> !UnwindSafe for EarlGrey<'a, MPU_REGIONS, I, CFG, PINMUX, PMP>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.