summaryrefslogtreecommitdiff
path: root/rt
diff options
context:
space:
mode:
authorAlejandro Sior <aho@sior.be>2022-07-29 10:44:07 +0200
committerAlejandro Sior <aho@sior.be>2022-07-29 10:44:07 +0200
commitaab012d713e801891aa11b6654bb9128da89d20f (patch)
tree0ddce08d5ae9401ed7dd00b54892ebaf646fc03f /rt
parent3e88a00f88e39420c44fcdcea873c8b0c3f6f105 (diff)
rt/stddef.h: add the LOWER macro
Diffstat (limited to 'rt')
-rw-r--r--rt/stddef.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/rt/stddef.h b/rt/stddef.h
index 83d9957..0064316 100644
--- a/rt/stddef.h
+++ b/rt/stddef.h
@@ -3,6 +3,10 @@
#define nil ((void*)0)
+/* Generate a number with the x lowest bits set to 1 */
+#define LOWER(X) ((1 << (X)) - 1)
+
+/* Align a number to the upper boundary */
#define ALIGN_UP(X, F) ((X) - (X) % (F) + (F))
#endif \ No newline at end of file