pub struct Cap<T: CapType, C = NoExplicitInvocationContext> { /* private fields */ }
Expand description
A capability pointer to be resolved in the current CSpace.
- The
T
parameter is aCapType
marking the type of the pointed-to capability. - The
C
parameter is a strategy for discovering the current thread’s IPC buffer. When the"state"
feature is enabled,NoExplicitInvocationContext
is an alias forImplicitInvocationContext
, which uses theIpcBuffer
set byset_ipc_buffer
. Otherwise, it is an alias forNoInvocationContext
, which does not implementInvocationContext
. In such cases, thewith
method is used to specify an invocation context before the capability is invoked.
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<T: CapTypeForFrameObject, C: InvocationContext> Cap<T, C>
impl<T: CapTypeForFrameObject, C: InvocationContext> Cap<T, C>
Sourcepub fn frame_map(
self,
page_table: PageTable,
vaddr: usize,
rights: CapRights,
attrs: VmAttributes,
) -> Result<()>
pub fn frame_map( self, page_table: PageTable, vaddr: usize, rights: CapRights, attrs: VmAttributes, ) -> Result<()>
Corresponds to seL4_RISCV_Page_Map
.
Sourcepub fn frame_unmap(self) -> Result<()>
pub fn frame_unmap(self) -> Result<()>
Corresponds to seL4_RISCV_Page_Unmap
.
Sourcepub fn frame_get_address(self) -> Result<usize>
pub fn frame_get_address(self) -> Result<usize>
Corresponds to seL4_RISCV_Page_GetAddress
.
Source§impl<C: InvocationContext> Cap<PageTable, C>
impl<C: InvocationContext> Cap<PageTable, C>
pub fn page_table_map( self, vspace: PageTable, vaddr: usize, attr: VmAttributes, ) -> Result<()>
Source§impl<C: InvocationContext> Cap<UnspecifiedIntermediateTranslationTable, C>
impl<C: InvocationContext> Cap<UnspecifiedIntermediateTranslationTable, C>
pub fn generic_intermediate_translation_table_map( self, ty: TranslationTableObjectType, vspace: VSpace, vaddr: usize, attr: VmAttributes, ) -> Result<()>
Source§impl<C: InvocationContext> Cap<AsidControl, C>
impl<C: InvocationContext> Cap<AsidControl, C>
Sourcepub fn asid_control_make_pool(
self,
untyped: Untyped,
dst: &AbsoluteCPtr,
) -> Result<()>
pub fn asid_control_make_pool( self, untyped: Untyped, dst: &AbsoluteCPtr, ) -> Result<()>
Corresponds to seL4_RISCV_ASIDControl_MakePool
.
Source§impl<C: InvocationContext> Cap<AsidPool, C>
impl<C: InvocationContext> Cap<AsidPool, C>
Sourcepub fn asid_pool_assign(self, vspace: PageTable) -> Result<()>
pub fn asid_pool_assign(self, vspace: PageTable) -> Result<()>
Corresponds to seL4_RISCV_ASIDPool_Assign
.
Source§impl<C> Cap<CNode, C>
impl<C> Cap<CNode, C>
Sourcepub fn absolute_cptr<T: HasCPtrWithDepth>(self, path: T) -> AbsoluteCPtr<C>
pub fn absolute_cptr<T: HasCPtrWithDepth>(self, path: T) -> AbsoluteCPtr<C>
Returns the AbsoluteCPtr
for path
in the context of self
.
Sourcepub fn absolute_cptr_from_bits_with_depth(
self,
bits: CPtrBits,
depth: usize,
) -> AbsoluteCPtr<C>
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
.
Sourcepub fn absolute_cptr_for_self(self) -> AbsoluteCPtr<C>
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>
impl<C: InvocationContext> Cap<Untyped, C>
Sourcepub fn untyped_retype(
self,
blueprint: &ObjectBlueprint,
dst: &AbsoluteCPtr,
dst_offset: usize,
num_objects: usize,
) -> Result<()>
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>
impl<C: InvocationContext> Cap<Tcb, C>
Sourcepub fn tcb_read_registers(
self,
suspend: bool,
count: Word,
) -> Result<UserContext>
pub fn tcb_read_registers( self, suspend: bool, count: Word, ) -> Result<UserContext>
Corresponds to seL4_TCB_ReadRegisters
.
pub fn tcb_read_all_registers(self, suspend: bool) -> Result<UserContext>
Sourcepub fn tcb_write_registers(
self,
resume: bool,
count: Word,
regs: &mut UserContext,
) -> Result<()>
pub fn tcb_write_registers( self, resume: bool, count: Word, regs: &mut UserContext, ) -> Result<()>
Corresponds to seL4_TCB_WriteRegisters
.
pub fn tcb_write_all_registers( self, resume: bool, regs: &mut UserContext, ) -> Result<()>
Sourcepub fn tcb_resume(self) -> Result<()>
pub fn tcb_resume(self) -> Result<()>
Corresponds to seL4_TCB_Resume
.
Sourcepub fn tcb_suspend(self) -> Result<()>
pub fn tcb_suspend(self) -> Result<()>
Corresponds to seL4_TCB_Suspend
.
Sourcepub 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<()>
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
.
Sourcepub fn tcb_set_space(
self,
fault_ep: CPtr,
cspace_root: CNode,
cspace_root_data: CNodeCapData,
vspace_root: VSpace,
) -> Result<()>
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
.
Sourcepub fn tcb_set_sched_params(
self,
authority: Tcb,
mcp: Word,
priority: Word,
) -> Result<()>
pub fn tcb_set_sched_params( self, authority: Tcb, mcp: Word, priority: Word, ) -> Result<()>
Corresponds to seL4_TCB_SetSchedParams
.
Sourcepub fn tcb_set_tls_base(self, tls_base: Word) -> Result<()>
pub fn tcb_set_tls_base(self, tls_base: Word) -> Result<()>
Corresponds to seL4_TCB_SetTLSBase
.
Sourcepub fn tcb_bind_notification(self, notification: Notification) -> Result<()>
pub fn tcb_bind_notification(self, notification: Notification) -> Result<()>
Corresponds to seL4_TCB_BindNotification
.
Sourcepub fn tcb_unbind_notification(self) -> Result<()>
pub fn tcb_unbind_notification(self) -> Result<()>
Corresponds to seL4_TCB_UnbindNotification
.
Source§impl<C: InvocationContext> Cap<IrqControl, C>
impl<C: InvocationContext> Cap<IrqControl, C>
Sourcepub fn irq_control_get(self, irq: Word, dst: &AbsoluteCPtr) -> Result<()>
pub fn irq_control_get(self, irq: Word, dst: &AbsoluteCPtr) -> Result<()>
Corresponds to seL4_IRQControl_Get
.
Source§impl<C: InvocationContext> Cap<IrqHandler, C>
impl<C: InvocationContext> Cap<IrqHandler, C>
Sourcepub fn irq_handler_ack(self) -> Result<()>
pub fn irq_handler_ack(self) -> Result<()>
Corresponds to seL4_IRQHandler_Ack
.
Sourcepub fn irq_handler_set_notification(
self,
notification: Notification,
) -> Result<()>
pub fn irq_handler_set_notification( self, notification: Notification, ) -> Result<()>
Corresponds to seL4_IRQHandler_SetNotification
.
Sourcepub fn irq_handler_clear(self) -> Result<()>
pub fn irq_handler_clear(self) -> Result<()>
Corresponds to seL4_IRQHandler_Clear
.
Source§impl<C: InvocationContext> Cap<Endpoint, C>
impl<C: InvocationContext> Cap<Endpoint, C>
Sourcepub fn send(self, info: MessageInfo)
pub fn send(self, info: MessageInfo)
Corresponds to seL4_Send
.
Sourcepub fn nb_send(self, info: MessageInfo)
pub fn nb_send(self, info: MessageInfo)
Corresponds to seL4_NBSend
.
Sourcepub fn recv(
self,
reply_authority: impl ConveysReplyAuthority,
) -> (MessageInfo, Badge)
pub fn recv( self, reply_authority: impl ConveysReplyAuthority, ) -> (MessageInfo, Badge)
Corresponds to seL4_Recv
.
Sourcepub fn nb_recv(
self,
reply_authority: impl ConveysReplyAuthority,
) -> (MessageInfo, Badge)
pub fn nb_recv( self, reply_authority: impl ConveysReplyAuthority, ) -> (MessageInfo, Badge)
Corresponds to seL4_NBRecv
.
Sourcepub fn call(self, info: MessageInfo) -> MessageInfo
pub fn call(self, info: MessageInfo) -> MessageInfo
Corresponds to seL4_Call
.
Sourcepub fn reply_recv(
self,
info: MessageInfo,
reply_authority: impl ConveysReplyAuthority,
) -> (MessageInfo, Badge)
pub fn reply_recv( self, info: MessageInfo, reply_authority: impl ConveysReplyAuthority, ) -> (MessageInfo, Badge)
Corresponds to seL4_ReplyRecv
.
pub fn send_with_mrs<T: FastMessages>(self, info: MessageInfo, messages: T)
pub fn recv_with_mrs( self, reply_authority: impl ConveysReplyAuthority, ) -> RecvWithMRs
pub fn call_with_mrs<T: FastMessages>( self, info: MessageInfo, messages: T, ) -> CallWithMRs
Source§impl<C: InvocationContext> Cap<Notification, C>
impl<C: InvocationContext> Cap<Notification, C>
Source§impl<C: InvocationContext> Cap<Tcb, C>
impl<C: InvocationContext> Cap<Tcb, C>
Sourcepub fn debug_name(self, name: &[u8])
pub fn debug_name(self, name: &[u8])
Corresponds to seL4_DebugNameThread
.
Trait Implementations§
Source§impl<T: CapType, C> HasCPtrWithDepth for Cap<T, C>
impl<T: CapType, C> HasCPtrWithDepth for Cap<T, C>
Source§fn cptr_with_depth(self) -> CPtrWithDepth
fn cptr_with_depth(self) -> CPtrWithDepth
CPtrWithDepth
entailed by self
.Source§impl<T: Ord + CapType, C: Ord> Ord for Cap<T, C>
impl<T: Ord + CapType, C: Ord> Ord for Cap<T, C>
Source§impl<T: PartialOrd + CapType, C: PartialOrd> PartialOrd for Cap<T, C>
impl<T: PartialOrd + CapType, C: PartialOrd> PartialOrd for Cap<T, C>
impl<T: Copy + CapType, C: Copy> Copy for Cap<T, C>
impl<T: Eq + CapType, C: Eq> Eq for Cap<T, C>
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 Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)