[coreboot-gerrit] New patch to review for coreboot: 2b59258 include/types.h: Provide BIT() macro

Alexandru Gagniuc (mr.nuke.me@gmail.com) gerrit at coreboot.org
Mon Jan 26 04:10:09 CET 2015


Alexandru Gagniuc (mr.nuke.me at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8280

-gerrit

commit 2b5925820d33858b5d2ac80f412be0fcef7530c1
Author: Alexandru Gagniuc <mr.nuke.me at gmail.com>
Date:   Sun Jan 25 21:08:42 2015 -0600

    include/types.h: Provide BIT() macro
    
    Change-Id: I86cd8a16420f34ef31b615aec4e0f7bd3191ca35
    Signed-off-by: Alexandru Gagniuc <mr.nuke.me at gmail.com>
---
 src/include/types.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/include/types.h b/src/include/types.h
index ef5edc1..efdb4a7 100644
--- a/src/include/types.h
+++ b/src/include/types.h
@@ -22,6 +22,13 @@
 #include <stdint.h>
 #include <stddef.h>
 
+/*
+ * 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)				(1x << (nr))
+
 /**
  * Coreboot error codes
  *



More information about the coreboot-gerrit mailing list