6 #ifndef SHOULD_DEFINE_SYSCALLS 7 #define SYSCALL_0(id, name, return_type) \ 9 #define SYSCALL_1(id, name, return_type, type1) \ 10 return_type name(type1 ebx) 11 #define SYSCALL_2(id, name, return_type, type1, type2) \ 12 return_type name(type1 ebx, type2 ecx) 13 #define SYSCALL_3(id, name, return_type, type1, type2, type3) \ 14 return_type name(type1 ebx, type2 ecx, type3 edx) 15 #define SYSCALL_4(id, name, return_type, type1, type2, type3, type4) \ 16 return_type name(type1 ebx, type2 ecx, type3 edx, type4 esi) 17 #define SYSCALL_5(id, name, return_type, type1, type2, type3, type4, type5) \ 18 return_type name(type1 ebx, type2 ecx, type3 edx, type4 esi, type5 edi) 21 #define SYSCALL_NUMBER 32 24 SYSCALL_EXIT, SYSCALL_GETPID, SYSCALL_IO_PUTCHAR, SYSCALL_IO_ATTR
28 SYSCALL_1(SYSCALL_EXIT, sys_exit, uint32_t, uint32_t);
29 SYSCALL_0(SYSCALL_GETPID, sys_getpid, uint32_t);
30 SYSCALL_1(SYSCALL_IO_PUTCHAR, sys_io_putchar, uint16_t, uint8_t);
31 SYSCALL_1(SYSCALL_IO_ATTR, sys_io_attr, uint8_t, uint8_t);
33 #undef SHOULD_DEFINE_SYSCALLS