Skip to main content

javm_cap/
layout.rs

1//! PVM2 guest virtual-address-space layout (ABI constants).
2//!
3//! These are re-exports of [`nub_program::abi`], which owns them: they
4//! are PVM2 ISA/ABI facts, not capability facts, and every producer and
5//! consumer of a PVM2 program must agree on them whether or not a
6//! capability system is involved.
7//!
8//! They remain re-exported here because `javm_cap::layout::DATA_BASE`
9//! is the spelling used across the JAVM runtimes, and because an Image
10//! is laid out against exactly these constants:
11//!
12//! ```text
13//!   [0,         CODE_BASE)  unmapped — NULL guard (catch PC=0 / null deref)
14//!   [CODE_BASE, DATA_BASE)  CODE     — RO, ≤ MAX_CODE_SIZE bytes
15//!   [DATA_BASE, 4 GiB)      DATA     — stack / ro / rw / heap, RO|RW
16//! ```
17//!
18//! Code placement is a fixed protocol constant rather than an
19//! Image-supplied mapping entry: an untrusted Image must not get to
20//! choose where its code lands.
21
22pub use nub_program::abi::{CODE_BASE, DATA_BASE, MAX_CODE_SIZE};