summaryrefslogtreecommitdiff
path: root/sys/dev/usb/usb.h
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-07-12 18:12:56 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-07-12 18:12:56 +0000
commit1282329ae695a6e84b13923222ed08aeedb21427 (patch)
tree3e044dd45dc2974b875ca66d0e4c2a6c3421315d /sys/dev/usb/usb.h
parent95443bf24a481ebfbc4b02e12cb314ea7061759f (diff)
Do not split multibyte access on little endian architectures with no alignment
requirements; ok krw@
Diffstat (limited to 'sys/dev/usb/usb.h')
-rw-r--r--sys/dev/usb/usb.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h
index 80dfa366b19..235c66417e1 100644
--- a/sys/dev/usb/usb.h
+++ b/sys/dev/usb/usb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb.h,v 1.24 2006/06/23 19:25:07 miod Exp $ */
+/* $OpenBSD: usb.h,v 1.25 2006/07/12 18:12:55 miod Exp $ */
/* $NetBSD: usb.h,v 1.69 2002/09/22 23:20:50 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb.h,v 1.14 1999/11/17 22:33:46 n_hibma Exp $ */
@@ -81,7 +81,7 @@ typedef u_int8_t uDWord[4];
#define USETW2(w,h,l) ((w)[0] = (u_int8_t)(l), (w)[1] = (u_int8_t)(h))
-#if 1
+#if defined(__STRICT_ALIGNMENT) || _BYTE_ORDER != _LITTLE_ENDIAN
#define UGETW(w) ((w)[0] | ((w)[1] << 8))
#define USETW(w,v) ((w)[0] = (u_int8_t)(v), (w)[1] = (u_int8_t)((v) >> 8))
#define UGETDW(w) ((w)[0] | ((w)[1] << 8) | ((w)[2] << 16) | ((w)[3] << 24))