From 6ce7257ad7598bfab477e86ffe6ee8b2e0cb57b4 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sat, 11 Mar 2023 15:25:37 -0700 Subject: [PATCH] Kernel: Don't include Kernel/Arch/RegisterState from userspace Any userspace cpp file that included would end up with a large glob of Kernel headers included, all the way down to Kernel/Arch/x86_64/CPU.h and friends. Only the kernel needs RegisterState, so hide it from userspace. --- Kernel/API/Syscall.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Kernel/API/Syscall.h b/Kernel/API/Syscall.h index 70c68838ca..2ca0751713 100644 --- a/Kernel/API/Syscall.h +++ b/Kernel/API/Syscall.h @@ -6,11 +6,14 @@ #pragma once -#include #include #include #include -#include + +#ifdef KERNEL +# include +# include +#endif constexpr int syscall_vector = 0x82; @@ -202,7 +205,9 @@ enum class NeedsBigProcessLock { namespace Syscall { +#ifdef KERNEL ErrorOr handle(RegisterState&, FlatPtr function, FlatPtr arg1, FlatPtr arg2, FlatPtr arg3, FlatPtr arg4); +#endif enum Function { #undef __ENUMERATE_SYSCALL