From a4d784eeab964a9cdb8e453ae98a14520ce13919 Mon Sep 17 00:00:00 2001 From: Alexandru Gagniuc Date: Sun, 25 Jan 2015 21:08:42 -0600 Subject: include/types.h: Provide BIT() macro This macro is controversial for arches where the bits are numbered MSb first, though we don't support such an arch. We've seen this macro creep into our tree in different places, so provide it in one place. Change-Id: I86cd8a16420f34ef31b615aec4e0f7bd3191ca35 Signed-off-by: Alexandru Gagniuc Reviewed-on: http://review.coreboot.org/8280 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Stefan Reinauer Reviewed-by: Aaron Durbin Reviewed-by: David Hendricks --- src/include/types.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/include/types.h') diff --git a/src/include/types.h b/src/include/types.h index ef5edc1781..24ebfafc54 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -22,6 +22,13 @@ #include #include +/* + * This may mean something else on architectures where the bits are numbered + * from the MSB (e.g. PowerPC), but until we cross that bridge, this macro is + * perfectly fine. + */ +#define BIT(x) (1ul << (x)) + /** * Coreboot error codes * -- cgit v1.2.3