mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 11:48:32 +00:00
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:
@@ -5,6 +5,7 @@
|
||||
#include <AK/Types.h>
|
||||
#include <Kernel/Arch/i386/CPU.h>
|
||||
#include <Kernel/Arch/i386/PIT.h>
|
||||
#include <Kernel/Console.h>
|
||||
#include <Kernel/Devices/NullDevice.h>
|
||||
#include <Kernel/Devices/RandomDevice.h>
|
||||
#include <Kernel/FileSystem/Custody.h>
|
||||
@@ -3196,3 +3197,26 @@ int Process::sys$clock_nanosleep(const Syscall::SC_clock_nanosleep_params* param
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
int Process::sys$sync()
|
||||
{
|
||||
VFS::the().sync();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Process::sys$putch(char ch)
|
||||
{
|
||||
Console::the().put_char(ch);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Process::sys$yield()
|
||||
{
|
||||
return Scheduler::yield();
|
||||
}
|
||||
|
||||
int Process::sys$beep()
|
||||
{
|
||||
Scheduler::beep();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user