Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Replace anonymous constants, 0x10, 0x14, ..., with P...



details:   https://anonhg.NetBSD.org/src/rev/4071839447f7
branches:  trunk
changeset: 767673:4071839447f7
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Tue Jul 26 20:51:23 2011 +0000

description:
Replace anonymous constants, 0x10, 0x14, ..., with PCI_BAR(0),
PCI_BAR(1), .... There was no change in the generated assembly.  I used
this semantic patch:

@ mapsit @
identifier bar;
expression pact;
@@

(
pci_mapreg_map
|
Cardbus_mapreg_map
)(pact, bar, ...)

@ depends on mapsit @
identifier mapsit.bar;
@@
(
- #define bar 0x10
+ #define bar PCI_BAR(0)
|
- #define bar 0x14
+ #define bar PCI_BAR(1)
|
- #define bar 0x18
+ #define bar PCI_BAR(2)
|
- #define bar 0x1C
+ #define bar PCI_BAR(3)
|
- #define bar 0x20
+ #define bar PCI_BAR(4)
)

diffstat:

 sys/dev/cardbus/if_ath_cardbus.c |   6 +++---
 sys/dev/cardbus/if_atw_cardbus.c |   8 ++++----
 sys/dev/cardbus/if_rtw_cardbus.c |   8 ++++----
 sys/dev/cardbus/if_tlp_cardbus.c |   8 ++++----
 sys/dev/pci/if_an_pci.c          |   6 +++---
 sys/dev/pci/if_ath_pci.c         |   6 +++---
 sys/dev/pci/if_atw_pci.c         |   8 ++++----
 sys/dev/pci/if_bwi_pci.c         |   6 +++---
 sys/dev/pci/if_en_pci.c          |   6 +++---
 sys/dev/pci/if_ep_pci.c          |   6 +++---
 sys/dev/pci/if_epic_pci.c        |   8 ++++----
 sys/dev/pci/if_esh_pci.c         |   8 ++++----
 sys/dev/pci/if_ex_pci.c          |   8 ++++----
 sys/dev/pci/if_le_pci.c          |   6 +++---
 sys/dev/pci/if_mtd_pci.c         |   8 ++++----
 sys/dev/pci/if_ne_pci.c          |   6 +++---
 sys/dev/pci/if_ntwoc_pci.c       |   8 ++++----
 sys/dev/pci/if_ral_pci.c         |   6 +++---
 sys/dev/pci/if_rtw_pci.c         |   8 ++++----
 sys/dev/pci/if_tlp_pci.c         |   8 ++++----
 sys/dev/pci/if_wi_pci.c          |  12 ++++++------
 21 files changed, 77 insertions(+), 77 deletions(-)

diffs (truncated from 598 to 300 lines):

diff -r 51b7300712b1 -r 4071839447f7 sys/dev/cardbus/if_ath_cardbus.c
--- a/sys/dev/cardbus/if_ath_cardbus.c  Tue Jul 26 17:03:23 2011 +0000
+++ b/sys/dev/cardbus/if_ath_cardbus.c  Tue Jul 26 20:51:23 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ath_cardbus.c,v 1.42 2010/03/04 22:34:37 dyoung Exp $ */
+/*     $NetBSD: if_ath_cardbus.c,v 1.43 2011/07/26 20:51:23 dyoung Exp $ */
 /*
  * Copyright (c) 2003
  *     Ichiro FUKUHARA <ichiro%ichiro.org@localhost>.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ath_cardbus.c,v 1.42 2010/03/04 22:34:37 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ath_cardbus.c,v 1.43 2011/07/26 20:51:23 dyoung Exp $");
 
 #include "opt_inet.h"
 
@@ -81,7 +81,7 @@
 /*
  * PCI configuration space registers
  */
