aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/util.h
diff options
context:
space:
mode:
authorMichael Hope <michaelh@juju.net.nz>2011-08-31 20:45:44 +1200
committerMichael Hope <michaelh@juju.net.nz>2011-09-13 19:35:12 +1200
commit3f03c0c1edc74b3fb95f178a45a111a2d3381719 (patch)
tree0cd9a785f0491a823d38b3a6fb01fa48edbdfcfd /libmaple/util.h
parentcfede8b93422fa48f6240d53380934b4cbcc3d63 (diff)
downloadlibrambutan-3f03c0c1edc74b3fb95f178a45a111a2d3381719.tar.gz
librambutan-3f03c0c1edc74b3fb95f178a45a111a2d3381719.zip
Added more doxygen file level headers. Documented a few more functions.
Signed-off-by: Michael Hope <michaelh@juju.net.nz>
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)))
/*