pub struct Pc<'a, const PR: u16 = RELOAD_1KHZ> {
pub com1: &'a SerialPort<'a>,
pub com2: &'a SerialPort<'a>,
pub com3: &'a SerialPort<'a>,
pub com4: &'a SerialPort<'a>,
pub pit: Pit<'a, PR>,
/* private fields */
}
Expand description
Representation of a generic PC platform.
This struct serves as an implementation of Tock’s Chip
trait for the x86 PC platform. The
behavior and set of peripherals available on PCs is very heavily standardized. As a result, this
chip definition should be broadly compatible with most PC hardware.
Parameter PR
is the PIT reload value. See Pit
for more information.
Fields§
§com1: &'a SerialPort<'a>
Legacy COM1 serial port
com2: &'a SerialPort<'a>
Legacy COM2 serial port
com3: &'a SerialPort<'a>
Legacy COM3 serial port
com4: &'a SerialPort<'a>
Legacy COM4 serial port
pit: Pit<'a, PR>
Legacy PIT timer
Trait Implementations§
Source§impl<'a, const PR: u16> Chip for Pc<'a, PR>
impl<'a, const PR: u16> Chip for Pc<'a, PR>
Source§type UserspaceKernelBoundary = Boundary
type UserspaceKernelBoundary = Boundary
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) -> &Self::UserspaceKernelBoundary
fn userspace_kernel_boundary(&self) -> &Self::UserspaceKernelBoundary
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, writer: &mut dyn Write)
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 PR: u16 = RELOAD_1KHZ> !Freeze for Pc<'a, PR>
impl<'a, const PR: u16 = RELOAD_1KHZ> !RefUnwindSafe for Pc<'a, PR>
impl<'a, const PR: u16 = RELOAD_1KHZ> !Send for Pc<'a, PR>
impl<'a, const PR: u16 = RELOAD_1KHZ> !Sync for Pc<'a, PR>
impl<'a, const PR: u16> Unpin for Pc<'a, PR>
impl<'a, const PR: u16 = RELOAD_1KHZ> !UnwindSafe for Pc<'a, PR>
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