sel4

Struct Cap

Source
pub struct Cap<T: CapType, C = NoExplicitInvocationContext> { /* private fields */ }
Expand description

A capability pointer to be resolved in the current CSpace.

The most general way to construct a Cap is with CPtr::cast.

Note that seL4_CNode_* capability invocations are methods of AbsoluteCPtr rather than Cap.

Implementations§

Source§

impl<C: InvocationContext> Cap<VCpu, C>

Source

pub fn vcpu_set_tcb(self, tcb: Tcb) -> Result<()>

Corresponds to seL4_ARM_VCPU_SetTCB.

Source

pub fn vcpu_read_regs(self, field: VCpuReg) -> Result<Word>

Corresponds to seL4_ARM_VCPU_ReadRegs.

Source

pub fn vcpu_write_regs(self, field: VCpuReg, value: Word) -> Result<()>

Corresponds to seL4_ARM_VCPU_WriteRegs.

Source

pub fn vcpu_ack_vppi(self, irq: Word) -> Result<()>

Corresponds to seL4_ARM_VCPU_AckVPPI.

Source

pub fn vcpu_inject_irq( self, virq: u16, priority: u8, group: u8, index: u8, ) -> Result<()>

Corresponds to seL4_ARM_VCPU_InjectIRQ.

Source§

impl<T: CapTypeForFrameObject, C: InvocationContext> Cap<T, C>

Source

pub fn frame_map( self, vspace: VSpace, vaddr: usize, rights: CapRights, attrs: VmAttributes, ) -> Result<()>

Corresponds to seL4_ARM_Page_Map.

Source

pub fn frame_unmap(self) -> Result<()>

Corresponds to seL4_ARM_Page_Unmap.

Source

pub fn frame_get_address(self) -> Result<usize>

Corresponds to seL4_ARM_Page_GetAddress.

Source§

impl<C: InvocationContext> Cap<PT, C>

Source

pub fn pt_map( self, vspace: VSpace, vaddr: usize, attr: VmAttributes, ) -> Result<()>

Source§

impl<C: InvocationContext> Cap<UnspecifiedIntermediateTranslationTable, C>

Source§

impl<C: InvocationContext> Cap<IrqControl, C>

Source

pub fn irq_control_get_trigger_core( self, irq: Word, edge_triggered: bool, target: Word, dst: &AbsoluteCPtr, ) -> Result<()>

Corresponds to seL4_IRQControl_GetTriggerCore.

Source

pub fn irq_control_get_trigger( self, irq: Word, edge_triggered: bool, dst: &AbsoluteCPtr, ) -> Result<()>

Corresponds to seL4_IRQControl_GetTrigger.

Source§

impl<C: InvocationContext> Cap<AsidControl, C>

Source

pub fn asid_control_make_pool( self, untyped: Untyped, dst: &AbsoluteCPtr, ) -> Result<()>

Corresponds to seL4_ARM_ASIDControl_MakePool.

Source§

impl<C: InvocationContext> Cap<AsidPool, C>

Source

pub fn asid_pool_assign(self, vspace: VSpace) -> Result<()>

Corresponds to seL4_ARM_ASIDPool_Assign.

Source§

impl<T: CapType, C> Cap<T, C>

Source

pub const fn cptr(&self) -> CPtr

Source

pub const fn bits(&self) -> CPtrBits

Source

pub fn cast<T1: CapType>(self) -> Cap<T1, C>

Source

pub fn with<C1>(self, context: C1) -> Cap<T, C1>

Source

pub fn without_context(self) -> Cap<T>

Source

pub fn into_invocation_context(self) -> C

Source§

impl<T: CapType> Cap<T>

Source

pub const fn from_cptr(cptr: CPtr) -> Self

Source

pub const fn from_bits(bits: CPtrBits) -> Self

Source§

impl<T: CapType, C> Cap<T, C>

Source

pub fn upcast(self) -> Unspecified<C>

Source§

impl<C> Cap<Unspecified, C>

Source

pub fn downcast<T: CapType>(self) -> Cap<T, C>

Source§

impl<C> Cap<CNode, C>

Source

pub fn absolute_cptr<T: HasCPtrWithDepth>(self, path: T) -> AbsoluteCPtr<C>

Returns the AbsoluteCPtr for path in the context of self.

Source

pub fn absolute_cptr_from_bits_with_depth( self, bits: CPtrBits, depth: usize, ) -> AbsoluteCPtr<C>

Returns the AbsoluteCPtr for CPtrWithDepth::from_bits_with_depth(bits, depth) in the context of self.

Source

pub fn absolute_cptr_for_self(self) -> AbsoluteCPtr<C>

Returns the AbsoluteCPtr for self in its own context.

Currently implemented as:

self.absolute_cptr(CPtrWithDepth::empty())
Source§

impl<C: InvocationContext> Cap<Untyped, C>

Source

pub fn untyped_retype( self, blueprint: &ObjectBlueprint, dst: &AbsoluteCPtr, dst_offset: usize, num_objects: usize, ) -> Result<()>

Corresponds to seL4_Untyped_Retype.

Source§

impl<C: InvocationContext> Cap<Tcb, C>

Source

pub fn tcb_read_registers( self, suspend: bool, count: Word, ) -> Result<UserContext>

Corresponds to seL4_TCB_ReadRegisters.

Source

pub fn tcb_read_all_registers(self, suspend: bool) -> Result<UserContext>

Source

pub fn tcb_write_registers( self, resume: bool, count: Word, regs: &mut UserContext, ) -> Result<()>

Corresponds to seL4_TCB_WriteRegisters.

Source

pub fn tcb_write_all_registers( self, resume: bool, regs: &mut UserContext, ) -> Result<()>

Source

pub fn tcb_resume(self) -> Result<()>

