From 05b758504d4d87cdba9d14c52c06b3be6347bf4d Mon Sep 17 00:00:00 2001 From: theStack Date: Wed, 16 Sep 2009 21:26:40 +0200 Subject: [PATCH] add macro for u32 little endian access from ppc --- usb/host/ohci.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/usb/host/ohci.c b/usb/host/ohci.c index 5e50dba..ed71c40 100644 --- a/usb/host/ohci.c +++ b/usb/host/ohci.c @@ -18,6 +18,14 @@ Copyright (C) 2009 Sebastian Falbesoner #include "host.h" #include "../usbspec/usb11spec.h" +// macro for accessing u32 variables that need to be in little endian byte order; +// whenever you read or write from an u32 field that the ohci host controller +// will read or write from too, use this macro for access! +#define ACCESS_LE(dword) ( ((dword & 0xFF000000) >> 24) | \ + ((dword & 0x00FF0000) >> 8) | \ + ((dword & 0x0000FF00) << 8) | \ + ((dword & 0x000000FF) << 24) ) + static struct ohci_hcca hcca_oh0; static struct endpoint_descriptor *allocate_endpoint() -- 2.25.1