summaryrefslogtreecommitdiff
path: root/Kernel/API/Syscall.h
diff options
context:
space:
mode:
authorkleines Filmröllchen <filmroellchen@serenityos.org>2022-07-24 16:00:51 +0200
committerLinus Groh <mail@linusgroh.de>2022-10-27 11:30:19 +0100
commitb8567d7a9da05b713f7e359d962878e433295097 (patch)
treee58aef2bf9ea0ea9a0478372d9f71ae7dcca0dc4 /Kernel/API/Syscall.h
parent7bb34279cdffddb03d9ff78e0741f2774d94ac8f (diff)
downloadserenity-b8567d7a9da05b713f7e359d962878e433295097.zip
Kernel: Make scheduler control syscalls more generic
The syscalls are renamed as they no longer reflect the exact POSIX functionality. They can now handle setting/getting scheduler parameters for both threads and processes.
Diffstat (limited to 'Kernel/API/Syscall.h')
-rw-r--r--Kernel/API/Syscall.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/Kernel/API/Syscall.h b/Kernel/API/Syscall.h
index 365ab9c79b..3603f5f87e 100644
--- a/Kernel/API/Syscall.h
+++ b/Kernel/API/Syscall.h
@@ -8,6 +8,7 @@
#include <AK/Types.h>
#include <AK/Userspace.h>
+#include <Kernel/API/POSIX/sched.h>
constexpr int syscall_vector = 0x82;
@@ -145,8 +146,8 @@ enum class NeedsBigProcessLock {
S(recvmsg, NeedsBigProcessLock::Yes) \
S(rename, NeedsBigProcessLock::No) \
S(rmdir, NeedsBigProcessLock::No) \
- S(sched_getparam, NeedsBigProcessLock::No) \
- S(sched_setparam, NeedsBigProcessLock::No) \
+ S(scheduler_get_parameters, NeedsBigProcessLock::No) \
+ S(scheduler_set_parameters, NeedsBigProcessLock::No) \
S(sendfd, NeedsBigProcessLock::No) \
S(sendmsg, NeedsBigProcessLock::Yes) \
S(set_coredump_metadata, NeedsBigProcessLock::No) \
@@ -480,6 +481,17 @@ struct SC_chmod_params {
int follow_symlinks;
};
+enum class SchedulerParametersMode : bool {
+ Process,
+ Thread,
+};
+
+struct SC_scheduler_parameters_params {
+ pid_t pid_or_tid;
+ SchedulerParametersMode mode;
+ struct sched_param parameters;
+};
+
void initialize();
int sync();