Kernel: Rework syscall calling

I removed the intermediate function when calling syscalls. Now syscall
handler calls the current process automatically. Only exception is
sys_fork, since it needs a assembly trampoline for the new thread.
This commit is contained in:
Bananymous
2023-06-12 14:16:48 +03:00
parent 2253c45feb
commit 23543b15ca
6 changed files with 200 additions and 399 deletions

View File

@@ -62,11 +62,11 @@ namespace Kernel
s_input_process = Process::create_kernel(
[](void*)
{
int fd = MUST(Process::current().open("/dev/input0"sv, O_RDONLY));
int fd = MUST(Process::current().sys_open("/dev/input0"sv, O_RDONLY));
while (true)
{
Input::KeyEvent event;
ASSERT(MUST(Process::current().read(fd, &event, sizeof(event))) == sizeof(event));
ASSERT(MUST(Process::current().sys_read(fd, &event, sizeof(event))) == sizeof(event));
TTY::current()->on_key(event);
}
}, nullptr