Expand description
Procedural macros for declaring subsoil guest endpoints.
The #[subsoil::endpoint(N)] attribute marks a function as
endpoint N of a JAR chain Image. The macro emits three items
into the guest crate:
- The function definition itself, unchanged.
- A per-endpoint trampoline
__subsoil_ep_N_trampolinein.textthat calls the user function, then halts the VM via a REPLY ecall (li t0, 0; ecall). The trampoline lives in regular code; the kernel enters it atendpoints[N].entry_pc. - A
subsoil::EndpointDescriptorstatic in the.subsoil.endpointsELF section whosefn_ptrpoints at the trampoline (not the user fn). The transpiler reads the section at link time and resolves eachfn_ptrto a PVM PC.
ⓘ
#[subsoil::endpoint(0)]
fn process(args_len: u64) -> u64 { ... }On host targets the macro emits only the function definition;
the trampoline and descriptor are gated behind
cfg(all(target_env = "javm", target_os = "none")).
Attribute Macros§
- endpoint
- Mark a function as endpoint
Nof a JAR chain Image.