aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/include/sys/param.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/include/sys/param.h b/sys/include/sys/param.h
index 91566ae..d6c5a2b 100644
--- a/sys/include/sys/param.h
+++ b/sys/include/sys/param.h
@@ -38,6 +38,10 @@
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
+/* Align up/down a value */
+#define ALIGN_DOWN(value, align) ((value) & ~((align)-1))
+#define ALIGN_UP(value, align) (((value) + (align)-1) & ~((align)-1))
+
/* Bitmap helper macros */
#define setbit(a, b) ((a)[(b) >> 3] |= BIT(b % 8))
#define clrbit(a, b) ((a)[(b) >> 3] &= ~BIT(b % 8))