#[repr(C)]pub struct EndpointDescriptor {
pub fn_ptr: fn(u64) -> u64,
pub index: u8,
pub arg_registers: u8,
pub arg_meta: u8,
pub _pad: [u8; 5],
}Expand description
Descriptor written into the .nub.endpoints ELF section by the
endpoint attribute macro. nub-linker reads this section at
link time and turns each record into a
nub_program::ProgramBlob::endpoints entry.
Layout is #[repr(C)] so the linker can decode the section as a
flat array of fixed-size records. On RISC-V64 the function pointer
occupies 8 bytes, followed by 8 bytes of metadata, for a total
stride of 16 bytes.
Fields§
§fn_ptr: fn(u64) -> u64RISC-V address of the endpoint function. The linker maps this to a PVM PC via its instruction-mapping table.
index: u8Endpoint index (key in the program’s endpoints map).
arg_registers: u8Number of register args the caller supplies.
arg_meta: u8Opaque metadata byte, passed through to
nub_program::Endpoint::arg_meta. nub does not interpret it; a
personality may (JAVM reads it as the arg-cnode size).
_pad: [u8; 5]Reserved for alignment / future expansion.