feat/kernel: Added a physical page manager, has caching for single page alloc
This commit is contained in:
parent
e2d6cfceea
commit
2bbc7dd70f
8 changed files with 309 additions and 1 deletions
21
kernel/src/lib/bitmap.h
Normal file
21
kernel/src/lib/bitmap.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
#ifndef BITMAP_H
|
||||
#define BITMAP_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
static inline void bitmap_set(uint8_t *bitmap, uint64_t bit)
|
||||
{
|
||||
bitmap[bit / 8] |= 1 << (bit % 8);
|
||||
}
|
||||
|
||||
static inline void bitmap_clear(uint8_t *bitmap, uint64_t bit)
|
||||
{
|
||||
bitmap[bit / 8] &= ~(1 << (bit % 8));
|
||||
}
|
||||
|
||||
static inline uint8_t bitmap_get(uint8_t *bitmap, uint64_t bit)
|
||||
{
|
||||
return (bitmap[bit / 8] & (1 << (bit % 8))) != 0;
|
||||
}
|
||||
|
||||
#endif // BITMAP_H
|
Loading…
Add table
Add a link
Reference in a new issue