diff options
| author | Ludwig Rydberg <ludwig.rydberg@gaisler.com> | 2026-01-19 15:47:53 +0100 |
|---|---|---|
| committer | Andreas Larsson <andreas@gaisler.com> | 2026-02-06 15:03:43 +0100 |
| commit | 2153b2e8917b73e9e7fae8963f03b8e60bd8f5ff (patch) | |
| tree | 1295c50e1135aff9140c7293dad6f622e61ed9a0 /arch/sparc/kernel/process.c | |
| parent | e38eba3b77878ada327a572a41596a3b0b44e522 (diff) | |
sparc: Add architecture support for clone3
Add support for the clone3 system call to the SPARC architectures.
The implementation follows the pattern of the original clone syscall.
However, instead of explicitly calling kernel_clone, the clone3
handler calls the generic sys_clone3 handler in kernel/fork.
In case no stack is provided, the parents stack is reused.
The return value convention for clone3 follows the regular kernel return
value convention (in contrast to the original clone/fork on SPARC).
Closes: https://github.com/sparclinux/issues/issues/10
Signed-off-by: Ludwig Rydberg <ludwig.rydberg@gaisler.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Andreas Larsson <andreas@gaisler.com>
Tested-by: Andreas Larsson <andreas@gaisler.com>
Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Link: https://lore.kernel.org/r/20260119144753.27945-3-ludwig.rydberg@gaisler.com
Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Diffstat (limited to 'arch/sparc/kernel/process.c')
| -rw-r--r-- | arch/sparc/kernel/process.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c index 7d69877511fa..d72fa0665943 100644 --- a/arch/sparc/kernel/process.c +++ b/arch/sparc/kernel/process.c @@ -12,6 +12,7 @@ #include <linux/sched/task.h> #include <linux/sched/task_stack.h> #include <linux/signal.h> +#include <linux/syscalls.h> #include "kernel.h" @@ -118,3 +119,16 @@ asmlinkage long sparc_clone(struct pt_regs *regs) return ret; } + +asmlinkage long sparc_clone3(struct pt_regs *regs) +{ + unsigned long sz; + struct clone_args __user *cl_args; + + synchronize_user_stack(); + + cl_args = (struct clone_args __user *)regs->u_regs[UREG_I0]; + sz = regs->u_regs[UREG_I1]; + + return sys_clone3(cl_args, sz); +} |
