From 9bc0e2580181fb640a0f3cf972af53ebda7be649 Mon Sep 17 00:00:00 2001 From: Matheus Date: Mon, 27 Apr 2026 00:05:18 -0300 Subject: [PATCH] bitmap: add BITMAP_DEFINE_STATIC --- kernel-src/include/bitmap.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel-src/include/bitmap.h b/kernel-src/include/bitmap.h index e431325c..faa9bf84 100644 --- a/kernel-src/include/bitmap.h +++ b/kernel-src/include/bitmap.h @@ -3,6 +3,7 @@ #include #include +#include typedef struct { long *data; @@ -16,4 +17,11 @@ void bitmap_set_range(bitmap_t *bitmap, long start, long count, int v); bool bitmap_get(bitmap_t *bitmap, long idx); long bitmap_find_first_set(bitmap_t *bitmap); +#define BITMAP_DEFINE_STATIC(name, s) \ + static long entries_bm_##name[ROUND_UP(s, sizeof(long)) / sizeof(long)]; \ + static bitmap_t name = { \ + .size = s, \ + .data = entries_bm_##name \ + } + #endif