Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Use bswap32() as SCR_BO() macro to avoid unexpec...



details:   https://anonhg.NetBSD.org/src/rev/0ab0e3800569
branches:  trunk
changeset: 479693:0ab0e3800569
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Dec 18 07:57:03 1999 +0000

description:
Use bswap32() as SCR_BO() macro to avoid unexpected side effects.
SCR_BO(*src++) caused some trouble.

diffstat:

 sys/dev/pci/ncrreg.h |  5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diffs (19 lines):

diff -r 24cd29a340c8 -r 0ab0e3800569 sys/dev/pci/ncrreg.h
--- a/sys/dev/pci/ncrreg.h      Sat Dec 18 06:54:05 1999 +0000
+++ b/sys/dev/pci/ncrreg.h      Sat Dec 18 07:57:03 1999 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: ncrreg.h,v 1.15 1999/12/05 18:25:19 thorpej Exp $      */
+/*      $NetBSD: ncrreg.h,v 1.16 1999/12/18 07:57:03 tsutsui Exp $      */
 
 /**************************************************************************
 **
@@ -294,8 +294,7 @@
 typedef U_INT32 ncrcmd;
 
 #if BYTE_ORDER == BIG_ENDIAN
-#define        SCR_BO(x)       (((x) >> 24) | (((x) >> 8) & 0xff00) | \
-                        ((x) << 24) | (((x) & 0xff00) << 8))
+#define        SCR_BO(x)       bswap32(x)
 #else
 #define        SCR_BO(x)       (x)
 #endif



Home | Main Index | Thread Index | Old Index