Skip to main content

SpawnRequest

Struct SpawnRequest 

Source
#[repr(C)]
pub struct SpawnRequest {
Show 24 fields pub version: u32, pub flags: u32, pub image_ptr: u64, pub image_len: u64, pub name_ptr: u64, pub name_len: u32, pub core: u32, pub memory_limit: u64, pub privileges: u32, pub hw_flags: u32, pub mmio_base: u64, pub mmio_len: u64, pub dma_pages: u32, pub bdf: u32, pub irq_count: u32, pub irqs: [u8; 4], pub peers_ptr: u64, pub peers_len: u32, pub _pad: u32, pub installs_ptr: u64, pub installs_count: u32, pub _pad2: u32, pub probe_mode: u32, pub _pad3: u32,
}
Expand description

What a spawner tells the kernel about a task it wants started from an image IT supplies (SpawnImage, syscall 52). Layout must match the kernel’s SpawnRequest exactly.

Shaped for the end state, not for what the kernel honours today: the hardware and privilege fields are here because step D needs them, and a request that sets one is REFUSED loudly rather than silently ignored (docs/service-ownership.md).

Fields§

§version: u32§flags: u32§image_ptr: u64§image_len: u64§name_ptr: u64§name_len: u32§core: u32§memory_limit: u64§privileges: u32§hw_flags: u32§mmio_base: u64§mmio_len: u64§dma_pages: u32§bdf: u32§irq_count: u32§irqs: [u8; 4]§peers_ptr: u64§peers_len: u32§_pad: u32§installs_ptr: u64

Caller-provided caps to install into the child: [label_len][label][slot_lo][slot_hi] repeated. The same encoding SpawnWithCaps uses - one wire format, not two.

§installs_count: u32§_pad2: u32§probe_mode: u32

Mode selector. Named for probes, its first user, but general: observe reads it to choose one-shot / live / foreground, and takes the LIVE LOOP at 0.

§_pad3: u32

Implementations§

Source§

impl SpawnRequest

Source

pub fn new(image: &[u8], name: &str) -> Self

A request with everything the kernel does not yet honour left at zero.

Source

pub fn set_installs( &mut self, buf: &mut [u8], pairs: &[(&str, CapHandle)], ) -> bool

Encode (label, cap) pairs into buf and point this request at them.

The caller must hold each cap WITH GRANT: the kernel checks it, and that check is what makes installing them non-escalating (7.3) - a caller that can GRANT a cap could transfer it anyway.

Trait Implementations§

Source§

impl Clone for SpawnRequest

Source§

fn clone(&self) -> SpawnRequest

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for SpawnRequest

Auto Trait Implementations§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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