Implement argument_ptr () syscall for handling process arguments
All checks were successful
Build documentation / build-and-deploy (push) Successful in 37s

This commit is contained in:
2026-01-30 14:05:47 +01:00
parent 124aa12f5b
commit 38e26a9c12
10 changed files with 33 additions and 28 deletions

View File

@@ -78,12 +78,13 @@ DEFINE_SYSCALL (sys_unmap) {
return SYSRESULT (procgroup_unmap (proc->procgroup, vaddr, pages));
}
/* int clone (uintptr_t vstack_top, void* entry) */
/* int clone (uintptr_t vstack_top, void* entry, void* argument_ptr) */
DEFINE_SYSCALL (sys_clone) {
uintptr_t vstack_top = a1;
uintptr_t entry = a2;
uintptr_t argument_ptr = a3;
struct proc* new = proc_clone (proc, vstack_top, entry);
struct proc* new = proc_clone (proc, vstack_top, entry, argument_ptr);
if (new == NULL) {
return SYSRESULT (-ST_OOM_ERROR);
@@ -96,6 +97,9 @@ DEFINE_SYSCALL (sys_clone) {
return SYSRESULT (pid);
}
/* void* argument_ptr (void) */
DEFINE_SYSCALL (sys_argument_ptr) { return proc->uvaddr_argument; }
/* int sched (void) */
DEFINE_SYSCALL (sys_sched) {
proc_sched ();
@@ -165,6 +169,7 @@ static syscall_handler_func_t handler_table[] = {
[SYS_MAP] = &sys_map,
[SYS_UNMAP] = &sys_unmap,
[SYS_CLONE] = &sys_clone,
[SYS_ARGUMENT_PTR] = &sys_argument_ptr,
[SYS_SCHED] = &sys_sched,
[SYS_MUTEX_CREATE] = &sys_mutex_create,
[SYS_MUTEX_DELETE] = &sys_mutex_delete,