diff options
author | Marti Bolivar <mbolivar@leaflabs.com> | 2011-09-14 14:42:04 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@leaflabs.com> | 2011-09-14 14:42:04 -0400 |
commit | a9f14657020161fe8798e23489ce7b9489bbe815 (patch) | |
tree | 3b561e75b79b18c8bc851ba1b06ca1058050ebda /libmaple/util.h | |
parent | 5ba24f6befb6016410df398a049054cf34365895 (diff) | |
parent | 3f03c0c1edc74b3fb95f178a45a111a2d3381719 (diff) | |
download | librambutan-a9f14657020161fe8798e23489ce7b9489bbe815.tar.gz librambutan-a9f14657020161fe8798e23489ce7b9489bbe815.zip |
Merge remote branch 'nzmichaelh/comment-fixups-2'
Diffstat (limited to 'libmaple/util.h')
-rw-r--r-- | libmaple/util.h | 3 |
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))) /* |