Kernel: Don't include Kernel/Arch/RegisterState from userspace

Any userspace cpp file that included <syscall.h> 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.
This commit is contained in:
Andrew Kaster 2023-03-11 15:25:37 -07:00 committed by Linus Groh
commit 6ce7257ad7
Notes: sideshowbarker 2024-07-16 23:01:15 +09:00

View file

@ -6,11 +6,14 @@
#pragma once
#include <AK/Error.h>
#include <AK/Types.h>
#include <AK/Userspace.h>
#include <Kernel/API/POSIX/sched.h>
#include <Kernel/Arch/RegisterState.h>
#ifdef KERNEL
# include <AK/Error.h>
# include <Kernel/Arch/RegisterState.h>
#endif
constexpr int syscall_vector = 0x82;
@ -202,7 +205,9 @@ enum class NeedsBigProcessLock {
namespace Syscall {
#ifdef KERNEL
ErrorOr<FlatPtr> handle(RegisterState&, FlatPtr function, FlatPtr arg1, FlatPtr arg2, FlatPtr arg3, FlatPtr arg4);
#endif
enum Function {
#undef __ENUMERATE_SYSCALL