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:
@@ -121,7 +121,7 @@ namespace IDT
|
||||
if (tid && Kernel::Thread::current().is_userspace() && !Kernel::Thread::current().is_in_syscall())
|
||||
{
|
||||
auto message = BAN::String::formatted("{}, aborting\n", isr_exceptions[isr]);
|
||||
(void)Kernel::Process::current().write(STDERR_FILENO, message.data(), message.size());
|
||||
(void)Kernel::Process::current().sys_write(STDERR_FILENO, message.data(), message.size());
|
||||
asm volatile("sti");
|
||||
Kernel::Process::current().exit(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user