]> granicus.if.org Git - strace/commitdiff
S390 updates
authorWichert Akkerman <wichert@deephackmode.org>
Mon, 14 Feb 2000 16:23:40 +0000 (16:23 +0000)
committerWichert Akkerman <wichert@deephackmode.org>
Mon, 14 Feb 2000 16:23:40 +0000 (16:23 +0000)
ChangeLog
NEWS
TODO
acconfig.h
mem.c
process.c
syscall.c

index b500f1fe49d9441a0694058bf3784c5437b5e780..ad05d363bbdedcec6eccecb672a695a9f7ad4e1d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2000-02-14 Wichert Akkerman <wakkerma@debian.org>
+
+  * S390 updates
+
 2000-02-03 Wichert Akkerman <wakkerma@debian.org>
 
   * Merge Trillian (ia64) patches
diff --git a/NEWS b/NEWS
index ce6bd0d4978c0b42d547035f5ee7df98a673310f..5ef1b9c4c50810e16fcc024576483d4450cd794d 100644 (file)
--- 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 a8e7093ad2180b9be17e916e5ba7642f1e57a8a9..167ba3850f5b5644bfee1b915e2bf226e905ecf7 100644 (file)
--- 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
index c16340988c8ee56638a9e772b8245a9155979197..0adf54890801e7d31f678c4b680efee74703222b 100644 (file)
 /* 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 2a1721be77946864543dc843534f8eb750e3d9d8..451f239d0b1b3a9813b36679266b67e8ac574753 100644 (file)
--- 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
index 5c8e1fa25a60adf815a1f8e2020bb2a91ece1036..514ef6c6abd1b1ae09f9a4680834ba50c9f0246a 100644 (file)
--- 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)"          },
index 225c7b55a0da1f288995c51cd9b15a421a7d0dde..ce0ee30db604bb9fdb627ad62492a9af12108c3d 100644 (file)
--- 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);