1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:17:44 +00:00

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
parent 11fe34ce0f
commit 6ce7257ad7

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