diff options
Diffstat (limited to 'src/sys/os')
-rw-r--r-- | src/sys/os/os_proc.c | 19 | ||||
-rw-r--r-- | src/sys/os/os_syscall.c | 9 |
2 files changed, 22 insertions, 6 deletions
diff --git a/src/sys/os/os_proc.c b/src/sys/os/os_proc.c index 6880dda..329a3ea 100644 --- a/src/sys/os/os_proc.c +++ b/src/sys/os/os_proc.c @@ -41,13 +41,32 @@ static pid_t next_pid = 0; int proc_init(struct proc *procp, int flags) { + struct syscall_domain *scdp; + struct syscall_win *winp; int error; if (procp == NULL) { return -EINVAL; } + /* Put the process in a known state */ + scdp = &procp->scdom; memset(procp, 0, sizeof(*procp)); + + /* + * Initialize each platform latch + */ + for (platch_t p = 0; p < __SC_PLATCH_MAX; ++p) { + winp = &scdp->slots[p]; + switch (p) { + case SC_PLATCH_UNIX: + winp->p = 1; + winp->sctab = &g_unix_sctab[0]; + winp->nimpl = UNIX_SCTAB_LEN; + break; + } + } + procp->pid = atomic_inc_int(&next_pid); error = md_proc_init(procp, flags); return error; diff --git a/src/sys/os/os_syscall.c b/src/sys/os/os_syscall.c index 060f774..782bfb4 100644 --- a/src/sys/os/os_syscall.c +++ b/src/sys/os/os_syscall.c @@ -31,10 +31,7 @@ #include <sys/types.h> #include <sys/param.h> #include <sys/proc.h> +#define _NEED_UNIX_SCTAB +#include <compat/unix/syscall.h> -scret_t(*g_sctab[])(struct syscall_args *) = { - [SYS_none] = NULL, - [SYS_exit] = sys_exit -}; - -const size_t MAX_SYSCALLS = NELEM(g_sctab); +const size_t UNIX_SCTAB_LEN = NELEM(g_unix_sctab); |