From aab012d713e801891aa11b6654bb9128da89d20f Mon Sep 17 00:00:00 2001 From: Alejandro Sior Date: Fri, 29 Jul 2022 10:44:07 +0200 Subject: rt/stddef.h: add the LOWER macro --- rt/stddef.h | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.3