Skip to content

Commit

Permalink
common-user/host/sparc64: Fix safe_syscall_base
Browse files Browse the repository at this point in the history
Use the "retl" instead of "ret" instruction alias, since we
do not allocate a register window in this function.

Fix the offset to the first stacked parameter, which lies
beyond the register window save area.

Fixes: 95c021d ("linux-user/host/sparc64: Add safe-syscall.inc.S")
Signed-off-by: Richard Henderson <[email protected]>
  • Loading branch information
rth7680 committed Feb 8, 2022
1 parent 0a30162 commit 620d0b4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions common-user/host/sparc64/safe-syscall.inc.S
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
.type safe_syscall_end, @function

#define STACK_BIAS 2047
#define PARAM(N) STACK_BIAS + N*8
#define WINDOW_SIZE 16 * 8
#define PARAM(N) STACK_BIAS + WINDOW_SIZE + N * 8

/*
* This is the entry point for making a system call. The calling
Expand Down Expand Up @@ -74,7 +75,7 @@ safe_syscall_end:
/* code path for having successfully executed the syscall */
bcs,pn %xcc, 1f
nop
ret
retl
nop

/* code path when we didn't execute the syscall */
Expand Down

0 comments on commit 620d0b4

Please sign in to comment.