[zion] Move the final syscalls to the new format.

This commit is contained in:
Drew Galbraith 2023-06-20 15:03:33 -07:00
parent bd431b94ce
commit 1edd5023ce
10 changed files with 45 additions and 52 deletions

View file

@ -0,0 +1,13 @@
#include "syscall/capability.h"
#include "scheduler/scheduler.h"
z_err_t CapDuplicate(ZCapDuplicateReq* req) {
auto& proc = gScheduler->CurrentProcess();
auto cap = proc.GetCapability(req->cap_in);
if (!cap) {
return Z_ERR_CAP_NOT_FOUND;
}
*req->cap_out = proc.AddExistingCapability(cap);
return Z_OK;
}