aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/util.h
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-09-14 14:42:04 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2011-09-14 14:42:04 -0400
commita9f14657020161fe8798e23489ce7b9489bbe815 (patch)
tree3b561e75b79b18c8bc851ba1b06ca1058050ebda /libmaple/util.h
parent5ba24f6befb6016410df398a049054cf34365895 (diff)
parent3f03c0c1edc74b3fb95f178a45a111a2d3381719 (diff)
downloadlibrambutan-a9f14657020161fe8798e23489ce7b9489bbe815.tar.gz
librambutan-a9f14657020161fe8798e23489ce7b9489bbe815.zip
Merge remote branch 'nzmichaelh/comment-fixups-2'
Diffstat (limited to 'libmaple/util.h')
-rw-r--r--libmaple/util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libmaple/util.h b/libmaple/util.h
index 080f1bf..7b41769 100644
--- a/libmaple/util.h
+++ b/libmaple/util.h
@@ -42,10 +42,13 @@ extern "C"{
* Bit manipulation
*/
+/** 1 << the bit number */
#define BIT(shift) (1UL << (shift))
+/** Mask shifted left by 'shift' */
#define BIT_MASK_SHIFT(mask, shift) ((mask) << (shift))
/** Bits m to n of x */
#define GET_BITS(x, m, n) ((((uint32)x) << (31 - (n))) >> ((31 - (n)) + (m)))
+/** True if v is a power of two (1, 2, 4, 8, ...) */
#define IS_POWER_OF_TWO(v) ((v) && !((v) & ((v) - 1)))
/*