Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Wrap the bit-twiddling macros so that they don't ...



details:   https://anonhg.NetBSD.org/src/rev/5543d8a8b63a
branches:  trunk
changeset: 558142:5543d8a8b63a
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Thu Jan 29 09:53:18 2004 +0000

description:
Wrap the bit-twiddling macros so that they don't get redefined if
more than one header file defines them.

diffstat:

 sys/dev/ic/atwreg.h |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (27 lines):

diff -r d65fba641c81 -r 5543d8a8b63a sys/dev/ic/atwreg.h
--- a/sys/dev/ic/atwreg.h       Thu Jan 29 09:27:53 2004 +0000
+++ b/sys/dev/ic/atwreg.h       Thu Jan 29 09:53:18 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atwreg.h,v 1.4 2004/01/10 06:30:36 dyoung Exp $        */
+/*     $NetBSD: atwreg.h,v 1.5 2004/01/29 09:53:18 dyoung Exp $        */
 
 /*
  * Copyright (c) 2003 The NetBSD Foundation, Inc.  All rights reserved.
@@ -49,6 +49,8 @@
 
 /* Macros for bit twiddling. */
 
+#ifndef _BIT_TWIDDLE
+#define _BIT_TWIDDLE
 /* nth bit, BIT(0) == 0x1. */
 #define BIT(n) (((n) == 32) ? 0 : ((u_int32_t) 1 << (n)))
 
@@ -87,6 +89,8 @@
 #define LSHIFT(x, mask) ((x) << MASK_TO_SHIFT(mask))
 #define MASK_AND_REPLACE(reg, val, mask) ((reg & ~mask) | LSHIFT(val, mask))
 
+#endif /* _BIT_TWIDDLE */
+
 /* ADM8211 Host Control and Status Registers */
 
 #define ATW_PAR                0x00    /* PCI access */



Home | Main Index | Thread Index | Old Index