proc: enter into userspace

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-07-19 19:25:38 -04:00
commit cd916f624b
12 changed files with 138 additions and 29 deletions

View file

@ -12,3 +12,27 @@ syscall_t get_syscall(u64 no)
return syscalls[no];
}
int syscall_insert(syscall_t fun, u64 no)
{
if (no >= ARRAY_SIZE(syscalls))
return -EINVAL;
if (syscalls[no])
return -EEXIST;
syscalls[no] = fun;
return no;
}
int syscall_remove(u64 no)
{
if (no >= ARRAY_SIZE(syscalls))
return -EINVAL;
if (!syscalls[no])
return -ENOENT;
syscalls[no] = NULL;
return 0;
}