kernel::ipc

Struct IPC

Source
pub struct IPC<const NUM_PROCS: u8> { /* private fields */ }
Expand description

The IPC mechanism struct.

Implementations§

Source§

impl<const NUM_PROCS: u8> IPC<NUM_PROCS>

Source

pub fn new( kernel: &'static Kernel, driver_num: usize, capability: &dyn MemoryAllocationCapability, ) -> Self

Trait Implementations§

Source§

impl<const NUM_PROCS: u8> SyscallDriver for IPC<NUM_PROCS>

Source§

fn command( &self, command_number: usize, target_id: usize, _: usize, processid: ProcessId, ) -> CommandReturn

command is how notify() is implemented. Notifying an IPC service is done by setting client_or_svc to 0, and notifying an IPC client is done by setting client_or_svc to 1. In either case, the target_id is the same number as provided in a notify upcall or as returned by allow.

Returns INVAL if the other process doesn’t exist. Initiates a service discovery or notifies a client or service.

§command_num
  • 0: Driver existence check, always returns Ok(())
  • 1: Perform discovery on the package name passed to allow_readonly. Returns the service descriptor if the service is found, otherwise returns an error.
  • 2: Notify a service previously discovered to have the service descriptor in target_id. Returns an error if target_id refers to an invalid service or the notify fails to enqueue.
  • 3: Notify a client with descriptor target_id, typically in response to a previous notify from the client. Returns an error if target_id refers to an invalid client or the notify fails to enqueue.
Source§

fn allocate_grant(&self, processid: ProcessId) -> Result<(), Error>

Request to allocate a capsule’s grant for a specific process. Read more
Source§

fn allow_userspace_readable( &self, app: ProcessId, which: usize, slice: UserspaceReadableProcessBuffer, ) -> Result<UserspaceReadableProcessBuffer, (UserspaceReadableProcessBuffer, ErrorCode)>

System call for a process to pass a buffer (a UserspaceReadableProcessBuffer) to the kernel that the kernel can either read or write. The kernel calls this method only after it checks that the entire buffer is within memory the process can both read and write. Read more

Auto Trait Implementations§

§

impl<const NUM_PROCS: u8> Freeze for IPC<NUM_PROCS>

§

impl<const NUM_PROCS: u8> !RefUnwindSafe for IPC<NUM_PROCS>

§

impl<const NUM_PROCS: u8> !Send for IPC<NUM_PROCS>

§

impl<const NUM_PROCS: u8> !Sync for IPC<NUM_PROCS>

§

impl<const NUM_PROCS: u8> Unpin for IPC<NUM_PROCS>

§

impl<const NUM_PROCS: u8> !UnwindSafe for IPC<NUM_PROCS>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 T
where U: Into<T>,

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.