2023-05-18 11:00:05 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
namespace phys_mem {
|
|
|
|
|
|
|
|
// Called before creating a kernel heap object
|
|
|
|
// that allows dynamic allocation. The real
|
|
|
|
// PhysicalMemoryManager requires some allocations
|
|
|
|
// to initialize so we need this first.
|
|
|
|
void InitBootstrapPageAllocation();
|
|
|
|
|
2023-06-19 23:44:33 -07:00
|
|
|
// Initializes the main physical memory manager.
|
2023-05-18 11:00:05 -07:00
|
|
|
void InitPhysicalMemoryManager();
|
|
|
|
|
2023-11-08 08:07:57 -08:00
|
|
|
void DumpRegions();
|
|
|
|
|
2023-05-18 11:00:05 -07:00
|
|
|
uint64_t AllocatePage();
|
2023-06-19 23:44:33 -07:00
|
|
|
uint64_t AllocateAndZeroPage();
|
|
|
|
|
2023-06-12 19:20:51 -07:00
|
|
|
uint64_t AllocateContinuous(uint64_t num_pages);
|
2023-05-18 11:00:05 -07:00
|
|
|
void FreePage(uint64_t page);
|
|
|
|
|
|
|
|
} // namespace phys_mem
|