diff options
author | 2000-11-11 16:23:30 +0000 | |
---|---|---|
committer | 2000-11-11 16:23:30 +0000 | |
commit | 4eeb076cdc2d4b1571261de279ad79778c080f12 (patch) | |
tree | 27da178366a337a65442ab31eef3a40a50bf898e | |
parent | allow prompt to be specified anywhere on the command line, make it work (diff) | |
download | wireguard-openbsd-4eeb076cdc2d4b1571261de279ad79778c080f12.tar.xz wireguard-openbsd-4eeb076cdc2d4b1571261de279ad79778c080f12.zip |
Change the le32toh() le16toh() macros back to the previous defintion.
This change is more portable, redefine the macros to use the host
letoh32/letoh16 instead of using possibly less efficient bswap routines.
-rw-r--r-- | sys/dev/usb/ohci.c | 16 | ||||
-rw-r--r-- | sys/dev/usb/uhci.c | 16 | ||||
-rw-r--r-- | sys/dev/usb/usb_port.h | 12 |
3 files changed, 13 insertions, 31 deletions
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c index 90de79ce567..be0f54d3fa5 100644 --- a/sys/dev/usb/ohci.c +++ b/sys/dev/usb/ohci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ohci.c,v 1.15 2000/11/08 18:10:37 aaron Exp $ */ +/* $OpenBSD: ohci.c,v 1.16 2000/11/11 16:23:30 drahn Exp $ */ /* $NetBSD: ohci.c,v 1.93 2000/08/17 23:18:56 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */ @@ -101,20 +101,6 @@ int ohcidebug = 0; #define DPRINTFN(n,x) #endif -/* - * The OHCI controller is little endian, so on big endian machines - * the data strored in memory needs to be swapped. - */ -#if defined(__FreeBSD__) || defined(__OpenBSD__) -#if BYTE_ORDER == BIG_ENDIAN -#define htole32(x) (bswap32(x)) -#define le32toh(x) (bswap32(x)) -#else -#define htole32(x) (x) -#define le32toh(x) (x) -#endif -#endif - struct ohci_pipe; Static ohci_soft_ed_t *ohci_alloc_sed(ohci_softc_t *); diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c index 0e003af212e..12208439d10 100644 --- a/sys/dev/usb/uhci.c +++ b/sys/dev/usb/uhci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhci.c,v 1.15 2000/11/08 18:10:38 aaron Exp $ */ +/* $OpenBSD: uhci.c,v 1.16 2000/11/11 16:23:30 drahn Exp $ */ /* $NetBSD: uhci.c,v 1.125 2000/09/23 21:00:10 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */ @@ -110,20 +110,6 @@ int uhcinoloop = 0; #define DPRINTFN(n,x) #endif -/* - * The UHCI controller is little endian, so on big endian machines - * the data strored in memory needs to be swapped. - */ -#if defined(__FreeBSD__) || defined(__OpenBSD__) -#if BYTE_ORDER == BIG_ENDIAN -#define htole32(x) (bswap32(x)) -#define le32toh(x) (bswap32(x)) -#else -#define htole32(x) (x) -#define le32toh(x) (x) -#endif -#endif - struct uhci_pipe { struct usbd_pipe pipe; int nexttoggle; diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h index 9408c28e9c5..484638df9ed 100644 --- a/sys/dev/usb/usb_port.h +++ b/sys/dev/usb/usb_port.h @@ -1,4 +1,4 @@ -/* $OpenBSD: usb_port.h,v 1.19 2000/11/08 18:10:39 aaron Exp $ */ +/* $OpenBSD: usb_port.h,v 1.20 2000/11/11 16:23:30 drahn Exp $ */ /* $NetBSD: usb_port.h,v 1.35 2000/09/23 04:32:23 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb_port.h,v 1.21 1999/11/17 22:33:47 n_hibma Exp $ */ @@ -226,6 +226,16 @@ __CONCAT(dname,_detach)(self, flags) \ #define bswap32(x) swap32(x) #define bswap16(x) swap16(x) +/* + * The UHCI/OHCI controllers are little endian, so on big endian machines + * the data strored in memory needs to be swapped. + */ + +#if defined(letoh32) +#define le32toh(x) letoh32(x) +#define le16toh(x) letoh16(x) +#endif + #define usb_kthread_create1 kthread_create #define usb_kthread_create kthread_create_deferred |