pub struct ArtyExx<'a, I: InterruptService + 'a> { /* private fields */ }
Implementations§
Source§impl<'a, I: InterruptService + 'a> ArtyExx<'a, I>
impl<'a, I: InterruptService + 'a> ArtyExx<'a, I>
pub unsafe fn new( machinetimer: &'a ArtyExxClint<'a>, interrupt_service: &'a I, ) -> Self
pub fn enable_all_interrupts(&self)
Sourcepub unsafe fn disable_machine_timer(&self)
pub unsafe fn disable_machine_timer(&self)
By default the machine timer is enabled and will trigger interrupts. To prevent that we can make the compare register very large to effectively stop the interrupt from triggering, and then the machine timer can be used later as needed.
Sourcepub unsafe fn configure_trap_handler(&self)
pub unsafe fn configure_trap_handler(&self)
Setup the function that should run when a trap happens.
This needs to be chip specific because how the CLIC works is configured when the trap handler address is specified in mtvec, and that is only valid for platforms with a CLIC.
Sourcepub unsafe fn initialize(&self)
pub unsafe fn initialize(&self)
Generic helper initialize function to setup all of the chip specific
operations. Different boards can call the functions that initialize()
calls directly if it needs to use a custom setup operation.
Trait Implementations§
Source§impl<'a, I: InterruptService + 'a> Chip for ArtyExx<'a, I>
impl<'a, I: InterruptService + 'a> Chip for ArtyExx<'a, I>
Source§type MPU = PMPUserMPU<2, SimplePMP<4>>
type MPU = PMPUserMPU<2, SimplePMP<4>>
The particular Memory Protection Unit (MPU) for this chip.
Source§type UserspaceKernelBoundary = SysCall
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
fn mpu(&self) -> &Self::MPU
Returns a reference to the implementation for the MPU on this chip.
Source§fn userspace_kernel_boundary(&self) -> &SysCall
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)
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
fn has_pending_interrupts(&self) -> bool
Ask the chip to check if there are any pending interrupts.
Source§fn sleep(&self)
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) -> Rwhere
F: FnOnce() -> R,
unsafe fn atomic<F, R>(&self, f: F) -> Rwhere
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, write: &mut dyn Write)
unsafe fn print_state(&self, write: &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, I> !Freeze for ArtyExx<'a, I>
impl<'a, I> !RefUnwindSafe for ArtyExx<'a, I>
impl<'a, I> !Send for ArtyExx<'a, I>
impl<'a, I> !Sync for ArtyExx<'a, I>
impl<'a, I> Unpin for ArtyExx<'a, I>
impl<'a, I> !UnwindSafe for ArtyExx<'a, I>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more