diff --git a/Kernel/FileSystem/Inode.cpp b/Kernel/FileSystem/Inode.cpp index 0442dd0a0e..a31d4abd22 100644 --- a/Kernel/FileSystem/Inode.cpp +++ b/Kernel/FileSystem/Inode.cpp @@ -26,12 +26,12 @@ #include #include +#include #include #include +#include #include #include -#include -#include namespace Kernel { diff --git a/Kernel/Interrupts/IOAPIC.cpp b/Kernel/Interrupts/IOAPIC.cpp index 21700dc596..dca67b6ead 100644 --- a/Kernel/Interrupts/IOAPIC.cpp +++ b/Kernel/Interrupts/IOAPIC.cpp @@ -113,7 +113,6 @@ void IOAPIC::isa_identity_map(int index) configure_redirection_entry(index, index + IRQ_VECTOR_BASE, DeliveryMode::Normal, true, false, false, true, 1); } - void IOAPIC::map_pci_interrupts() { configure_redirection_entry(11, 11 + IRQ_VECTOR_BASE, DeliveryMode::Normal, false, false, true, true, 0); diff --git a/Kernel/Syscall.cpp b/Kernel/Syscall.cpp index f3eb90ef02..d008591b38 100644 --- a/Kernel/Syscall.cpp +++ b/Kernel/Syscall.cpp @@ -65,61 +65,61 @@ asm( namespace Syscall { -static int handle(RegisterState&, u32 function, u32 arg1, u32 arg2, u32 arg3); + static int handle(RegisterState&, u32 function, u32 arg1, u32 arg2, u32 arg3); -void initialize() -{ - register_user_callable_interrupt_handler(0x82, syscall_asm_entry); - klog() << "Syscall: int 0x82 handler installed"; -} + void initialize() + { + register_user_callable_interrupt_handler(0x82, syscall_asm_entry); + klog() << "Syscall: int 0x82 handler installed"; + } #pragma GCC diagnostic ignored "-Wcast-function-type" -typedef int (Process::*Handler)(u32, u32, u32); + typedef int (Process::*Handler)(u32, u32, u32); #define __ENUMERATE_REMOVED_SYSCALL(x) nullptr, #define __ENUMERATE_SYSCALL(x) reinterpret_cast(&Process::sys$##x), -static Handler s_syscall_table[] = { - ENUMERATE_SYSCALLS -}; + static Handler s_syscall_table[] = { + ENUMERATE_SYSCALLS + }; #undef __ENUMERATE_SYSCALL #undef __ENUMERATE_REMOVED_SYSCALL -int handle(RegisterState& regs, u32 function, u32 arg1, u32 arg2, u32 arg3) -{ - ASSERT_INTERRUPTS_ENABLED(); - auto& process = *Process::current; - Thread::current->did_syscall(); + int handle(RegisterState& regs, u32 function, u32 arg1, u32 arg2, u32 arg3) + { + ASSERT_INTERRUPTS_ENABLED(); + auto& process = *Process::current; + Thread::current->did_syscall(); - if (function == SC_exit || function == SC_exit_thread) { - // These syscalls need special handling since they never return to the caller. - cli(); - if (auto* tracer = process.tracer()) - tracer->did_syscall(function, arg1, arg2, arg3, 0); - if (function == SC_exit) - process.sys$exit((int)arg1); - else - process.sys$exit_thread((void*)arg1); - ASSERT_NOT_REACHED(); - return 0; + if (function == SC_exit || function == SC_exit_thread) { + // These syscalls need special handling since they never return to the caller. + cli(); + if (auto* tracer = process.tracer()) + tracer->did_syscall(function, arg1, arg2, arg3, 0); + if (function == SC_exit) + process.sys$exit((int)arg1); + else + process.sys$exit_thread((void*)arg1); + ASSERT_NOT_REACHED(); + return 0; + } + + if (function == SC_fork) + return process.sys$fork(regs); + + if (function == SC_sigreturn) + return process.sys$sigreturn(regs); + + if (function >= Function::__Count) { + dbg() << process << ": Unknown syscall %u requested (" << arg1 << ", " << arg2 << ", " << arg3 << ")"; + return -ENOSYS; + } + + if (s_syscall_table[function] == nullptr) { + dbg() << process << ": Null syscall " << function << " requested: \"" << to_string((Function)function) << "\", you probably need to rebuild this program."; + return -ENOSYS; + } + return (process.*(s_syscall_table[function]))(arg1, arg2, arg3); } - if (function == SC_fork) - return process.sys$fork(regs); - - if (function == SC_sigreturn) - return process.sys$sigreturn(regs); - - if (function >= Function::__Count) { - dbg() << process << ": Unknown syscall %u requested (" << arg1 << ", " << arg2 << ", " << arg3 << ")"; - return -ENOSYS; - } - - if (s_syscall_table[function] == nullptr) { - dbg() << process << ": Null syscall " << function << " requested: \"" << to_string((Function)function) << "\", you probably need to rebuild this program."; - return -ENOSYS; - } - return (process.*(s_syscall_table[function]))(arg1, arg2, arg3); -} - } void syscall_handler(RegisterState& regs)