PatchworkOS  321f6ec
A non-POSIX operating system.
Loading...
Searching...
No Matches
bitmap_clear.c
Go to the documentation of this file.
1#include <sys/bitmap.h>
2
4{
5 if (index >= map->length)
6 {
7 return;
8 }
9
10 uint64_t qwordIdx = index / 64;
11 uint64_t bitInQword = index % 64;
12 map->buffer[qwordIdx] &= ~(1ULL << bitInQword);
13 map->firstZeroIdx = MIN(map->firstZeroIdx, index);
14}
void bitmap_clear(bitmap_t *map, uint64_t index)
Clear a bit in the bitmap.
Definition bitmap_clear.c:3
#define MIN(x, y)
Definition math.h:16
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