Move sparc64 get_scno() code where it belongs

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This commit is contained in:
Denys Vlasenko 2015-03-25 15:22:49 +01:00
parent 588a90f0f0
commit b6ef71b6f4
2 changed files with 19 additions and 21 deletions

View File

@ -1,21 +1 @@
#ifdef SPARC64
/* Retrieve the syscall trap instruction. */
unsigned long trap;
errno = 0;
trap = ptrace(PTRACE_PEEKTEXT, tcp->pid, (char *)sparc_regs.tpc, 0);
if (errno)
return -1;
trap >>= 32;
switch (trap) {
case 0x91d02010:
/* Linux/SPARC syscall trap. */
update_personality(tcp, 0);
break;
case 0x91d0206d:
/* Linux/SPARC64 syscall trap. */
update_personality(tcp, 1);
break;
}
#endif
scno = sparc_regs.u_regs[U_REG_G1];

View File

@ -1 +1,19 @@
#include "sparc/get_scno.c"
/* Retrieve the syscall trap instruction. */
unsigned long trap;
errno = 0;
trap = ptrace(PTRACE_PEEKTEXT, tcp->pid, (char *)sparc_regs.tpc, 0);
if (errno)
return -1;
trap >>= 32;
switch (trap) {
case 0x91d02010:
/* Linux/SPARC syscall trap. */
update_personality(tcp, 0);
break;
case 0x91d0206d:
/* Linux/SPARC64 syscall trap. */
update_personality(tcp, 1);
break;
}
scno = sparc_regs.u_regs[U_REG_G1];