Skip to content

Commit

Permalink
syscalls: update syscall table and add placeholders for link functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jewelcodes committed Jan 7, 2025
1 parent e8c6384 commit 31f5afe
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 37 deletions.
6 changes: 3 additions & 3 deletions src/include/kernel/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
#include <stdbool.h>
#include <kernel/sched.h>

#define MAX_SYSCALL 58
#define MAX_SYSCALL 60

/* IPC syscall indexes, this range will be used for immediate handling without
* waiting for the kernel thread to dispatch the syscall */
#define SYSCALL_IPC_START 42 // bind()
#define SYSCALL_IPC_END 46 // send()
#define SYSCALL_IPC_START 43 // bind()
#define SYSCALL_IPC_END 47 // send()
#define SYSCALL_RW_START 16 // read()
#define SYSCALL_RW_END 17 // write()
#define SYSCALL_LSEEK 20 // lseek()
Expand Down
70 changes: 36 additions & 34 deletions src/syscalls/dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,44 +692,46 @@ void (*syscallDispatchTable[])(SyscallRequest *) = {
syscallDispatchChmod, // 22 - chmod()
NULL, // 23 - link()
NULL, // 24 - unlink()
syscallDispatchUmask, // 25 - umask()
syscallDispatchMkdir, // 26 - mkdir()
NULL, // 27 - rmdir()
syscallDispatchUtime, // 28 - utime()
NULL, // 29 - chroot()
syscallDispatchChdir, // 30 - chdir()
syscallDispatchGetCWD, // 31 - getcwd()
syscallDispatchMount, // 32 - mount()
NULL, // 33 - umount()
syscallDispatchFcntl, // 34 - fcntl()
syscallDispatchOpendir, // 35 - opendir()
syscallDispatchClosedir, // 36 - closedir()
syscallDispatchReaddir, // 37 - readdir_r()
syscallDispatchSeekdir, // 38 - seekdir()
syscallDispatchTelldir, // 39 - telldir()
NULL, // 25 - symlink()
NULL, // 26 - readlink()
syscallDispatchUmask, // 27 - umask()
syscallDispatchMkdir, // 28 - mkdir()
syscallDispatchUtime, // 29 - utime()
NULL, // 30 - chroot()
syscallDispatchChdir, // 31 - chdir()
syscallDispatchGetCWD, // 32 - getcwd()
syscallDispatchMount, // 33 - mount()
NULL, // 34 - umount()
syscallDispatchFcntl, // 35 - fcntl()
syscallDispatchOpendir, // 36 - opendir()
syscallDispatchClosedir, // 37 - closedir()
syscallDispatchReaddir, // 38 - readdir_r()
syscallDispatchSeekdir, // 39 - seekdir()
syscallDispatchTelldir, // 40 - telldir()

/* group 3: interprocess communication */
syscallDispatchSocket, // 40 - socket()
syscallDispatchConnect, // 41 - connect()
syscallDispatchBind, // 42 - bind()
syscallDispatchListen, // 43 - listen()
syscallDispatchAccept, // 44 - accept()
syscallDispatchRecv, // 45 - recv()
syscallDispatchSend, // 46 - send()
syscallDispatchKill, // 47 - kill()
syscallDispatchSigAction, // 48 - sigaction()
syscallDispatchSigreturn, // 49 - sigreturn()
syscallDispatchSocket, // 41 - socket()
syscallDispatchConnect, // 42 - connect()
syscallDispatchBind, // 43 - bind()
syscallDispatchListen, // 44 - listen()
syscallDispatchAccept, // 45 - accept()
syscallDispatchRecv, // 46 - recv()
syscallDispatchSend, // 47 - send()
syscallDispatchKill, // 48 - kill()
syscallDispatchSigAction, // 49 - sigaction()
syscallDispatchSigreturn, // 50 - sigreturn()

/* group 4: memory management */
syscallDispatchSBrk, // 50 - sbrk()
syscallDispatchMmap, // 51 - mmap()
NULL, // 52 - munmap()
syscallDispatchSBrk, // 51 - sbrk()
syscallDispatchMmap, // 52 - mmap()
NULL, // 53 - munmap()
NULL, // 54 - msync()

/* group 5: driver I/O functions */
syscallDispatchIoperm, // 53 - ioperm()
syscallDispatchIRQ, // 54 - irq()
syscallDispatchIoctl, // 55 - ioctl()
syscallDispatchMMIO, // 56 - mmio()
syscallDispatchPContig, // 57 - pcontig()
syscallDispatchVToP, // 58 - vtop()
syscallDispatchIoperm, // 55 - ioperm()
syscallDispatchIRQ, // 56 - irq()
syscallDispatchIoctl, // 57 - ioctl()
syscallDispatchMMIO, // 58 - mmio()
syscallDispatchPContig, // 59 - pcontig()
syscallDispatchVToP, // 60 - vtop()
};

0 comments on commit 31f5afe

Please sign in to comment.