feat: DTB now populates VMBootMemoryMap structure.

This commit is contained in:
karina
2026-04-26 13:32:44 +04:00
parent a05b51fca3
commit 785a61b451
8 changed files with 109 additions and 14 deletions
+22
View File
@@ -0,0 +1,22 @@
#include <VM/PMM.h>
static inline Size BitmapGetByteIndex(Address address) {
return (address / kVMPageSize) / kVMBlocksPerByte;
}
static inline UInt8 BitmapGetBitOffset(Address address) {
return (UInt8)((address / kVMPageSize) % kVMBlocksPerByte);
}
static inline Boolean BitmapTest(const MemoryPointer bitmap, Address address) {
return (bitmap[BitmapGetByteIndex(address)] & (1U << BitmapGetBitOffset(address))) != 0;
}
static inline void BitmapSet(MemoryPointer bitmap, Address address) {
bitmap[BitmapGetByteIndex(address)] |= (1U << BitmapGetBitOffset(address));
}
static inline void BitmapUnset(MemoryPointer bitmap, Address address) {
bitmap[BitmapGetByteIndex(address)] &= ~(1U << BitmapGetBitOffset(address));
}