Skip to content

Commit

Permalink
syscalls: updated syscall dispatch table
Browse files Browse the repository at this point in the history
  • Loading branch information
jewelcodes committed Sep 25, 2024
1 parent c1a537c commit 52c12fb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 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 49
#define MAX_SYSCALL 51

/* IPC syscall indexes, these will be used for immediate handling without
* waiting for the queue */
#define SYSCALL_IPC_START 39 // recv()
#define SYSCALL_IPC_END 40 // send()
#define SYSCALL_IPC_START 43 // recv()
#define SYSCALL_IPC_END 44 // send()

#define SYSCALL_RW_START 16 // read()
#define SYSCALL_RW_END 17 // write()
Expand Down
36 changes: 19 additions & 17 deletions src/syscalls/dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,27 +436,29 @@ void (*syscallDispatchTable[])(SyscallRequest *) = {
syscallDispatchMount, // 30 - mount()
NULL, // 31 - umount()
NULL, // 32 - fnctl()
NULL, // 33 - isatty()
NULL, // 33 - opendir()
NULL, // 34 - closedir()
NULL, // 35 - readdir_r()
NULL, // 36 - seekdir()
NULL, // 37 - telldir()

/* group 3: interprocess communication */
syscallDispatchSocket, // 34 - socket()
syscallDispatchConnect, // 35 - connect()
syscallDispatchBind, // 36 - bind()
syscallDispatchListen, // 37 - listen()
syscallDispatchAccept, // 38 - accept()
syscallDispatchRecv, // 39 - recv()
syscallDispatchSend, // 40 - send()
NULL, // 41 - kill()
syscallDispatchSocket, // 38 - socket()
syscallDispatchConnect, // 39 - connect()
syscallDispatchBind, // 40 - bind()
syscallDispatchListen, // 41 - listen()
syscallDispatchAccept, // 42 - accept()
syscallDispatchRecv, // 43 - recv()
syscallDispatchSend, // 44 - send()
NULL, // 45 - kill()

/* group 4: memory management */
syscallDispatchSBrk, // 42 - sbrk()
NULL, // 43 - mmap()
NULL, // 44 - munmap()
NULL, // 45 - mlock()
NULL, // 46 - munlock()
syscallDispatchSBrk, // 46 - sbrk()
NULL, // 47 - mmap()
NULL, // 48 - munmap()

/* group 5: driver I/O functions */
syscallDispatchIoperm, // 47 - ioperm()
syscallDispatchIRQ, // 48 - irq()
syscallDispatchIoctl, // 49 - ioctl()
syscallDispatchIoperm, // 49 - ioperm()
syscallDispatchIRQ, // 50 - irq()
syscallDispatchIoctl, // 51 - ioctl()
};

0 comments on commit 52c12fb

Please sign in to comment.