-#define        ATH_PCI_MMBA            0x10    /* memory mapped base */
+#define ATH_PCI_MMBA PCI_BAR(0)        /* memory mapped base */
 
 struct ath_cardbus_softc {
        struct ath_softc        sc_ath;
diff -r 51b7300712b1 -r 4071839447f7 sys/dev/cardbus/if_atw_cardbus.c
--- a/sys/dev/cardbus/if_atw_cardbus.c  Tue Jul 26 17:03:23 2011 +0000
+++ b/sys/dev/cardbus/if_atw_cardbus.c  Tue Jul 26 20:51:23 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_atw_cardbus.c,v 1.34 2010/03/04 22:34:37 dyoung Exp $ */
+/* $NetBSD: if_atw_cardbus.c,v 1.35 2011/07/26 20:51:23 dyoung Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2003 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_atw_cardbus.c,v 1.34 2010/03/04 22:34:37 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_atw_cardbus.c,v 1.35 2011/07/26 20:51:23 dyoung Exp $");
 
 #include "opt_inet.h"
 
@@ -85,8 +85,8 @@
 /*
  * PCI configuration space registers used by the ADM8211.
  */
-#define        ATW_PCI_IOBA            0x10    /* i/o mapped base */
-#define        ATW_PCI_MMBA            0x14    /* memory mapped base */
+#define ATW_PCI_IOBA PCI_BAR(0)        /* i/o mapped base */
+#define ATW_PCI_MMBA PCI_BAR(1)        /* memory mapped base */
 
 struct atw_cardbus_softc {
        struct atw_softc sc_atw;
diff -r 51b7300712b1 -r 4071839447f7 sys/dev/cardbus/if_rtw_cardbus.c
--- a/sys/dev/cardbus/if_rtw_cardbus.c  Tue Jul 26 17:03:23 2011 +0000
+++ b/sys/dev/cardbus/if_rtw_cardbus.c  Tue Jul 26 20:51:23 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_rtw_cardbus.c,v 1.40 2010/03/05 00:54:01 dyoung Exp $ */
+/* $NetBSD: if_rtw_cardbus.c,v 1.41 2011/07/26 20:51:23 dyoung Exp $ */
 
 /*-
  * Copyright (c) 2004, 2005 David Young.  All rights reserved.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_rtw_cardbus.c,v 1.40 2010/03/05 00:54:01 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rtw_cardbus.c,v 1.41 2011/07/26 20:51:23 dyoung Exp $");
 
 #include "opt_inet.h"
 
@@ -105,8 +105,8 @@
 /*
  * PCI configuration space registers used by the RTL8180.
  */
-#define        RTW_PCI_IOBA            0x10    /* i/o mapped base */
-#define        RTW_PCI_MMBA            0x14    /* memory mapped base */
+#define RTW_PCI_IOBA PCI_BAR(0)        /* i/o mapped base */
+#define RTW_PCI_MMBA PCI_BAR(1)        /* memory mapped base */
 
 struct rtw_cardbus_softc {
        struct rtw_softc sc_rtw;        /* real RTL8180 softc */
diff -r 51b7300712b1 -r 4071839447f7 sys/dev/cardbus/if_tlp_cardbus.c
--- a/sys/dev/cardbus/if_tlp_cardbus.c  Tue Jul 26 17:03:23 2011 +0000
+++ b/sys/dev/cardbus/if_tlp_cardbus.c  Tue Jul 26 20:51:23 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_tlp_cardbus.c,v 1.68 2011/07/09 23:18:05 christos Exp $     */
+/*     $NetBSD: if_tlp_cardbus.c,v 1.69 2011/07/26 20:51:23 dyoung Exp $       */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tlp_cardbus.c,v 1.68 2011/07/09 23:18:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tlp_cardbus.c,v 1.69 2011/07/26 20:51:23 dyoung Exp $");
 
 #include "opt_inet.h"
 
@@ -82,8 +82,8 @@
 /*
  * PCI configuration space registers used by the Tulip.
  */
-#define        TULIP_PCI_IOBA          0x10    /* i/o mapped base */
-#define        TULIP_PCI_MMBA          0x14    /* memory mapped base */
+#define TULIP_PCI_IOBA PCI_BAR(0)      /* i/o mapped base */
+#define TULIP_PCI_MMBA PCI_BAR(1)      /* memory mapped base */
 #define        TULIP_PCI_CFDA          0x40    /* configuration driver area */
 
 #define        CFDA_SLEEP              0x80000000      /* sleep mode */
diff -r 51b7300712b1 -r 4071839447f7 sys/dev/pci/if_an_pci.c
--- a/sys/dev/pci/if_an_pci.c   Tue Jul 26 17:03:23 2011 +0000
+++ b/sys/dev/pci/if_an_pci.c   Tue Jul 26 20:51:23 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_an_pci.c,v 1.31 2009/11/26 15:17:09 njoly Exp $     */
+/*     $NetBSD: if_an_pci.c,v 1.32 2011/07/26 20:51:23 dyoung Exp $    */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_an_pci.c,v 1.31 2009/11/26 15:17:09 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_an_pci.c,v 1.32 2011/07/26 20:51:23 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -70,7 +70,7 @@
 #include <dev/pci/pcidevs.h>
 
 #define        AN_PCI_PLX_IOBA         0x14    /* i/o base for PLX chip */
-#define        AN_PCI_IOBA             0x18    /* i/o base */
+#define AN_PCI_IOBA PCI_BAR(2) /* i/o base */
 
 struct an_pci_softc {
        struct an_softc sc_an;          /* real "an" softc */
diff -r 51b7300712b1 -r 4071839447f7 sys/dev/pci/if_ath_pci.c
--- a/sys/dev/pci/if_ath_pci.c  Tue Jul 26 17:03:23 2011 +0000
+++ b/sys/dev/pci/if_ath_pci.c  Tue Jul 26 20:51:23 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ath_pci.c,v 1.41 2011/02/21 14:43:58 jmcneill Exp $ */
+/*     $NetBSD: if_ath_pci.c,v 1.42 2011/07/26 20:51:23 dyoung Exp $   */
 
 /*-
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ath_pci.c,v 1.41 2011/02/21 14:43:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ath_pci.c,v 1.42 2011/07/26 20:51:23 dyoung Exp $");
 
 /*
  * PCI/Cardbus front-end for the Atheros Wireless LAN controller driver.
@@ -62,7 +62,7 @@
 /*
  * PCI configuration space registers
  */
-#define        ATH_PCI_MMBA            0x10    /* memory mapped base */
+#define ATH_PCI_MMBA PCI_BAR(0)        /* memory mapped base */
 
 struct ath_pci_softc {
        struct ath_softc        sc_sc;
diff -r 51b7300712b1 -r 4071839447f7 sys/dev/pci/if_atw_pci.c
--- a/sys/dev/pci/if_atw_pci.c  Tue Jul 26 17:03:23 2011 +0000
+++ b/sys/dev/pci/if_atw_pci.c  Tue Jul 26 20:51:23 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_atw_pci.c,v 1.24 2010/02/24 22:38:00 dyoung Exp $   */
+/*     $NetBSD: if_atw_pci.c,v 1.25 2011/07/26 20:51:24 dyoung Exp $   */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_atw_pci.c,v 1.24 2010/02/24 22:38:00 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_atw_pci.c,v 1.25 2011/07/26 20:51:24 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -75,8 +75,8 @@
 /*
  * PCI configuration space registers used by the ADM8211.
  */
-#define        ATW_PCI_IOBA            0x10    /* i/o mapped base */
-#define        ATW_PCI_MMBA            0x14    /* memory mapped base */
+#define ATW_PCI_IOBA PCI_BAR(0)        /* i/o mapped base */
+#define ATW_PCI_MMBA PCI_BAR(1)        /* memory mapped base */
 
 struct atw_pci_softc {
        struct atw_softc        psc_atw;        /* real ADM8211 softc */
diff -r 51b7300712b1 -r 4071839447f7 sys/dev/pci/if_bwi_pci.c
--- a/sys/dev/pci/if_bwi_pci.c  Tue Jul 26 17:03:23 2011 +0000
+++ b/sys/dev/pci/if_bwi_pci.c  Tue Jul 26 20:51:23 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bwi_pci.c,v 1.11 2011/05/18 01:02:43 dyoung Exp $   */
+/*     $NetBSD: if_bwi_pci.c,v 1.12 2011/07/26 20:51:24 dyoung Exp $   */
 /*     $OpenBSD: if_bwi_pci.c,v 1.6 2008/02/14 22:10:02 brad Exp $ */
 
 /*
@@ -24,7 +24,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bwi_pci.c,v 1.11 2011/05/18 01:02:43 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bwi_pci.c,v 1.12 2011/07/26 20:51:24 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/callout.h>
@@ -54,7 +54,7 @@
 #include <dev/pci/pcidevs.h>
 
 /* Base Address Register */
-#define BWI_PCI_BAR0   0x10
+#define BWI_PCI_BAR0 PCI_BAR(0)
 
 static int     bwi_pci_match(device_t, cfdata_t, void *);
 static void    bwi_pci_attach(device_t, device_t, void *);
diff -r 51b7300712b1 -r 4071839447f7 sys/dev/pci/if_en_pci.c
--- a/sys/dev/pci/if_en_pci.c   Tue Jul 26 17:03:23 2011 +0000
+++ b/sys/dev/pci/if_en_pci.c   Tue Jul 26 20:51:23 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_en_pci.c,v 1.35 2011/07/18 00:58:51 mrg Exp $       */
+/*     $NetBSD: if_en_pci.c,v 1.36 2011/07/26 20:51:24 dyoung Exp $    */
 
 /*
  * Copyright (c) 1996 Charles D. Cranor and Washington University.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_en_pci.c,v 1.35 2011/07/18 00:58:51 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_en_pci.c,v 1.36 2011/07/26 20:51:24 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -85,7 +85,7 @@
  * (this is card specific)
  */
 
-#define PCI_CBMA        0x10
+#define PCI_CBMA PCI_BAR(0)
 
 /*
  * tonga (pci bridge).   ENI cards only!
diff -r 51b7300712b1 -r 4071839447f7 sys/dev/pci/if_ep_pci.c
--- a/sys/dev/pci/if_ep_pci.c   Tue Jul 26 17:03:23 2011 +0000
+++ b/sys/dev/pci/if_ep_pci.c   Tue Jul 26 20:51:23 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ep_pci.c,v 1.51 2009/11/26 15:17:09 njoly Exp $     */
+/*     $NetBSD: if_ep_pci.c,v 1.52 2011/07/26 20:51:24 dyoung Exp $    */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ep_pci.c,v 1.51 2009/11/26 15:17:09 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ep_pci.c,v 1.52 2011/07/26 20:51:24 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -95,7 +95,7 @@
 /*
  * PCI constants.
  */
-#define PCI_CBIO               0x10    /* Configuration Base IO Address */
+#define PCI_CBIO PCI_BAR(0)    /* Configuration Base IO Address */
 
 static int     ep_pci_match(device_t , cfdata_t, void *);
 static void    ep_pci_attach(device_t , device_t , void *);
diff -r 51b7300712b1 -r 4071839447f7 sys/dev/pci/if_epic_pci.c
--- a/sys/dev/pci/if_epic_pci.c Tue Jul 26 17:03:23 2011 +0000
+++ b/sys/dev/pci/if_epic_pci.c Tue Jul 26 20:51:23 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_epic_pci.c,v 1.38 2009/11/26 15:17:09 njoly Exp $   */
+/*     $NetBSD: if_epic_pci.c,v 1.39 2011/07/26 20:51:24 dyoung Exp $  */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_epic_pci.c,v 1.38 2009/11/26 15:17:09 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_epic_pci.c,v 1.39 2011/07/26 20:51:24 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -68,8 +68,8 @@
 /*
  * PCI configuration space registers used by the EPIC.
  */



Home | Main Index | Thread Index | Old Index