Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mvme68k/mvme68k Copy the syscall return value into ...



details:   https://anonhg.NetBSD.org/src/rev/4c81ec51dc6f
branches:  trunk
changeset: 499850:4c81ec51dc6f
user:      scw <scw%NetBSD.org@localhost>
date:      Thu Nov 30 21:29:11 2000 +0000

description:
Copy the syscall return value into A0, as per the SVR4 ABI.
Also prepare for COMPAT_AOUT_M68K.

diffstat:

 sys/arch/mvme68k/mvme68k/trap.c |  21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diffs (56 lines):

diff -r bfe251afcf1a -r 4c81ec51dc6f sys/arch/mvme68k/mvme68k/trap.c
--- a/sys/arch/mvme68k/mvme68k/trap.c   Thu Nov 30 21:28:32 2000 +0000
+++ b/sys/arch/mvme68k/mvme68k/trap.c   Thu Nov 30 21:29:11 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.47 2000/11/24 10:29:21 scw Exp $    */
+/*     $NetBSD: trap.c,v 1.48 2000/11/30 21:29:11 scw Exp $    */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -47,6 +47,7 @@
 #include "opt_execfmt.h"
 #include "opt_ktrace.h"
 #include "opt_compat_netbsd.h"
+#include "opt_compat_aout_m68k.h"
 #include "opt_compat_sunos.h"
 #include "opt_compat_hpux.h"
 #include "opt_compat_linux.h"
@@ -92,6 +93,10 @@
 extern struct emul emul_linux;
 #endif
 
+#ifdef COMPAT_AOUT_M68K
+extern struct emul emul_netbsd_aout_m68k;
+#endif
+
 int    writeback __P((struct frame *fp, int docachepush));
 void   trap __P((int type, u_int code, u_int v, struct frame frame));
 void   syscall __P((register_t code, struct frame frame));
@@ -1069,10 +1074,14 @@
                 * Like syscall, but code is a quad, so as to maintain
                 * quad alignment for the rest of the arguments.
                 */
-               if (callp != sysent)
-                       break;
-               code = fuword(params + _QUAD_LOWWORD * sizeof(int));
-               params += sizeof(quad_t);
+               if (callp == sysent     /* Native */
+#ifdef COMPAT_AOUT_M68K
+                   || (p->p_emul == &emul_netbsd_aout_m68k)    /* m68k a.out */
+#endif
+                   ) {
+                       code = fuword(params + _QUAD_LOWWORD * sizeof(int));
+                       params += sizeof(quad_t);
+               }
                break;
        default:
                break;
@@ -1130,7 +1139,7 @@
        error = (*callp->sy_call)(p, args, rval);
        switch (error) {
        case 0:
-               frame.f_regs[D0] = rval[0];
+               frame.f_regs[D0] = frame.f_regs[A0] = rval[0];
                frame.f_regs[D1] = rval[1];
                frame.f_sr &= ~PSL_C;   /* carry bit */
                break;



Home | Main Index | Thread Index | Old Index