# define ARG_PTID (known_scno(tcp) == SYS_clone2 ? 3 : 2)
# define ARG_CTID (known_scno(tcp) == SYS_clone2 ? 4 : 3)
# define ARG_TLS (known_scno(tcp) == SYS_clone2 ? 5 : 4)
-# elif defined S390 || defined S390X
+# elif defined S390 || defined S390X || defined CRISV10 || defined CRISV32
# define ARG_STACK 0
# define ARG_FLAGS 1
# define ARG_PTID 2
0x100000 | new) < 0)
return -1;
return 0;
+#elif defined(CRISV10) || defined(CRISV32)
+ if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(4*PT_R9), new) < 0)
+ return -1;
+ return 0;
#elif defined(ARM)
/* Some kernels support this, some (pre-2.6.16 or so) don't. */
# ifndef PTRACE_SET_SYSCALL
{ 69, "fpcsr" },
{ 70, "fpeir" },
# endif
+# ifdef CRISV10
+ { 4*PT_FRAMETYPE, "4*PT_FRAMETYPE" },
+ { 4*PT_ORIG_R10, "4*PT_ORIG_R10" },
+ { 4*PT_R13, "4*PT_R13" },
+ { 4*PT_R12, "4*PT_R12" },
+ { 4*PT_R11, "4*PT_R11" },
+ { 4*PT_R10, "4*PT_R10" },
+ { 4*PT_R9, "4*PT_R9" },
+ { 4*PT_R8, "4*PT_R8" },
+ { 4*PT_R7, "4*PT_R7" },
+ { 4*PT_R6, "4*PT_R6" },
+ { 4*PT_R5, "4*PT_R5" },
+ { 4*PT_R4, "4*PT_R4" },
+ { 4*PT_R3, "4*PT_R3" },
+ { 4*PT_R2, "4*PT_R2" },
+ { 4*PT_R1, "4*PT_R1" },
+ { 4*PT_R0, "4*PT_R0" },
+ { 4*PT_MOF, "4*PT_MOF" },
+ { 4*PT_DCCR, "4*PT_DCCR" },
+ { 4*PT_SRP, "4*PT_SRP" },
+ { 4*PT_IRP, "4*PT_IRP" },
+ { 4*PT_CSRINSTR, "4*PT_CSRINSTR" },
+ { 4*PT_CSRADDR, "4*PT_CSRADDR" },
+ { 4*PT_CSRDATA, "4*PT_CSRDATA" },
+ { 4*PT_USP, "4*PT_USP" },
+# endif
+# ifdef CRISV32
+ { 4*PT_ORIG_R10, "4*PT_ORIG_R10" },
+ { 4*PT_R0, "4*PT_R0" },
+ { 4*PT_R1, "4*PT_R1" },
+ { 4*PT_R2, "4*PT_R2" },
+ { 4*PT_R3, "4*PT_R3" },
+ { 4*PT_R4, "4*PT_R4" },
+ { 4*PT_R5, "4*PT_R5" },
+ { 4*PT_R6, "4*PT_R6" },
+ { 4*PT_R7, "4*PT_R7" },
+ { 4*PT_R8, "4*PT_R8" },
+ { 4*PT_R9, "4*PT_R9" },
+ { 4*PT_R10, "4*PT_R10" },
+ { 4*PT_R11, "4*PT_R11" },
+ { 4*PT_R12, "4*PT_R12" },
+ { 4*PT_R13, "4*PT_R13" },
+ { 4*PT_ACR, "4*PT_ACR" },
+ { 4*PT_SRS, "4*PT_SRS" },
+ { 4*PT_MOF, "4*PT_MOF" },
+ { 4*PT_SPC, "4*PT_SPC" },
+ { 4*PT_CCS, "4*PT_CCS" },
+ { 4*PT_SRP, "4*PT_SRP" },
+ { 4*PT_ERP, "4*PT_ERP" },
+ { 4*PT_EXS, "4*PT_EXS" },
+ { 4*PT_EDA, "4*PT_EDA" },
+ { 4*PT_USP, "4*PT_USP" },
+ { 4*PT_PPC, "4*PT_PPC" },
+ { 4*PT_BP_CTRL, "4*PT_BP_CTRL" },
+ { 4*PT_BP+4, "4*PT_BP+4" },
+ { 4*PT_BP+8, "4*PT_BP+8" },
+ { 4*PT_BP+12, "4*PT_BP+12" },
+ { 4*PT_BP+16, "4*PT_BP+16" },
+ { 4*PT_BP+20, "4*PT_BP+20" },
+ { 4*PT_BP+24, "4*PT_BP+24" },
+ { 4*PT_BP+28, "4*PT_BP+28" },
+ { 4*PT_BP+32, "4*PT_BP+32" },
+ { 4*PT_BP+36, "4*PT_BP+36" },
+ { 4*PT_BP+40, "4*PT_BP+40" },
+ { 4*PT_BP+44, "4*PT_BP+44" },
+ { 4*PT_BP+48, "4*PT_BP+48" },
+ { 4*PT_BP+52, "4*PT_BP+52" },
+ { 4*PT_BP+56, "4*PT_BP+56" },
+# endif
-# if !defined(SPARC) && !defined(HPPA) && !defined(POWERPC) && !defined(ALPHA) && !defined(IA64)
+# if !defined(SPARC) && !defined(HPPA) && !defined(POWERPC) \
+ && !defined(ALPHA) && !defined(IA64) \
+ && !defined(CRISV10) && !defined(CRISV32)
# if !defined(S390) && !defined(S390X) && !defined(MIPS) && !defined(SPARC64) && !defined(BFIN)
{ uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" },
# endif
# if defined(I386) || defined(X86_64)
{ uoff(u_debugreg), "offsetof(struct user, u_debugreg)" },
# endif
-# endif /* !defined(SPARC) && !defined(HPPA) && !defined(POWERPC) && !defined(ALPHA) && !defined(IA64) */
+# endif /* !defined(many arches) */
# endif /* LINUX */
static long r9;
#elif defined(X86_64)
static long rax;
+#elif defined(CRISV10) || defined(CRISV32)
+ static long r10;
#endif
#endif /* LINUX */
#ifdef FREEBSD
long scno = 0;
#ifdef LINUX
-#if defined(S390) || defined(S390X)
+# if defined(S390) || defined(S390X)
if (tcp->flags & TCB_WAITEXECVE) {
/*
* When the execve system call completes successfully, the
scno = ptrace(PTRACE_PEEKTEXT, tcp->pid, svc_addr, 0);
if (errno)
return -1;
-#if defined(S390X)
+# if defined(S390X)
scno >>= 48;
-#else
+# else
scno >>= 16;
-#endif
+# endif
tmp = 0;
offset_reg = (opcode & 0x00f00000) >> 20;
if (offset_reg && (upeek(tcp, gpr_offset[offset_reg], &tmp) < 0))
scno = (scno | tmp) & 0xff;
}
}
-#elif defined (POWERPC)
+# elif defined (POWERPC)
if (upeek(tcp, sizeof(unsigned long)*PT_R0, &scno) < 0)
return -1;
if (!(tcp->flags & TCB_INSYSCALL)) {
return 0;
}
}
-#elif defined(BFIN)
+# elif defined(BFIN)
if (upeek(tcp, PT_ORIG_P0, &scno))
return -1;
/* Check if we return from execve. */
if (tcp->flags & TCB_WAITEXECVE && tcp->flags & TCB_INSYSCALL)
tcp->flags &= ~(TCB_INSYSCALL | TCB_WAITEXECVE);
-#elif defined (I386)
+# elif defined (I386)
if (upeek(tcp, 4*ORIG_EAX, &scno) < 0)
return -1;
-#elif defined (X86_64)
+# elif defined (X86_64)
if (upeek(tcp, 8*ORIG_RAX, &scno) < 0)
return -1;
currpers = current_personality;
break;
}
-#if 0
+# if 0
/* This version analyzes the opcode of a syscall instruction.
* (int 0x80 on i386 vs. syscall on x86-64)
* It works, but is too complicated.
"PID=%d\n", (int)call, pid);
break;
}
-#endif
+# endif
if (currpers != current_personality) {
static const char *const names[] = {"64 bit", "32 bit"};
set_personality(currpers);
pid, names[current_personality]);
}
}
-#elif defined(IA64)
+# elif defined(IA64)
# define IA64_PSR_IS ((long)1 << 34)
if (upeek(tcp, PT_CR_IPSR, &psr) >= 0)
ia32 = (psr & IA64_PSR_IS) != 0;
}
/* Check if we return from execve. */
if (tcp->flags & TCB_WAITEXECVE) {
-#if defined PTRACE_GETSIGINFO
+# if defined PTRACE_GETSIGINFO
siginfo_t si;
tcp->flags &= ~TCB_WAITEXECVE;
ptrace(PTRACE_GETSIGINFO, tcp->pid, (void*) 0, (void*) &si);
if (si.si_code == SI_USER)
return 0;
-#else
+# else
tcp->flags &= ~TCB_WAITEXECVE;
return 0;
-#endif
+# endif
}
} else {
/* syscall in progress */
if (upeek(tcp, PT_R10, &r10) < 0)
return -1;
}
-#elif defined (ARM)
+# elif defined (ARM)
/*
* Read complete register set in one go.
*/
tcp->flags |= TCB_INSYSCALL;
}
}
-#elif defined (M68K)
+# elif defined (M68K)
if (upeek(tcp, 4*PT_ORIG_D0, &scno) < 0)
return -1;
-#elif defined (LINUX_MIPSN32)
+# elif defined (LINUX_MIPSN32)
unsigned long long regs[38];
if (do_ptrace(PTRACE_GETREGS, tcp, NULL, (long) ®s) < 0)
}
}
}
-#elif defined (MIPS)
+# elif defined (MIPS)
if (upeek(tcp, REG_A3, &a3) < 0)
return -1;
if(!(tcp->flags & TCB_INSYSCALL)) {
if (upeek(tcp, REG_V0, &r2) < 0)
return -1;
}
-#elif defined (ALPHA)
+# elif defined (ALPHA)
if (upeek(tcp, REG_A3, &a3) < 0)
return -1;
if (upeek(tcp, REG_R0, &r0) < 0)
return -1;
}
-#elif defined (SPARC) || defined (SPARC64)
+# elif defined (SPARC) || defined (SPARC64)
/* Everything we need is in the current register set. */
if (ptrace(PTRACE_GETREGS, tcp->pid, (char *)®s, 0) < 0)
return -1;
/* Retrieve the syscall trap instruction. */
errno = 0;
trap = ptrace(PTRACE_PEEKTEXT, tcp->pid, (char *)regs.r_pc, 0);
-#if defined(SPARC64)
+# if defined(SPARC64)
trap >>= 32;
-#endif
+# endif
if (errno)
return -1;
tcp->flags &= ~TCB_WAITEXECVE;
return 0;
}
-#if defined (SPARC64)
+# if defined (SPARC64)
fprintf(stderr,"syscall: unknown syscall trap %08lx %016lx\n", trap, regs.r_tpc);
-#else
+# else
fprintf(stderr,"syscall: unknown syscall trap %08x %08x\n", trap, regs.r_pc);
-#endif
+# endif
return -1;
}
memmove (®s.r_o0, ®s.r_o1, 7*sizeof(regs.r_o0));
}
}
-#elif defined(HPPA)
+# elif defined(HPPA)
if (upeek(tcp, PT_GR20, &scno) < 0)
return -1;
if (!(tcp->flags & TCB_INSYSCALL)) {
return 0;
}
}
-#elif defined(SH)
+# elif defined(SH)
/*
* In the new syscall ABI, the system call number is in R3.
*/
return 0;
}
}
-#elif defined(SH64)
+# elif defined(SH64)
if (upeek(tcp, REG_SYSCALL, &scno) < 0)
return -1;
scno &= 0xFFFF;
return 0;
}
}
-#endif /* SH64 */
+# elif defined(CRISV10) || defined(CRISV32)
+ if (upeek(tcp, 4*PT_R9, &scno) < 0)
+ return -1;
+# endif
#endif /* LINUX */
+
#ifdef SUNOS4
if (upeek(tcp, uoff(u_arg[7]), &scno) < 0)
return -1;
/* ABI defines result returned in r9 */
if (upeek(tcp, REG_GENERAL(9), (long *)&r9) < 0)
return -1;
-
#endif
+
#ifdef USE_PROCFS
-#ifdef HAVE_PR_SYSCALL
+# ifdef HAVE_PR_SYSCALL
scno = tcp->status.PR_SYSCALL;
-#else /* !HAVE_PR_SYSCALL */
-#ifndef FREEBSD
+# else
+# ifndef FREEBSD
scno = tcp->status.PR_WHAT;
-#else /* FREEBSD */
+# else
if (pread(tcp->pfd_reg, ®s, sizeof(regs), 0) < 0) {
perror("pread");
return -1;
scno = regs.r_eax;
break;
}
-#endif /* FREEBSD */
-#endif /* !HAVE_PR_SYSCALL */
+# endif /* FREEBSD */
+# endif /* !HAVE_PR_SYSCALL */
#endif /* USE_PROCFS */
+
if (!(tcp->flags & TCB_INSYSCALL))
tcp->scno = scno;
return 1;
* ("????" etc) and bail out.
*/
static int
-syscall_fixup(tcp)
-struct tcb *tcp;
+syscall_fixup(struct tcb *tcp)
{
#ifdef USE_PROCFS
int scno = known_scno(tcp);
fprintf(stderr, "stray syscall exit: r8 = %ld\n", r8);
return 0;
}
+#elif defined(CRISV10) || defined(CRISV32)
+ if (upeek(tcp->pid, 4*PT_R10, &r10) < 0)
+ return -1;
+ if (r10 != -ENOSYS && !(tcp->flags & TCB_INSYSCALL)) {
+ if (debug)
+ fprintf(stderr, "stray syscall exit: r10 = %ld\n", r10);
+ return 0;
+ }
#endif
#endif /* LINUX */
return 1;
#endif
static int
-get_error(tcp)
-struct tcb *tcp;
+get_error(struct tcb *tcp)
{
int u_error = 0;
#ifdef LINUX
-#if defined(S390) || defined(S390X)
+# if defined(S390) || defined(S390X)
if (is_negated_errno(gpr2)) {
tcp->u_rval = -1;
u_error = -gpr2;
tcp->u_rval = gpr2;
u_error = 0;
}
-#else /* !S390 && !S390X */
-#ifdef I386
+# elif defined(I386)
if (is_negated_errno(eax)) {
tcp->u_rval = -1;
u_error = -eax;
tcp->u_rval = eax;
u_error = 0;
}
-#else /* !I386 */
-#ifdef X86_64
+# elif defined(X86_64)
if (is_negated_errno(rax)) {
tcp->u_rval = -1;
u_error = -rax;
tcp->u_rval = rax;
u_error = 0;
}
-#else
-#ifdef IA64
+# elif defined(IA64)
if (ia32) {
int err;
u_error = 0;
}
}
-#else /* !IA64 */
-#ifdef MIPS
+# elif defined(MIPS)
if (a3) {
tcp->u_rval = -1;
u_error = r2;
tcp->u_rval = r2;
u_error = 0;
}
-#else
-#ifdef POWERPC
+# elif defined(POWERPC)
if (is_negated_errno(result)) {
tcp->u_rval = -1;
u_error = -result;
tcp->u_rval = result;
u_error = 0;
}
-#else /* !POWERPC */
-#ifdef M68K
+# elif defined(M68K)
if (is_negated_errno(d0)) {
tcp->u_rval = -1;
u_error = -d0;
tcp->u_rval = d0;
u_error = 0;
}
-#else /* !M68K */
-#ifdef ARM
+# elif defined(ARM)
if (is_negated_errno(regs.ARM_r0)) {
tcp->u_rval = -1;
u_error = -regs.ARM_r0;
tcp->u_rval = regs.ARM_r0;
u_error = 0;
}
-#else /* !ARM */
-#ifdef BFIN
+# elif defined(BFIN)
if (is_negated_errno(r0)) {
tcp->u_rval = -1;
u_error = -r0;
tcp->u_rval = r0;
u_error = 0;
}
-#else /* !BFIN */
-#ifdef ALPHA
+# elif defined(ALPHA)
if (a3) {
tcp->u_rval = -1;
u_error = r0;
tcp->u_rval = r0;
u_error = 0;
}
-#else /* !ALPHA */
-#ifdef SPARC
+# elif defined(SPARC)
if (regs.r_psr & PSR_C) {
tcp->u_rval = -1;
u_error = regs.r_o0;
tcp->u_rval = regs.r_o0;
u_error = 0;
}
-#else /* !SPARC */
-#ifdef SPARC64
+# elif defined(SPARC64)
if (regs.r_tstate & 0x1100000000UL) {
tcp->u_rval = -1;
u_error = regs.r_o0;
tcp->u_rval = regs.r_o0;
u_error = 0;
}
-#else /* !SPARC64 */
-#ifdef HPPA
+# elif defined(HPPA)
if (is_negated_errno(r28)) {
tcp->u_rval = -1;
u_error = -r28;
tcp->u_rval = r28;
u_error = 0;
}
-#else
-#ifdef SH
+# elif defined(SH)
/* interpret R0 as return value or error number */
if (is_negated_errno(r0)) {
tcp->u_rval = -1;
tcp->u_rval = r0;
u_error = 0;
}
-#else
-#ifdef SH64
+# elif defined(SH64)
/* interpret result as return value or error number */
if (is_negated_errno(r9)) {
tcp->u_rval = -1;
tcp->u_rval = r9;
u_error = 0;
}
-#endif /* SH64 */
-#endif /* SH */
-#endif /* HPPA */
-#endif /* SPARC */
-#endif /* SPARC64 */
-#endif /* ALPHA */
-#endif /* BFIN */
-#endif /* ARM */
-#endif /* M68K */
-#endif /* POWERPC */
-#endif /* MIPS */
-#endif /* IA64 */
-#endif /* X86_64 */
-#endif /* I386 */
-#endif /* S390 || S390X */
+# elif defined(CRISV10) || defined(CRISV32)
+ if (r10 && (unsigned) -r10 < nerrnos) {
+ tcp->u_rval = -1;
+ u_error = -r10;
+ }
+ else {
+ tcp->u_rval = r10;
+ u_error = 0;
+ }
+# endif
#endif /* LINUX */
#ifdef SUNOS4
/* get error code from user struct */
long rval;
{
#ifdef LINUX
-#if defined(S390) || defined(S390X)
+# if defined(S390) || defined(S390X)
gpr2 = error ? -error : rval;
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)PT_GPR2, gpr2) < 0)
return -1;
-#else /* !S390 && !S390X */
-#ifdef I386
+# elif defined(I386)
eax = error ? -error : rval;
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(EAX * 4), eax) < 0)
return -1;
-#else /* !I386 */
-#ifdef X86_64
+# elif defined(X86_64)
rax = error ? -error : rval;
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(RAX * 8), rax) < 0)
return -1;
-#else
-#ifdef IA64
+# elif defined(IA64)
if (ia32) {
r8 = error ? -error : rval;
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(PT_R8), r8) < 0)
ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(PT_R10), r10) < 0)
return -1;
}
-#else /* !IA64 */
-#ifdef BFIN
+# elif defined(BFIN)
r0 = error ? -error : rval;
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)PT_R0, r0) < 0)
return -1;
-#else /* !BFIN */
-#ifdef MIPS
+# elif defined(MIPS)
if (error) {
r2 = error;
a3 = -1;
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_A3), a3) < 0 ||
ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_V0), r2) < 0)
return -1;
-#else
-#ifdef POWERPC
+# elif defined(POWERPC)
if (upeek(tcp, sizeof(unsigned long)*PT_CCR, &flags) < 0)
return -1;
if (error) {
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(sizeof(unsigned long)*PT_CCR), flags) < 0 ||
ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(sizeof(unsigned long)*PT_R3), result) < 0)
return -1;
-#else /* !POWERPC */
-#ifdef M68K
+# elif defined(M68K)
d0 = error ? -error : rval;
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(4*PT_D0), d0) < 0)
return -1;
-#else /* !M68K */
-#ifdef ARM
+# elif defined(ARM)
regs.ARM_r0 = error ? -error : rval;
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(4*0), regs.ARM_r0) < 0)
return -1;
-#else /* !ARM */
-#ifdef ALPHA
+# elif defined(ALPHA)
if (error) {
a3 = -1;
r0 = error;
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_A3), a3) < 0 ||
ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_R0), r0) < 0)
return -1;
-#else /* !ALPHA */
-#ifdef SPARC
+# elif defined(SPARC)
if (ptrace(PTRACE_GETREGS, tcp->pid, (char *)®s, 0) < 0)
return -1;
if (error) {
}
if (ptrace(PTRACE_SETREGS, tcp->pid, (char *)®s, 0) < 0)
return -1;
-#else /* !SPARC */
-#ifdef SPARC64
+# elif defined(SPARC64)
if (ptrace(PTRACE_GETREGS, tcp->pid, (char *)®s, 0) < 0)
return -1;
if (error) {
}
if (ptrace(PTRACE_SETREGS, tcp->pid, (char *)®s, 0) < 0)
return -1;
-#else /* !SPARC64 */
-#ifdef HPPA
+# elif defined(HPPA)
r28 = error ? -error : rval;
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(PT_GR28), r28) < 0)
return -1;
-#else
-#ifdef SH
+# elif defined(SH)
r0 = error ? -error : rval;
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(4*REG_REG0), r0) < 0)
return -1;
-#else
-#ifdef SH64
+# elif defined(SH64)
r9 = error ? -error : rval;
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)REG_GENERAL(9), r9) < 0)
return -1;
-#endif /* SH64 */
-#endif /* SH */
-#endif /* HPPA */
-#endif /* SPARC */
-#endif /* SPARC64 */
-#endif /* ALPHA */
-#endif /* ARM */
-#endif /* M68K */
-#endif /* POWERPC */
-#endif /* MIPS */
-#endif /* BFIN */
-#endif /* IA64 */
-#endif /* X86_64 */
-#endif /* I386 */
-#endif /* S390 || S390X */
+# endif
#endif /* LINUX */
+
#ifdef SUNOS4
if (do_ptrace(PTRACE_POKEUSER, tcp->pid, (char*)uoff(u_error), error << 24) < 0
|| do_ptrace(PTRACE_POKEUSER, tcp->pid, (char*)uoff(u_rval1), rval) < 0
return -1;
}
#endif /* SUNOS4 */
+
#ifdef SVR4
/* XXX no clue */
return -1;
#endif /* SVR4 */
+
#ifdef FREEBSD
if (pread(tcp->pfd_reg, ®s, sizeof(regs), 0) < 0) {
perror("pread");
}
static int
-syscall_enter(tcp)
-struct tcb *tcp;
+syscall_enter(struct tcb *tcp)
{
#ifdef LINUX
#if defined(S390) || defined(S390X)
}
}
#elif defined (POWERPC)
-#ifndef PT_ORIG_R3
-#define PT_ORIG_R3 34
-#endif
+# ifndef PT_ORIG_R3
+# define PT_ORIG_R3 34
+# endif
{
int i;
if (tcp->scno >= 0 && tcp->scno < nsyscalls && sysent[tcp->scno].nargs != -1)
return -1;
}
}
+#elif defined(CRISV10) || defined(CRISV32)
+ {
+ int i;
+ static const int crisregs[] = {
+ 4*PT_ORIG_R10, 4*PT_R11, 4*PT_R12,
+ 4*PT_R13, 4*PT_MOF, 4*PT_SRP
+ };
+
+ if (tcp->scno >= 0 && tcp->scno < nsyscalls)
+ tcp->u_nargs = sysent[tcp->scno].nargs;
+ else
+ tcp->u_nargs = 0;
+ for (i = 0; i < tcp->u_nargs; i++) {
+ if (upeek(tcp->pid, crisregs[i], &tcp->u_arg[i]) < 0)
+ return -1;
+ }
+ }
#else /* Other architecture (like i386) (32bits specific) */
{
int i;
#elif defined(IA64)
if (upeek(tcp, PT_R9, &val) < 0)
return -1;
-#endif /* SPARC || SPARC64 */
+#endif
#endif /* LINUX */
#ifdef SUNOS4
val = tcp->status.PR_REG[CTX_V1];
#endif /* MIPS */
#endif /* SVR4 */
+
#ifdef FREEBSD
struct reg regs;
pread(tcp->pfd_reg, ®s, sizeof(regs), 0);