summaryrefslogtreecommitdiffstats
path: root/include/common.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-08-07 20:34:39 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-08-07 20:34:39 +0200
commit45615e3ec10c38298c1b9780e13a884aff49bae1 (patch)
tree9846c95af6152cbce9e7891e26f6503054e2f6b1 /include/common.h
parent7782c08047fc44874caf1c03c153a070f9ac557a (diff)
parent92466472c2116b93ef5ed957a559fe84b9d88c80 (diff)
downloadbarebox-45615e3ec10c38298c1b9780e13a884aff49bae1.tar.gz
barebox-45615e3ec10c38298c1b9780e13a884aff49bae1.tar.xz
Merge branch 'for-next/usb-host'
Conflicts: drivers/usb/core/Makefile
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h
index ca817aac4f..de635718d2 100644
--- a/include/common.h
+++ b/include/common.h
@@ -282,6 +282,22 @@ void barebox_set_hostname(const char *);
} \
)
+/**
+ * upper_32_bits - return bits 32-63 of a number
+ * @n: the number we're accessing
+ *
+ * A basic shift-right of a 64- or 32-bit quantity. Use this to suppress
+ * the "right shift count >= width of type" warning when that quantity is
+ * 32-bits.
+ */
+#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
+
+/**
+ * lower_32_bits - return bits 0-31 of a number
+ * @n: the number we're accessing
+ */
+#define lower_32_bits(n) ((u32)(n))
+
#define abs(x) ({ \
long __x = (x); \
(__x < 0) ? -__x : __x; \