Plic

Struct Plic 

Source
pub struct Plic {
    base: usize,
    manager: SpinLock<IrqManager>,
}
Expand description

Platform Level Interrupt Controller (PLIC) 结构体

Fields§

§base: usize§manager: SpinLock<IrqManager>

Trait Implementations§

Source§

impl Driver for Plic

Source§

fn try_handle_interrupt(&self, _irq: Option<usize>) -> bool

处理中断

§参数:
  • irq - 可选的中断号
§返回值

如果中断被处理则返回 true,否则返回 false

Source§

fn device_type(&self) -> DeviceType

返回设备类型

§返回值

设备类型枚举值

Source§

fn get_id(&self) -> String

获取设备唯一标识符

§返回值

设备标识符字符串

Source§

fn as_net(&self) -> Option<&dyn NetDevice>

将驱动程序转换为网络驱动程序(如果适用)
Source§

fn as_net_arc(self: Arc<Self>) -> Option<Arc<dyn NetDevice>>

将驱动程序转换为网络驱动程序 Arc(如果适用)
Source§

fn as_block(&self) -> Option<&dyn BlockDriver>

将驱动程序转换为块设备驱动程序(如果适用)
Source§

fn as_block_arc(self: Arc<Self>) -> Option<Arc<dyn BlockDriver>>

将驱动程序转换为块设备驱动程序 Arc(如果适用)
Source§

fn as_rtc(&self) -> Option<&dyn RtcDriver>

将驱动程序转换为实时时钟驱动程序(如果适用)
Source§

fn as_rtc_arc(self: Arc<Self>) -> Option<Arc<dyn RtcDriver>>

将驱动程序转换为实时时钟驱动程序 Arc(如果适用)
Source§

fn as_serial(&self) -> Option<&dyn SerialDriver>

将驱动程序转换为串口驱动程序(如果适用)
Source§

impl IntcDriver for Plic

Source§

fn register_local_irq(&self, irq: usize, driver: Arc<dyn Driver>)

注册本地中断处理程序

§参数:
  • irq - 中断号
  • driver - 要注册的驱动程序

Auto Trait Implementations§

§

impl !Freeze for Plic

§

impl !RefUnwindSafe for Plic

§

impl Send for Plic

§

impl Sync for Plic

§

impl Unpin for Plic

§

impl !UnwindSafe for Plic

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.