Expand description
YieldSender / YieldReceiver kernel-assisted cap helpers + the reserved
kernel:* yield-key namespace.
A yield_key is a ≤MAX_KEY_LEN-byte
Key — the same byte-string key type used for cnode slots. It is the
routing key for host_yield: the kernel walks the call stack and the
nearest snapshotted YieldReceiver containing
the key catches the yield. Keys whose first byte is KERNEL_YIELD_NS are
reserved kernel:* syscalls, caught by the kernel as the implicit ROOT
YieldReceiver (bottom of the stack); chain/user yield_keys must not use that
namespace.
The two per-Instance kernel-assisted variants:
YieldSender{yield_key}— the EMIT right. The yield_key is packed into the handle’sregs[0..1](same packing asGas{meter_key}; seekey_to_regs).YieldReceiver{Set<Key>}— the CATCH right. The catch-set is serialized into the handle’smemDataCap so the kernel can short-circuit it during routing. Wire form:u16 countthen, per key,u8 len+lenbytes (the page-pad tail is ignored).
Constants§
- KERNEL_
YIELD_ NS - Namespace marker (first byte) of a reserved
kernel:*yield_key. - YK_
ATTEST kernel:attest— attestation request (§15).- YK_
MERGE_ YIELD_ RECEIVER kernel:merge_yield_receiver— union two YieldReceiver catch-sets.- YK_
MINT_ GAS kernel:mint_gas— mint aGas{meter_key}handle.- YK_
MINT_ QUOTA kernel:mint_quota— mint aQuota{quota_key}handle.- YK_
MINT_ YIELD kernel:mint_yield— mint a (YieldSender, YieldReceiver) pair for a key.- YK_OOG
kernel:oog— kernel-injected on gas exhaustion.- YK_
SET_ GAS_ METER kernel:set_gas_meter— set a meter, return previous.- YK_
SET_ STORAGE_ QUOTA kernel:set_storage_quota— set a quota, return previous.- YK_
STORAGE_ EXHAUSTED kernel:storage_exhausted— kernel-injected on quota exhaustion.
Functions§
- gas_
handle - Build a
Gas{meter_key}unit handle: aCap::Instancewith the well-known Gas image-hash chain and themeter_keypacked intoregs[0..1](same packing asyield_sender). The kernel reads these handles from an Instance’s orderedgas_slotsto index the gas-meter mapping; minted by thekernel:mint_gassyscall. - gas_
meter_ key - Read the
meter_keyfrom aGashandle.Noneifinstis not a Gas handle. - is_
kernel_ yield_ key - True iff
keyis in the reservedkernel:*namespace (caught by the kernel as the implicit root receiver). - merge_
yield_ receivers - Union the catch-sets of two
YieldReceiverhandles (thekernel:merge_yield_receiveroperation).Noneif either is not a YieldReceiver. - quota_
handle - Build a
Quota{quota_key}unit handle (storage-quota analogue ofgas_handle); minted by thekernel:mint_quotasyscall. - quota_
key - Read the
quota_keyfrom aQuotahandle.Noneifinstis not a Quota handle. - yield_
receiver - Build a
YieldReceiver{keys}unit handle: aCap::Instancewith the well-known YieldReceiver image-hash chain and the catch-set serialized into itsmemDataCap. The set is normalized (sorted, deduped). - yield_
receiver_ keys - Read the catch-set from a
YieldReceiverhandle (normalized: sorted, deduped).Noneifinstis not a YieldReceiver; an empty/short mem decodes to an empty set. - yield_
sender - Build a
YieldSender{yield_key}unit handle: aCap::Instancewith the well-known YieldSender image-hash chain and the yield_key packed intoregs[0..1]. - yield_
sender_ key - Read the
yield_keyfrom aYieldSenderhandle.Noneifinstis not a YieldSender.