From: Wichert Akkerman Date: Mon, 14 Feb 2000 16:23:40 +0000 (+0000) Subject: S390 updates X-Git-Tag: v4.5.18~1130 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12f75d1a388cd2eaf1edb7b73daea243210c4ea0;p=strace S390 updates --- diff --git a/ChangeLog b/ChangeLog index b500f1fe..ad05d363 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2000-02-14 Wichert Akkerman + + * S390 updates + 2000-02-03 Wichert Akkerman * Merge Trillian (ia64) patches diff --git a/NEWS b/NEWS index ce6bd0d4..5ef1b9c4 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +Changes in 4.3 +============== +* Linux/ia64 port added + Changes in 4.2 ============== * Compiles on glibc2.0 systems again diff --git a/TODO b/TODO index a8e7093a..167ba385 100644 --- a/TODO +++ b/TODO @@ -1,11 +1,10 @@ -- new entries from wta clone doesn't work; cloned processes can hang -replace printargs with something that reads a configuration-file --> rescheduled for strace rewrite +- partially done: finish up change_syscall using new setargs +- do setargs for non-ia64 rename functions that are used for general things: sys_chdir -> general_1stringarg generate syscallent.h from the kernel sources -add IPv6 support -- old entries from jrs diff --git a/acconfig.h b/acconfig.h index c1634098..0adf5489 100644 --- a/acconfig.h +++ b/acconfig.h @@ -30,12 +30,15 @@ /* Define if this is an alpha architecture. */ #undef ALPHA -/* Define if this is a arm architecture. */ +/* Define if this is an arm architecture. */ #undef ARM -/* Define if this is an powerpc architecture. */ +/* Define if this is a powerpc architecture. */ #undef POWERPC +/* Define if this is a S390 architecture. */ +#undef S390 + /* Define if you have a SVR4 MP type procfs. I.E. /dev/xxx/ctl, /dev/xxx/status. Also implies that you have the pr_lwp member in prstatus. */ diff --git a/mem.c b/mem.c index 2a1721be..451f239d 100644 --- a/mem.c +++ b/mem.c @@ -170,9 +170,9 @@ int sys_old_mmap(tcp) struct tcb *tcp; { long u_arg[6]; - int i, v; #if defined(IA64) + int i, v; /* * IA64 processes never call this routine, they only use the * new `sys_mmap' interface. This code converts the integer diff --git a/process.c b/process.c index 5c8e1fa2..514ef6c6 100644 --- a/process.c +++ b/process.c @@ -405,6 +405,14 @@ setarg(tcp, argnum) return -1; } +#elif defined(I386) + { + /* TODO: finish this */ + errno=0; +// ptrace(PTRACE_POKEDATA, tcp->pid, , tcp->u_arg[argnum]); + if (errno) + return -1; + } #else # error Sorry, not done yet. #endif @@ -1841,10 +1849,7 @@ struct xlat struct_user_offsets[] = { { 4*PT_PC, "4*PT_PC" }, #endif /* M68K */ #endif /* !I386 */ -#ifdef S390 - { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" }, -#endif -#ifndef MIPS +#if !defined(S390) && !defined(MIPS) { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" }, #endif #ifdef I386 @@ -1860,7 +1865,7 @@ struct xlat struct_user_offsets[] = { { uoff(start_code), "offsetof(struct user, start_code)" }, { uoff(start_stack), "offsetof(struct user, start_stack)" }, { uoff(signal), "offsetof(struct user, signal)" }, -#ifndef MIPS +#if !defined(S390) && !defined(MIPS) { uoff(reserved), "offsetof(struct user, reserved)" }, #endif { uoff(u_ar0), "offsetof(struct user, u_ar0)" }, diff --git a/syscall.c b/syscall.c index 225c7b55..ce0ee30d 100644 --- a/syscall.c +++ b/syscall.c @@ -840,6 +840,14 @@ struct tcb *tcp; fprintf(stderr, "stray syscall exit: eax = %ld\n", eax); return 0; } +#elif defined (S390) + if (upeek(pid, PT_GPR2, &gpr2) < 0) + return -1; + if (gpr2 != -ENOSYS && !(tcp->flags & TCB_INSYSCALL)) { + if (debug) + fprintf(stderr, "stray syscall exit: gpr2 = %ld\n", gpr2); + return 0; + } #elif defined (POWERPC) # define SO_MASK 0x10000000 if (upeek(pid, 4*PT_CCR, &flags) < 0) @@ -876,6 +884,16 @@ struct tcb *tcp; { int u_error = 0; #ifdef LINUX +#ifdef S390 + if (gpr2 && (unsigned) -gpr2 < nerrnos) { + tcp->u_rval = -1; + u_error = -gpr2; + } + else { + tcp->u_rval = gpr2; + u_error = 0; + } +#else /* !S390 */ #ifdef I386 if (eax < 0 && -eax < nerrnos) { tcp->u_rval = -1; @@ -975,6 +993,7 @@ struct tcb *tcp; #endif /* MIPS */ #endif /* IA64 */ #endif /* I386 */ +#endif /* S390 */ #endif /* LINUX */ #ifdef SUNOS4 /* get error code from user struct */ @@ -1349,7 +1368,7 @@ struct tcb *tcp; decode_subcall(tcp, SYS_ipc_subcall, SYS_ipc_nsubcalls, shift_style); break; -#endif /* !ALPHA && !SPARC */ +#endif /* !ALPHA && !IA64 && !MIPS && !SPARC */ #ifdef SPARC case SYS_socketcall: sparc_socket_decode (tcp);