Skip to main content

nub_arch_x86/
test_abi.rs

1//! FN_ID constants for personality-independent test/bench guest probes.
2//!
3//! Band policy: the nub substrate owns fn_id space `[0, 0x100)`
4//! (production ids in `nub-arch-x86-abi`, generic probes here); each
5//! personality owns `[0x100, ...)` in its own `test_abi` (e.g.
6//! `javm_guest_x86::test_abi`). The probes below are RPC-plumbing /
7//! allocator checks with no personality dependency — nub defines the
8//! id + contract; the personality's test/bench binaries host the
9//! registrations (only personality crates produce guest binaries).
10
11/// Smoke probe — returns 42u64 rkyv-encoded.
12pub const FN_ID_TEST_SMOKE: u32 = 100;
13
14/// Bench: allocate `N` × `Arc<Page>` where `Page` is a 4 KiB
15/// page-aligned block.
16///
17/// - Input: `u32` LE = `N`.
18/// - Output: `u64` LE = elapsed RDTSC cycles total. The host
19///   divides by `N` to get per-Arc cost.
20pub const FN_ID_BENCH_ARC_PAGE_ALLOC: u32 = 200;