diff options
author | joe <joe@FreeBSD.org> | 2002-03-16 12:44:21 +0000 |
---|---|---|
committer | joe <joe@FreeBSD.org> | 2002-03-16 12:44:21 +0000 |
commit | 6c63fbbb0ce1ddb7ddd300846dc26ee0cb394c60 (patch) | |
tree | 756028c4a6bf248a3efd69c11acf7e29d11b50aa /sys/dev | |
parent | 5bfc3567ae33db403bcd3c94c80335e8a81a9641 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/dev/usb/ohci.c | 14 | ||||
-rw-r--r-- | sys/dev/usb/ohcivar.h | 1 | ||||
-rw-r--r-- | sys/dev/usb/uhci.c | 19 | ||||
-rw-r--r-- | sys/dev/usb/uhcivar.h | 3 |
4 files changed, 26 insertions, 11 deletions
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c index cecc642..64e62b9 100644 --- a/sys/dev/usb/ohci.c +++ b/sys/dev/usb/ohci.c @@ -199,9 +199,17 @@ Static void ohci_dump_td(ohci_soft_td_t *); Static void ohci_dump_ed(ohci_soft_ed_t *); #endif -#define OWRITE4(sc, r, x) bus_space_write_4((sc)->iot, (sc)->ioh, (r), (x)) -#define OREAD4(sc, r) bus_space_read_4((sc)->iot, (sc)->ioh, (r)) -#define OREAD2(sc, r) bus_space_read_2((sc)->iot, (sc)->ioh, (r)) +#define OBARR(sc) bus_space_barrier((sc)->iot, (sc)->ioh, 0, (sc)->sc_size, \ + BUS_SPACE_BARRIER_READ|BUS_SPACE_BARRIER_WRITE) +#define OWRITE1(sc, r, x) \ + do { OBARR(sc); bus_space_write_1((sc)->iot, (sc)->ioh, (r), (x)); } while (0) +#define OWRITE2(sc, r, x) \ + 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))) /* Reverse the bits in a value 0 .. 31 */ Static u_int8_t revbits[OHCI_NO_INTRS] = diff --git a/sys/dev/usb/ohcivar.h b/sys/dev/usb/ohcivar.h index b72ccba..1aae723 100644 --- a/sys/dev/usb/ohcivar.h +++ b/sys/dev/usb/ohcivar.h @@ -78,6 +78,7 @@ typedef struct ohci_softc { struct usbd_bus sc_bus; /* base device */ bus_space_tag_t iot; bus_space_handle_t ioh; + bus_size_t sc_size; #if defined(__FreeBSD__) void *ih; 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) diff --git a/sys/dev/usb/uhcivar.h b/sys/dev/usb/uhcivar.h index 7afd849..a47ff25 100644 --- a/sys/dev/usb/uhcivar.h +++ b/sys/dev/usb/uhcivar.h @@ -1,4 +1,4 @@ -/* $NetBSD: uhcivar.h,v 1.28 2000/04/06 23:44:21 augustss Exp $ */ +/* $NetBSD: uhcivar.h,v 1.29 2000/04/25 09:20:55 augustss Exp $ */ /* $FreeBSD$ */ /* @@ -134,6 +134,7 @@ typedef struct uhci_softc { struct usbd_bus sc_bus; /* base device */ bus_space_tag_t iot; bus_space_handle_t ioh; + bus_size_t sc_size; #if defined(__FreeBSD__) void *ih; |