proc: enter into userspace
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
1a8061e3b3
commit
cd916f624b
12 changed files with 138 additions and 29 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue