Marks a region in physical memory as being free
| 59 | |
| 60 | // Marks a region in physical memory as being free |
| 61 | void MarkMemoryRegionFree(uint64_t base, size_t size) { |
| 62 | for (uint32_t blocks = (size + (PHYSALLOC_BLOCK_SIZE - 1)) / PHYSALLOC_BLOCK_SIZE, align = base / PHYSALLOC_BLOCK_SIZE; blocks > 0; blocks--, usedPhysicalBlocks--) |
| 63 | ClearBit(align++); |
| 64 | } |
| 65 | |
| 66 | // Allocates a block of physical memory |
| 67 | uint64_t AllocatePhysicalMemoryBlock() { |