diff options
author | Pedro Falcato <pedro.falcato@gmail.com> | 2023-02-09 16:34:12 +0000 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2023-02-09 12:33:35 -0500 |
commit | 5763f003a53ddaa63655058f19d9fe662751592d (patch) | |
tree | 2cb5ee344e39da81400fb642d140667823a01863 /src/process/riscv64 | |
parent | 269d193820342dc109f39909d78fb30f4c978f76 (diff) | |
download | musl-5763f003a53ddaa63655058f19d9fe662751592d.tar.gz musl-5763f003a53ddaa63655058f19d9fe662751592d.tar.bz2 musl-5763f003a53ddaa63655058f19d9fe662751592d.tar.xz musl-5763f003a53ddaa63655058f19d9fe662751592d.zip |
riscv64: add vfork
Implement vfork() using clone(CLONE_VM | CLONE_VFORK | ...).
Diffstat (limited to 'src/process/riscv64')
-rw-r--r-- | src/process/riscv64/vfork.s | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/process/riscv64/vfork.s b/src/process/riscv64/vfork.s new file mode 100644 index 00000000..c93dca23 --- /dev/null +++ b/src/process/riscv64/vfork.s @@ -0,0 +1,12 @@ +.global vfork +.type vfork,@function +vfork: + /* riscv does not have SYS_vfork, so we must use clone instead */ + /* note: riscv's clone = clone(flags, sp, ptidptr, tls, ctidptr) */ + li a7, 220 + li a0, 0x100 | 0x4000 | 17 /* flags = CLONE_VM | CLONE_VFORK | SIGCHLD */ + mv a1, sp + /* the other arguments are ignoreable */ + ecall + .hidden __syscall_ret + j __syscall_ret |