Skip to main content
← PSoXide SDK guides and examples · SDK 80d1c329e977 · All Cargo features enabled; check feature gates before use.

PackedVeneer

Struct PackedVeneer 

Source
#[repr(C)]
pub struct PackedVeneer { pub code: [u32; 5], pub target: u32, }
Expand description

A resident jump veneer for one typed call site, built by the final-link packer (overlay-compose --veneers SYMBOL). The site’s J/JAL always targets the veneer; the veneer loads its own target word and jumps there. A lease writes the overlay’s entry into target and the trap back when it ends, so entering and leaving a lease are two data stores: the instruction cache is flushed only when an image is installed or replaced (Registry::install), never per call.

The five code words never change after the final link and are never written at run time, so the cache can hold them for good. The data load of target is not cached (the console’s data cache is the scratchpad).

Fields§

§code: [u32; 5]

lui t0, hi; lw t0, lo(t0); nop; jr t0; nop, addressing target absolutely.

§target: u32

Where the veneer jumps: the resident trap while no lease is live.

Implementations§

Source§

impl PackedVeneer

Source

pub const BYTES: u32 = 24

Size of one veneer, and the stride of a veneer table.

Source

pub const PLACEHOLDER: Self

Initial contents of a veneer table in resident .data; the packer overwrites every record it uses. Keep the table in .data (link_section), never .bss.

Source

pub const fn code_for(address: u32) -> [u32; 5]

The code words of the veneer stored at address. The pair lui/lw addresses the veneer’s own target word at address + 20; $t0 is a caller-saved temporary that no argument register or return value uses.

Source

pub const fn published(address: u32, trap: u32) -> Self

The veneer the packer publishes at address, trapping until a lease binds it.

Trait Implementations§

Source§

impl Clone for PackedVeneer

Source§

fn clone(&self) -> PackedVeneer

Returns a duplicate of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for PackedVeneer

Source§

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

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

impl PartialEq for PackedVeneer

Source§

fn eq(&self, other: &PackedVeneer) -> 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 Copy for PackedVeneer

Source§

impl Eq for PackedVeneer

Source§

impl StructuralPartialEq for PackedVeneer

Auto Trait Implementations§

§

impl Freeze for PackedVeneer

§

impl RefUnwindSafe for PackedVeneer

§

impl Send for PackedVeneer

§

impl Sync for PackedVeneer

§

impl Unpin for PackedVeneer

§

impl UnsafeUnpin for PackedVeneer

§

impl UnwindSafe for PackedVeneer

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, dest: *mut u8)

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