File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 11
11
#include <stdbool.h>
12
12
#include <kernel/sched.h>
13
13
14
- #define MAX_SYSCALL 37 // for now
14
+ #define MAX_SYSCALL 43
15
15
16
16
typedef struct SyscallRequest {
17
17
bool busy , queued , unblock ;
Original file line number Diff line number Diff line change 13
13
#include <kernel/socket.h>
14
14
#include <kernel/syscalls.h>
15
15
#include <kernel/logger.h>
16
+ #include <kernel/memory.h>
16
17
17
18
/* This is the dispatcher for system calls, many of which need a wrapper for
18
19
* their behavior. This ensures the exposed functionality is always as close
@@ -200,6 +201,13 @@ void syscallDispatchSend(SyscallRequest *req) {
200
201
}
201
202
}
202
203
204
+ /* Group 4: Memory Management */
205
+
206
+ void syscallDispatchSBrk (SyscallRequest * req ) {
207
+ req -> ret = (uint64_t ) sbrk (req -> thread , (intptr_t ) req -> params [0 ]);
208
+ req -> unblock = true;
209
+ }
210
+
203
211
void (* syscallDispatchTable [])(SyscallRequest * ) = {
204
212
/* group 1: scheduler functions */
205
213
syscallDispatchExit , // 0 - exit()
@@ -244,4 +252,12 @@ void (*syscallDispatchTable[])(SyscallRequest *) = {
244
252
syscallDispatchAccept , // 35 - accept()
245
253
syscallDispatchRecv , // 36 - recv()
246
254
syscallDispatchSend , // 37 - send()
255
+ NULL , // 38 - kill()
256
+
257
+ /* group 4: memory management */
258
+ syscallDispatchSBrk , // 39 - sbrk()
259
+ NULL , // 40 - mmap()
260
+ NULL , // 41 - munmap()
261
+ NULL , // 42 - mlock()
262
+ NULL , // 43 - munlock()
247
263
};
You can’t perform that action at this time.
0 commit comments