Struct sel4::Cap

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

A capability pointer in the current CSpace.

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( self, irq: Word, trigger: Word, 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 relative<T: HasCPtrWithDepth>(self, path: T) -> AbsoluteCPtr<C>

source

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

source

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

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, 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, sched_context: SchedContext, fault_ep: Endpoint ) -> Result<()>

Corresponds to seL4_TCB_SetSchedParams.

source

pub fn tcb_set_timeout_endpoint(self, timeout_endpoint: Endpoint) -> Result<()>

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<SchedControl, C>

source

pub fn sched_control_configure_flags( self, sched_context: SchedContext, budget: Time, period: Time, extra_refills: Word, badge: Badge, flags: Word ) -> Result<()>

Corresponds to seL4_SchedControl_ConfigureFlags.

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) -> (MessageInfo, Badge)

Corresponds to seL4_Wait.

source§

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

source

pub fn send(self, info: MessageInfo)

Corresponds to seL4_Send.

source§

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

source

pub fn nb_send_recv<U: IpcCapType>( self, info: MessageInfo, src: Cap<U>, reply_authority: impl ConveysReplyAuthority ) -> (MessageInfo, Badge)

Corresponds to seL4_NBSendRecv.

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§

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 + PartialOrd,

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

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

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

This method 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

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

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

This method 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

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

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

This method 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> 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.