summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uhci.c
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2002-03-16 12:44:21 +0000
committerjoe <joe@FreeBSD.org>2002-03-16 12:44:21 +0000
commit6c63fbbb0ce1ddb7ddd300846dc26ee0cb394c60 (patch)
tree756028c4a6bf248a3efd69c11acf7e29d11b50aa /sys/dev/usb/uhci.c
parent5bfc3567ae33db403bcd3c94c80335e8a81a9641 (diff)
downloadFreeBSD-src-6c63fbbb0ce1ddb7ddd300846dc26ee0cb394c60.zip
FreeBSD-src-6c63fbbb0ce1ddb7ddd300846dc26ee0cb394c60.tar.gz
Merge from NetBSD:
ohcivar.h (1.22), uhcivar.h (1.29): ============================================================ date: 2000/04/25 09:20:55; author: augustss; Move the size of the mapped bus_space region into the bus independent softc. ============================================================ ohci.c (1.88), uhci.c (1.112): ============================================================ date: 2000/04/25 14:28:13; author: augustss; Insert (very conservative!) bus_space_barrier() calls at all register accesses. The bus_space(9) man page says you've gotta have them... ============================================================
Diffstat (limited to 'sys/dev/usb/uhci.c')
-rw-r--r--sys/dev/usb/uhci.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index fb7b305..04330c5 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uhci.c,v 1.109 2000/04/06 23:44:20 augustss Exp $ */
+/* $NetBSD: uhci.c,v 1.112 2000/04/25 14:28:14 augustss Exp $ */
/* $FreeBSD$ */
/*
@@ -263,12 +263,17 @@ Static void uhci_dump_ii(uhci_intr_info_t *ii);
void uhci_dump(void);
#endif
-#define UWRITE1(sc, r, x) bus_space_write_1((sc)->iot, (sc)->ioh, (r), (x))
-#define UWRITE2(sc, r, x) bus_space_write_2((sc)->iot, (sc)->ioh, (r), (x))
-#define UWRITE4(sc, r, x) bus_space_write_4((sc)->iot, (sc)->ioh, (r), (x))
-#define UREAD1(sc, r) bus_space_read_1((sc)->iot, (sc)->ioh, (r))
-#define UREAD2(sc, r) bus_space_read_2((sc)->iot, (sc)->ioh, (r))
-#define UREAD4(sc, r) bus_space_read_4((sc)->iot, (sc)->ioh, (r))
+#define UBARR(sc) bus_space_barrier((sc)->iot, (sc)->ioh, 0, (sc)->sc_size, \
+ BUS_SPACE_BARRIER_READ|BUS_SPACE_BARRIER_WRITE)
+#define UWRITE1(sc, r, x) \
+ do { UBARR(sc); bus_space_write_1((sc)->iot, (sc)->ioh, (r), (x)); } while (0)
+#define UWRITE2(sc, r, x) \
+ do { UBARR(sc); bus_space_write_2((sc)->iot, (sc)->ioh, (r), (x)); } while (0)
+#define UWRITE4(sc, r, x) \
+ do { UBARR(sc); bus_space_write_4((sc)->iot, (sc)->ioh, (r), (x)); } while (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)))
#define UHCICMD(sc, cmd) UWRITE2(sc, UHCI_CMD, cmd)
#define UHCISTS(sc) UREAD2(sc, UHCI_STS)
OpenPOWER on IntegriCloud