Kernel: Use a lookup table for syscalls

Instead of the big ugly switch statement, build a lookup table using
the syscall enumeration macro.

This greatly simplifies the syscall implementation. :^)
This commit is contained in:
Andreas Kling
2019-11-09 22:18:16 +01:00
parent 874ebbe4a5
commit fbeb1ab15b
5 changed files with 69 additions and 277 deletions

View File

@@ -307,7 +307,7 @@ extern "C" [[noreturn]] void init(u32 physical_address_for_kernel_page_tables)
Process::create_kernel_process("init_stage2", init_stage2);
Process::create_kernel_process("syncd", [] {
for (;;) {
Syscall::sync();
VFS::the().sync();
current->sleep(1 * TICKS_PER_SECOND);
}
});