Applications running in the crust can
(directly or indirectly)
invoke the services from the Mantle via the RISC-V ecall instruction.
To do this, input parameters are loaded into CPU registers
a0 through a6.
The particular service number is then loaded into a7,
and the ecall instruction issued.
When the service has been performed,
any results will be returned via a0 through a2.
(As of this writing,
no system call returns any values in a3 through a6.)
Unless otherwise documented,
registers not used for return values retain their previous value.
NOTE. The ECALL numbers in this list were compiled 2026 April 11. The Mantle software is still in flux! Always double-check the actual sources for current values.
Returns from an event handler up-call from the Mantle.
Event handlers are invoked with three parameters.
Register a0 holds the event type.
Register a1 holds a timestamp, providing an indication of when the event happened.
Register a2 holds a dword which is unique to the kind of event being processed.
To return from an event handler,
the application issues an ecNextEvent ecall.
Depending upon the nature of the event handler,
return values may be provided in registers a0-a2.
Unless documented otherwise,
unhandled events should always return with a0 set to zero.
Exits the application and the Kestrel-2/EX emulator.
Register a0 contains the POSIX-style result code.