36 lines
681 B
C
36 lines
681 B
C
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
// Copyright (c) 2026 0xKSor
|
|
|
|
#pragma once
|
|
#include <Types.h>
|
|
|
|
enum {
|
|
kVMPageSize = 4096,
|
|
kVMBlocksPerByte = 8,
|
|
kVMMaxReservedRegions = 256,
|
|
kPMMReservedRegionCount = 3,
|
|
};
|
|
|
|
typedef struct {
|
|
UInt64 base;
|
|
Size size;
|
|
} VMMemoryRegion;
|
|
|
|
typedef struct {
|
|
VMMemoryRegion GICD;
|
|
VMMemoryRegion GICC;
|
|
} GICRegion;
|
|
|
|
|
|
typedef struct {
|
|
VMMemoryRegion totalRAM;
|
|
VMMemoryRegion reserved[kVMMaxReservedRegions];
|
|
UInt32 reservedCount;
|
|
VMMemoryRegion UART;
|
|
GICRegion GIC;
|
|
} VMBootMemoryMap;
|
|
|
|
void PMMInitialize(VMBootMemoryMap* bootMap);
|
|
Pointer PMMAllocatePage();
|
|
void PMMFreePage(Address address);
|