pub struct SharedMemConfig {
pub length: u64,
pub uio: u32,
pub mtu: u32,
}Expand description
Shared-memory region layout for an IPC channel.
Injected as compile-time environment variables by the builder before invoking
cargo build. The physical base address is not carried here: the IPC
transport never resolves its region from the environment. Controller firmware
gets the base baked into its generated init code (via the lowered Address),
and the Linux application reaches the same memory through the UIO device
named by uio; so no side needs a CONSORTIUM_IPC_BASE.
Fields§
§length: u64Length of the region in bytes.
uio: u32UIO device index the Linux application mmaps to reach the same region.
mtu: u32Maximum transfer unit (payload bytes per slot) for the channel.
Implementations§
Sourcepub fn from_region(region: MemoryRegion, uio: u32, mtu: u32) -> Self
pub fn from_region(region: MemoryRegion, uio: u32, mtu: u32) -> Self
Builds a resolved config from a [[ipc.channel]] shared-memory region
plus the UIO index and MTU the lowering resolved.
Only the region’s length is carried; the physical base is resolved by
the generated code, not the environment (see the type docs). uio is the
AP-side UIO device index the Linux application mmaps (from LoweredIr’s
resolved ApAddress), and mtu is the channel MTU.
Sourcepub fn env_pairs(&self, prefix: &str) -> [(String, String); 3]
pub fn env_pairs(&self, prefix: &str) -> [(String, String); 3]
Environment variable suffixes used when the builder injects this config.
The builder emits CONSORTIUM_<PREFIX>_LENGTH, _UIO, and _MTU, where
<PREFIX> is IPC. Consuming crates read these with option_env! and
parse them in a const context. Numeric values are emitted as decimal
strings even when the source manifest used hexadecimal TOML literals.
Trait Implementations§
Source§fn clone(&self) -> SharedMemConfig
fn clone(&self) -> SharedMemConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.