Skip to content

Commit

Permalink
syscall: Update and move list
Browse files Browse the repository at this point in the history
  • Loading branch information
marv7000 committed Feb 21, 2025
1 parent 6a393fd commit 620c524
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 79 deletions.
76 changes: 0 additions & 76 deletions include/menix/syscall/syscall_list.h

This file was deleted.

72 changes: 72 additions & 0 deletions include/uapi/syscall_list.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// A global list of all system calls available.

#ifndef SYSCALL
#define SYSCALL(num, name)
#endif

SYSCALL(0, exit)
SYSCALL(1, sigprocmask)
SYSCALL(2, sigsuspend)
SYSCALL(3, sigpending)
SYSCALL(4, sigaction)
SYSCALL(5, sigreturn)
SYSCALL(6, sigtimedwait)
SYSCALL(7, mmap)
SYSCALL(8, munmap)
SYSCALL(9, mremap)
SYSCALL(10, mprotect)
SYSCALL(11, execve)
SYSCALL(12, fork)
SYSCALL(13, kill)
SYSCALL(14, gettid)
SYSCALL(15, getpid)
SYSCALL(16, waitpid)
SYSCALL(17, read)
SYSCALL(18, write)
SYSCALL(19, seek)
SYSCALL(20, ioctl)
SYSCALL(21, openat)
SYSCALL(22, close)
SYSCALL(23, stat)
SYSCALL(24, faccessat)
SYSCALL(25, fcntl)
SYSCALL(26, readdir)
SYSCALL(27, getcwd)
SYSCALL(28, chdir)
SYSCALL(29, fchdir)
SYSCALL(30, mkdirat)
SYSCALL(31, rename)
SYSCALL(32, chmodat)
SYSCALL(33, chownat)
SYSCALL(34, linkat)
SYSCALL(35, unlinkat)
SYSCALL(36, readlinkat)
SYSCALL(37, mount)
SYSCALL(38, unmount)
SYSCALL(39, setuid)
SYSCALL(40, getuid)
SYSCALL(41, setgid)
SYSCALL(42, getgid)
SYSCALL(43, umask)
SYSCALL(44, poll)
SYSCALL(45, isatty)
SYSCALL(46, chroot)
SYSCALL(47, futex_wait)
SYSCALL(48, futex_wake)
SYSCALL(49, socket)
SYSCALL(50, socketpair)
SYSCALL(51, bind)
SYSCALL(52, connect)
SYSCALL(53, accept)
SYSCALL(54, listen)
SYSCALL(55, getpeername)
SYSCALL(56, getsockname)
SYSCALL(57, getsockopt)
SYSCALL(58, setsockopt)
SYSCALL(59, recvmsg)
SYSCALL(60, sendmsg)
SYSCALL(61, sethostname)
SYSCALL(62, uname)
SYSCALL(63, archctl)
SYSCALL(64, readtimer)
SYSCALL(65, savetls)
1 change: 1 addition & 0 deletions kernel/syscall/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,4 @@ SYSCALL_STUB(sigtimedwait)

SYSCALL_STUB(futex_wait)
SYSCALL_STUB(futex_wake)
SYSCALL_STUB(gettid)
7 changes: 4 additions & 3 deletions kernel/syscall/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
// Include the syscalls once.
#undef SYSCALL
#define SYSCALL(num, name) SyscallResult syscall_##name(usize a0, usize a1, usize a2, usize a3, usize a4, usize a5);
#include <menix/syscall/syscall_list.h>
#include <uapi/syscall_list.h>
#undef SYSCALL

typedef struct
{
Expand All @@ -19,9 +20,9 @@ typedef struct

static const SyscallTable syscall_table[] = {
// Include them again, but now as table entry.
#undef SYSCALL
#define SYSCALL(num, name) [num] = {.func = (SyscallFn)syscall_##name, .func_name = #name},
#include <menix/syscall/syscall_list.h>
#include <uapi/syscall_list.h>
#undef SYSCALL
};

SyscallResult syscall_invoke(usize num, usize a0, usize a1, usize a2, usize a3, usize a4, usize a5)
Expand Down
3 changes: 3 additions & 0 deletions kernel/syscall/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ SYSCALL_IMPL(archctl, usize operation, usize arg0, usize arg1)

// Performs power control operations.
SYSCALL_STUB(powerctl, usize operation, usize arg0, usize arg1)

SYSCALL_STUB(readtimer)
SYSCALL_STUB(savetls, VirtAddr addr)
1 change: 1 addition & 0 deletions kernel/system/uapi/uapi
Submodule uapi added at 1d9acc
1 change: 1 addition & 0 deletions modules/gpu/udrm/udrm
Submodule udrm added at eaf661

0 comments on commit 620c524

Please sign in to comment.