PatchworkOS  321f6ec
A non-POSIX operating system.
Loading...
Searching...
No Matches
bitmap_is_set.c
Go to the documentation of this file.
1#include <sys/bitmap.h>
2
4{
5 if (idx >= map->length)
6 {
7 return false;
8 }
9
10 uint64_t qwordIdx = idx / 64;
11 uint64_t bitInQword = idx % 64;
12 return (map->buffer[qwordIdx] & (1ULL << bitInQword));
13}
bool bitmap_is_set(bitmap_t *map, uint64_t idx)
Check if a bit is set in the bitmap.
boot_memory_map_t * map
Definition mem.c:19
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
Bitmap structure.
Definition bitmap.h:22
uint64_t length
Definition boot_info.h:58