MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / MarkMemoryRegionFree

Function MarkMemoryRegionFree

Kernel/src/arch/x86_64/physicalallocator.cpp:61–64  ·  view source on GitHub ↗

Marks a region in physical memory as being free

Source from the content-addressed store, hash-verified

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() {

Callers 1

InitCoreFunction · 0.85

Calls 1

ClearBitFunction · 0.85

Tested by

no test coverage detected