kernel_args: redo implementation

This commit is contained in:
Matheus
2025-09-07 23:09:34 -03:00
parent a3a51abfed
commit 80786cf97a
15 changed files with 198 additions and 107 deletions
+4 -2
View File
@@ -1,9 +1,11 @@
#include <kernel/syscalls.h>
#include <kernel/scheduler.h>
#include <kernel/cmdline.h>
#include <kernel/kernel_args.h>
#include <kernel/alloc.h>
#include <arch/cpu.h>
DEFINE_KERNEL_ARGUMENT(nomultithread, bool);
syscallret_t syscall_newthread(context_t *, void *entry, void *stack) {
syscallret_t ret = {
.ret = -1
@@ -11,7 +13,7 @@ syscallret_t syscall_newthread(context_t *, void *entry, void *stack) {
// TODO perhaps clean up threads here as well
// if the kernel was specified to have no user threading in the cmdline
if (cmdline_get("nomultithread")) {
if (GET_KERNEL_ARGUMENT(nomultithread, bool)) {
ret.errno = ENOSYS;
return ret;
}