-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsyscalls.c
33 lines (27 loc) · 876 Bytes
/
syscalls.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "core/native.h"
#include "core/syscalls.h"
#include "platform/scheme/scheme.h"
NUMTYPE syscall_init(NUMTYPE section, NUMTYPE endmarker) {
switch(section) {
case 1: return endmarker == _SYS1_END;
case 2: return endmarker == _SYS2_END;
case 3: return endmarker == _SYS3_END;
case 4: return endmarker == _SYS4_END;
default: return 0;
}
}
NUMTYPE syscall1(NUMTYPE signal) {
return internal_syscall1(signal);
}
NUMTYPE syscall2(NUMTYPE signal, NUMTYPE arg1) {
return internal_syscall2(signal, arg1);
}
NUMTYPE syscall3(NUMTYPE signal, NUMTYPE arg1, NUMTYPE arg2) {
return internal_syscall3(signal, arg1, arg2);
}
NUMTYPE syscall4(NUMTYPE signal, NUMTYPE arg1, NUMTYPE arg2, NUMTYPE arg3) {
return internal_syscall4(signal, arg1, arg2, arg3);
}
NUMTYPE syscall_main(NUMTYPE argc, char **argv) {
return syscall3(SYS3_LISP_MAIN, argc, (NUMTYPE)argv);
}