Struct aw_soc::PLIC

source ·
pub struct PLIC<A: BaseAddress> { /* private fields */ }
Expand description

Platform-Level Interrupt Controller.

Implementations§

source§

impl<const B: usize> PLIC<Static<B>>

source

pub const unsafe fn steal_static() -> PLIC<Static<B>>

Create a peripheral instance from statically known address.

This function is unsafe for it forces to seize ownership from possible wrapped peripheral group types. Users should normally retrieve ownership from wrapped types.

source§

impl PLIC<Dynamic>

source

pub unsafe fn steal_dynamic(base: *const ()) -> PLIC<Dynamic>

Create a peripheral instance from dynamically known address.

This function is unsafe for it forces to seize ownership from possible wrapped peripheral group types. Users should normally retrieve ownership from wrapped types.

Methods from Deref<Target = Plic>§

source

pub fn set_priority<S>(&self, source: S, value: u32)where S: InterruptSource,

Sets priority for interrupt source to value.

Write 0 to priority value effectively disables this interrupt source, for the priority value 0 is reserved for “never interrupt” by the PLIC specification.

The lowest active priority is priority 1. The maximum priority depends on PLIC implementation and can be detected with Plic::probe_priority_bits.

See §4.

source

pub fn get_priority<S>(&self, source: S) -> u32where S: InterruptSource,

Gets priority for interrupt source.

See §4.

source

pub fn probe_priority_bits<S>(&self, source: S) -> u32where S: InterruptSource,

Probe maximum level of priority for interrupt source.

See §4.

source

pub fn is_pending<S>(&self, source: S) -> boolwhere S: InterruptSource,

Check if interrupt source is pending.

See §5.

source

pub fn enable<S, C>(&self, source: S, context: C)where S: InterruptSource, C: HartContext,

Enable interrupt source in context.

See §6.

source

pub fn disable<S, C>(&self, source: S, context: C)where S: InterruptSource, C: HartContext,

Disable interrupt source in context.

See §6.

source

pub fn is_enabled<S, C>(&self, source: S, context: C) -> boolwhere S: InterruptSource, C: HartContext,

Check if interrupt source is enabled in context.

See §6.

source

pub fn get_threshold<C>(&self, context: C) -> u32where C: HartContext,

Get interrupt threshold in context.

See §7.

source

pub fn set_threshold<C>(&self, context: C, value: u32)where C: HartContext,

Set interrupt threshold for context to value.

See §7.

source

pub fn probe_threshold_bits<C>(&self, context: C) -> u32where C: HartContext,

Probe maximum supported threshold value the context supports.

See §7.

source

pub fn claim<C>(&self, context: C) -> Option<NonZeroU32>where C: HartContext,

Claim an interrupt in context, returning its source.

It is always legal for a hart to perform a claim even if EIP is not set. A hart could set threshold to maximum to disable interrupt notification, but it does not mean interrupt source has stopped to send interrupt signals. In this case, hart would instead poll for active interrupt by periodically calling the claim function.

See §8.

source

pub fn complete<C, S>(&self, context: C, source: S)where C: HartContext, S: InterruptSource,

Mark that interrupt identified by source is completed in context.

See §9.

Trait Implementations§

source§

impl<A: BaseAddress> Deref for PLIC<A>

§

type Target = Plic

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<A: BaseAddress> Send for PLIC<A>

Auto Trait Implementations§

§

impl<A> RefUnwindSafe for PLIC<A>where A: RefUnwindSafe,

§

impl<A> Sync for PLIC<A>where A: Sync,

§

impl<A> Unpin for PLIC<A>where A: Unpin,

§

impl<A> UnwindSafe for PLIC<A>where A: UnwindSafe,

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.