Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mvme68k/include The success/failure status for some...



details:   https://anonhg.NetBSD.org/src/rev/eb2200457ae5
branches:  trunk
changeset: 517263:eb2200457ae5
user:      scw <scw%NetBSD.org@localhost>
date:      Fri Nov 09 18:18:19 2001 +0000

description:
The success/failure status for some Bug syscalls is indicated by the Z
flag in the status register, not by a value on the stack.

How this ever worked for so long is beyond me...

diffstat:

 sys/arch/mvme68k/include/prom.h |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 530877e6054e -r eb2200457ae5 sys/arch/mvme68k/include/prom.h
--- a/sys/arch/mvme68k/include/prom.h   Fri Nov 09 18:04:10 2001 +0000
+++ b/sys/arch/mvme68k/include/prom.h   Fri Nov 09 18:18:19 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: prom.h,v 1.11 2001/04/14 13:43:07 scw Exp $    */
+/*     $NetBSD: prom.h,v 1.12 2001/11/09 18:18:19 scw Exp $    */
 
 /*
  * Copyright (c) 1995 Theo de Raadt
@@ -165,6 +165,8 @@
        __asm__ __volatile ("movel %0, %%sp@-"::"d" (arg))
 #define MVMEPROM_GETRES(ret) \
        __asm__ __volatile ("movel %%sp@+,%0": "=d" (ret):)
+#define MVMEPROM_GETSR(ret) \
+       __asm__ __volatile ("movew %%sr,%0": "=d" (ret):)
 #define MVMEPROM_RETURN(ret) \
        MVMEPROM_GETRES(ret); \
        return (ret);                   /* return a value (int) */
@@ -173,8 +175,8 @@
        MVMEPROM_GETRES(ret); \
        return(int)((((unsigned int)(ret)) >> 24) & 0xff);
 #define MVMEPROM_STATRET(ret) \
-       MVMEPROM_GETRES(ret); \
-       return (!(ret & 0x4));          /* return a 'status' */
+       MVMEPROM_GETSR(ret); \
+       return ((ret & 0x4) == 0);      /* return a 'status' in the Z flag */
 
 #define MVMEPROM_REG_DEVLUN    %d0
 #define MVMEPROM_REG_CTRLLUN   %d1



Home | Main Index | Thread Index | Old Index