Corresponds to seL4_TCB_Resume.

Source

pub fn tcb_suspend(self) -> Result<()>

Corresponds to seL4_TCB_Suspend.

Source

pub fn tcb_configure( self, fault_ep: CPtr, cspace_root: CNode, cspace_root_data: CNodeCapData, vspace_root: VSpace, ipc_buffer: Word, ipc_buffer_frame: Granule, ) -> Result<()>

Corresponds to seL4_TCB_Configure.

Source

pub fn tcb_set_space( self, fault_ep: CPtr, cspace_root: CNode, cspace_root_data: CNodeCapData, vspace_root: VSpace, ) -> Result<()>

Corresponds to seL4_TCB_SetSpace.

Source

pub fn tcb_set_sched_params( self, authority: Tcb, mcp: Word, priority: Word, ) -> Result<()>

Corresponds to seL4_TCB_SetSchedParams.

Source

pub fn tcb_set_affinity(self, affinity: Word) -> Result<()>

Corresponds to seL4_TCB_SetAffinity.

Source

pub fn tcb_set_tls_base(self, tls_base: Word) -> Result<()>

Corresponds to seL4_TCB_SetTLSBase.

Source

pub fn tcb_bind_notification(self, notification: Notification) -> Result<()>

Corresponds to seL4_TCB_BindNotification.

Source

pub fn tcb_unbind_notification(self) -> Result<()>

Corresponds to seL4_TCB_UnbindNotification.

Source§

impl<C: InvocationContext> Cap<IrqControl, C>

Source

pub fn irq_control_get(self, irq: Word, dst: &AbsoluteCPtr) -> Result<()>

Corresponds to seL4_IRQControl_Get.

Source§

impl<C: InvocationContext> Cap<IrqHandler, C>

Source

pub fn irq_handler_ack(self) -> Result<()>

Corresponds to seL4_IRQHandler_Ack.

Source

pub fn irq_handler_set_notification( self, notification: Notification, ) -> Result<()>

Corresponds to seL4_IRQHandler_SetNotification.

Source

pub fn irq_handler_clear(self) -> Result<()>

Corresponds to seL4_IRQHandler_Clear.

Source§

impl<C: InvocationContext> Cap<Endpoint, C>

Source

pub fn send(self, info: MessageInfo)

Corresponds to seL4_Send.

Source

pub fn nb_send(self, info: MessageInfo)

Corresponds to seL4_NBSend.

Source

pub fn recv( self, reply_authority: impl ConveysReplyAuthority, ) -> (MessageInfo, Badge)

Corresponds to seL4_Recv.

Source

pub fn nb_recv( self, reply_authority: impl ConveysReplyAuthority, ) -> (MessageInfo, Badge)

Corresponds to seL4_NBRecv.

Source

pub fn call(self, info: MessageInfo) -> MessageInfo

Corresponds to seL4_Call.

Source

pub fn reply_recv( self, info: MessageInfo, reply_authority: impl ConveysReplyAuthority, ) -> (MessageInfo, Badge)

Corresponds to seL4_ReplyRecv.

Source

pub fn send_with_mrs<T: FastMessages>(self, info: MessageInfo, messages: T)

Source

pub fn recv_with_mrs( self, reply_authority: impl ConveysReplyAuthority, ) -> RecvWithMRs

Source

pub fn call_with_mrs<T: FastMessages>( self, info: MessageInfo, messages: T, ) -> CallWithMRs

Source§

impl<C: InvocationContext> Cap<Notification, C>

Source

pub fn signal(self)

Corresponds to seL4_Signal.

Source

pub fn wait(self) -> ((), Badge)

Corresponds to seL4_Wait.

Source§

impl<C: InvocationContext> Cap<Tcb, C>

Source

pub fn debug_name(self, name: &[u8])

Corresponds to seL4_DebugNameThread.

Source§

impl<T: CapType> Cap<T>

Source

pub fn debug_identify(self) -> u32

Corresponds to seL4_DebugCapIdentify.

Trait Implementations§

Source§

impl<T: Clone + CapType, C: Clone> Clone for Cap<T, C>

Source§

fn clone(&self) -> Cap<T, C>

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: CapType, C> Debug for Cap<T, C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: CapType, C> HasCPtrWithDepth for Cap<T, C>

Source§

fn cptr_with_depth(self) -> CPtrWithDepth

Returns the logical CPtrWithDepth entailed by self.
Source§

impl<T: Hash + CapType, C: Hash> Hash for Cap<T, C>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
Source§

impl<T: Ord + CapType, C: Ord> Ord for Cap<T, C>

Source§

fn cmp(&self, other: &Cap<T, C>) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<T: PartialEq + CapType, C: PartialEq> PartialEq for Cap<T, C>

Source§

fn eq(&self, other: &Cap<T, C>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: PartialOrd + CapType, C: PartialOrd> PartialOrd for Cap<T, C>

Source§

fn partial_cmp(&self, other: &Cap<T, C>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T: Copy + CapType, C: Copy> Copy for Cap<T, C>

Source§

impl<T: Eq + CapType, C: Eq> Eq for Cap<T, C>

Source§

impl<T: CapType, C> StructuralPartialEq for Cap<T, C>

Auto Trait Implementations§

§

impl<T, C> Freeze for Cap<T, C>
where C: Freeze,

§

impl<T, C> RefUnwindSafe for Cap<T, C>
where C: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, C> Send for Cap<T, C>
where C: Send, T: Send,

§

impl<T, C> Sync for Cap<T, C>
where C: Sync, T: Sync,

§

impl<T, C> Unpin for Cap<T, C>
where C: Unpin, T: Unpin,

§

impl<T, C> UnwindSafe for Cap<T, C>
where C: UnwindSafe, T: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.