Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/powerpc Darwin skips the next instruction a...



details:   https://anonhg.NetBSD.org/src/rev/cfeb7dcc0196
branches:  trunk
changeset: 539372:cfeb7dcc0196
user:      manu <manu%NetBSD.org@localhost>
date:      Fri Nov 15 23:19:22 2002 +0000

description:
Darwin skips the next instruction after a successful system call. Strange
world.

diffstat:

 sys/arch/powerpc/powerpc/syscall.c |  22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diffs (50 lines):

diff -r 15befdceb162 -r cfeb7dcc0196 sys/arch/powerpc/powerpc/syscall.c
--- a/sys/arch/powerpc/powerpc/syscall.c        Fri Nov 15 22:44:57 2002 +0000
+++ b/sys/arch/powerpc/powerpc/syscall.c        Fri Nov 15 23:19:22 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: syscall.c,v 1.14 2002/11/15 20:06:03 manu Exp $        */
+/*     $NetBSD: syscall.c,v 1.15 2002/11/15 23:19:22 manu Exp $        */
 
 /*
  * Copyright (C) 2002 Matt Thomas
@@ -65,7 +65,7 @@
 #define EMULNAME(x)    (x)
 #define EMULNAMEU(x)   (x)
 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.14 2002/11/15 20:06:03 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.15 2002/11/15 23:19:22 manu Exp $");
 
 void
 child_return(void *arg)
@@ -173,6 +173,15 @@
                frame->fixreg[FIRSTARG] = rval[0];
                frame->fixreg[FIRSTARG + 1] = rval[1];
                frame->cr &= ~0x10000000;
+#ifdef COMPAT_MACH
+               /* 
+                * For regular system calls, on success,
+                * the next instruction is skipped 
+                */
+               if ((frame->fixreg[0] < p->p_emul->e_nsysent)
+                   && (frame->fixreg[0] >= 0))
+                       frame->srr0 += 4;
+#endif /* COMPAT_MACH */
                break;
        case ERESTART:
                /*
@@ -270,6 +279,15 @@
                frame->fixreg[FIRSTARG] = rval[0];
                frame->fixreg[FIRSTARG + 1] = rval[1];
                frame->cr &= ~0x10000000;
+#ifdef COMPAT_MACH
+               /* 
+                * For regular system calls, on success,
+                * the next instruction is skipped 
+                */
+               if ((frame->fixreg[0] < p->p_emul->e_nsysent)
+                   && (frame->fixreg[0] >= 0))
+                       frame->srr0 += 4;
+#endif /* COMPAT_MACH */
                break;
        case ERESTART:
                /*



Home | Main Index | Thread Index | Old Index