Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#3544 RV64: Implemented dynamorio-clone #6063

Merged
merged 7 commits into from
May 20, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions core/arch/riscv64/riscv64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,13 @@ GLOBAL_LABEL(_dynamorio_runtime_resolve:)
*/
DECLARE_FUNC(dynamorio_clone)
GLOBAL_LABEL(dynamorio_clone:)
addi ARG2, ARG2, -16 /* Description: newsp = newsp + 16. */
addi ARG2, ARG2, -16 /* Description: newsp = newsp - 16. */
sd ARG1, 8 (ARG2)
sd ARG6, 0 (ARG2) /* The func is now on TOS of newsp. */
li SYSNUM_REG, SYS_clone /* All args are already in syscall registers.*/
ecall
bnez ARG1, dynamorio_clone_parent
ld ARG1, 0 (sp)
ld ARG2, 8 (sp)
addi sp, sp, 16
jalr ARG1
jal GLOBAL_REF(unexpected_return)
Expand All @@ -289,7 +288,7 @@ GLOBAL_LABEL(dynamorio_sigreturn:)
DECLARE_FUNC(dynamorio_sys_exit)
GLOBAL_LABEL(dynamorio_sys_exit:)
li a0, 0 /* exit code */
li SYSNUM_REG, SYS_exit /* SYS_exit number */
li SYSNUM_REG, SYS_exit
ecall
jal GLOBAL_REF(unexpected_return)
END_FUNC(dynamorio_sys_exit)
Expand Down