Commit b6fc0ccc authored by Helge Deller's avatar Helge Deller

parisc: Fix ptraced 64-bit applications to call 64-bit syscalls

Fix the strace code path to call 64-bit syscalls in case we are
executing by a 64-bit application.
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 5b00ca0b
...@@ -227,8 +227,7 @@ linux_gateway_entry: ...@@ -227,8 +227,7 @@ linux_gateway_entry:
or,= %r2,%r2,%r2 or,= %r2,%r2,%r2
ldo R%sys_call_table64(%r1), %r19 ldo R%sys_call_table64(%r1), %r19
#else #else
ldil L%sys_call_table, %r1 load32 sys_call_table, %r19
ldo R%sys_call_table(%r1), %r19
#endif #endif
comiclr,>> __NR_Linux_syscalls, %r20, %r0 comiclr,>> __NR_Linux_syscalls, %r20, %r0
b,n .Lsyscall_nosys b,n .Lsyscall_nosys
...@@ -331,8 +330,6 @@ tracesys_next: ...@@ -331,8 +330,6 @@ tracesys_next:
* task->thread.regs.gr[20] above. * task->thread.regs.gr[20] above.
*/ */
copy %ret0,%r20 copy %ret0,%r20
ldil L%sys_call_table,%r1
ldo R%sys_call_table(%r1), %r19
ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */ ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */
LDREG TI_TASK(%r1), %r1 LDREG TI_TASK(%r1), %r1
...@@ -354,6 +351,23 @@ tracesys_next: ...@@ -354,6 +351,23 @@ tracesys_next:
comiclr,>> __NR_Linux_syscalls, %r20, %r0 comiclr,>> __NR_Linux_syscalls, %r20, %r0
b,n .Ltracesys_nosys b,n .Ltracesys_nosys
/* Note! We cannot use the syscall table that is mapped
nearby since the gateway page is mapped execute-only. */
#ifdef CONFIG_64BIT
LDREG TASK_PT_GR30(%r1), %r19 /* get users sp back */
extrd,u %r19,63,1,%r2 /* W hidden in bottom bit */
ldil L%sys_call_table, %r1
or,= %r2,%r2,%r2
addil L%(sys_call_table64-sys_call_table), %r1
ldo R%sys_call_table(%r1), %r19
or,= %r2,%r2,%r2
ldo R%sys_call_table64(%r1), %r19
#else
load32 sys_call_table, %r19
#endif
LDREGX %r20(%r19), %r19 LDREGX %r20(%r19), %r19
/* If this is a sys_rt_sigreturn call, and the signal was received /* If this is a sys_rt_sigreturn call, and the signal was received
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment