Skip to content

Commit

Permalink
syscalls: avoid blocking accept() when not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
jewelcodes committed Oct 24, 2024
1 parent 97e97ae commit 02ef516
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/include/kernel/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/* IPC syscall indexes, this range will be used for immediate handling without
* waiting for the kernel thread to dispatch the syscall */
#define SYSCALL_ACCEPT 44 // accept()
#define SYSCALL_IPC_START 42 // bind()
#define SYSCALL_IPC_END 46 // send()

Expand Down
3 changes: 2 additions & 1 deletion src/syscalls/queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ void syscallHandle(void *ctx) {
// allow immediate handling of IPC syscalls without going through the
// syscall queue for performance
if((req->function >= SYSCALL_IPC_START && req->function <= SYSCALL_IPC_END) ||
(req->function >= SYSCALL_RW_START && req->function <= SYSCALL_RW_END)) {
(req->function >= SYSCALL_RW_START && req->function <= SYSCALL_RW_END) ||
(req->function == SYSCALL_ACCEPT)) {
setLocalSched(false);
syscallDispatchTable[req->function](req);

Expand Down

0 comments on commit 02ef516

Please sign in to comment.