[zion] POC for defining syscalls using macros

This commit is contained in:
Drew Galbraith 2023-06-20 13:43:12 -07:00
parent 4fef54084f
commit 5fc7296b20
5 changed files with 36 additions and 32 deletions

View file

@ -19,10 +19,6 @@ z_err_t SysCall1(uint64_t number, const void* first) {
return SysCall2(number, first, 0);
}
void ZProcessExit(uint64_t code) {
SysCall1(Z_PROCESS_EXIT, reinterpret_cast<void*>(code));
}
z_err_t ZProcessSpawn(z_cap_t proc_cap, z_cap_t bootstrap_cap,
z_cap_t* new_proc_cap, z_cap_t* new_vmas_cap,
z_cap_t* new_bootstrap_cap) {
@ -38,16 +34,6 @@ z_err_t ZProcessSpawn(z_cap_t proc_cap, z_cap_t bootstrap_cap,
return ret;
}
z_err_t ZThreadCreate(z_cap_t proc_cap, z_cap_t* thread_cap) {
ZThreadCreateReq req{
.proc_cap = proc_cap,
};
ZThreadCreateResp resp;
z_err_t ret = SysCall2(Z_THREAD_CREATE, &req, &resp);
*thread_cap = resp.thread_cap;
return ret;
}
z_err_t ZThreadStart(z_cap_t thread_cap, uint64_t entry, uint64_t arg1,
uint64_t arg2) {
ZThreadStartReq req{