summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2010-05-01 19:43:58 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2010-05-01 19:43:58 +0000
commit1cf0cd9e3ed84fb82b2490d8d3c049801f3078d9 (patch)
treeb65799ffd08c8dc85df811687290cf17596805f7
parent33561422fb73d3271a4a72295623b2689cd818f2 (diff)
put the read macros into functions so gcc4 doesn't whinge.
ok marco@ oga@ miod@
-rw-r--r--sys/dev/usb/ohci.c26
-rw-r--r--sys/dev/usb/uhci.c26
2 files changed, 44 insertions, 8 deletions
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index 58e9e1d6b06..b73a1be666c 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohci.c,v 1.94 2009/11/26 12:27:48 deraadt Exp $ */
+/* $OpenBSD: ohci.c,v 1.95 2010/05/01 19:43:57 jsg Exp $ */
/* $NetBSD: ohci.c,v 1.139 2003/02/22 05:24:16 tsutsui Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
@@ -196,9 +196,27 @@ void ohci_dump_itds(ohci_soft_itd_t *);
do { OBARR(sc); bus_space_write_2((sc)->iot, (sc)->ioh, (r), (x)); } while (0)
#define OWRITE4(sc, r, x) \
do { OBARR(sc); bus_space_write_4((sc)->iot, (sc)->ioh, (r), (x)); } while (0)
-#define OREAD1(sc, r) (OBARR(sc), bus_space_read_1((sc)->iot, (sc)->ioh, (r)))
-#define OREAD2(sc, r) (OBARR(sc), bus_space_read_2((sc)->iot, (sc)->ioh, (r)))
-#define OREAD4(sc, r) (OBARR(sc), bus_space_read_4((sc)->iot, (sc)->ioh, (r)))
+
+static __inline u_int8_t
+OREAD1(ohci_softc_t *sc, bus_size_t r)
+{
+ OBARR(sc);
+ return bus_space_read_1(sc->iot, sc->ioh, r);
+}
+
+static __inline u_int16_t
+OREAD2(ohci_softc_t *sc, bus_size_t r)
+{
+ OBARR(sc);
+ return bus_space_read_2(sc->iot, sc->ioh, r);
+}
+
+static __inline u_int32_t
+OREAD4(ohci_softc_t *sc, bus_size_t r)
+{
+ OBARR(sc);
+ return bus_space_read_4(sc->iot, sc->ioh, r);
+}
/* Reverse the bits in a value 0 .. 31 */
u_int8_t revbits[OHCI_NO_INTRS] =
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index 71b1e014ccd..c3adf3c8b1b 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhci.c,v 1.74 2009/11/26 12:27:48 deraadt Exp $ */
+/* $OpenBSD: uhci.c,v 1.75 2010/05/01 19:43:57 jsg Exp $ */
/* $NetBSD: uhci.c,v 1.172 2003/02/23 04:19:26 simonb Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -249,9 +249,27 @@ void uhci_dump(void);
#define UWRITE4(sc, r, x) \
do { UBARR(sc); bus_space_write_4((sc)->iot, (sc)->ioh, (r), (x)); \
} while (/*CONSTCOND*/0)
-#define UREAD1(sc, r) (UBARR(sc), bus_space_read_1((sc)->iot, (sc)->ioh, (r)))
-#define UREAD2(sc, r) (UBARR(sc), bus_space_read_2((sc)->iot, (sc)->ioh, (r)))
-#define UREAD4(sc, r) (UBARR(sc), bus_space_read_4((sc)->iot, (sc)->ioh, (r)))
+
+static __inline u_int8_t
+UREAD1(uhci_softc_t *sc, bus_size_t r)
+{
+ UBARR(sc);
+ return bus_space_read_1(sc->iot, sc->ioh, r);
+}
+
+static __inline u_int16_t
+UREAD2(uhci_softc_t *sc, bus_size_t r)
+{
+ UBARR(sc);
+ return bus_space_read_2(sc->iot, sc->ioh, r);
+}
+
+static __inline u_int32_t
+UREAD4(uhci_softc_t *sc, bus_size_t r)
+{
+ UBARR(sc);
+ return bus_space_read_4(sc->iot, sc->ioh, r);
+}
#define UHCICMD(sc, cmd) UWRITE2(sc, UHCI_CMD, cmd)
#define UHCISTS(sc) UREAD2(sc, UHCI_STS)