1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:08:13 +00:00

Kernel/riscv64: Take the memory map from the FDT and dump it

For this the BootInfo struct was made architecture specific
This commit is contained in:
Hendiadyoin1 2024-01-26 14:37:36 +01:00 committed by Andrew Kaster
parent 21a21c6a11
commit d3f6b03733
10 changed files with 368 additions and 119 deletions

View file

@ -240,6 +240,21 @@ private:
MemoryManager();
~MemoryManager();
struct GlobalData {
GlobalData();
SystemMemoryInfo system_memory_info;
Vector<NonnullOwnPtr<PhysicalRegion>> physical_regions;
OwnPtr<PhysicalRegion> physical_pages_region;
RegionTree region_tree;
Vector<UsedMemoryRange> used_memory_ranges;
Vector<PhysicalMemoryRange> physical_memory_ranges;
Vector<ContiguousReservedMemoryRange> reserved_memory_ranges;
};
void initialize_physical_pages();
void register_reserved_ranges();
@ -251,6 +266,8 @@ private:
void protect_kernel_image();
void parse_memory_map();
void parse_memory_map_fdt(GlobalData&, u8 const* fdt_addr);
void parse_memory_map_multiboot(GlobalData&);
static void flush_tlb_local(VirtualAddress, size_t page_count = 1);
static void flush_tlb(PageDirectory const*, VirtualAddress, size_t page_count = 1);
@ -286,21 +303,6 @@ private:
PhysicalPageEntry* m_physical_page_entries { nullptr };
size_t m_physical_page_entries_count { 0 };
struct GlobalData {
GlobalData();
SystemMemoryInfo system_memory_info;
Vector<NonnullOwnPtr<PhysicalRegion>> physical_regions;
OwnPtr<PhysicalRegion> physical_pages_region;
RegionTree region_tree;
Vector<UsedMemoryRange> used_memory_ranges;
Vector<PhysicalMemoryRange> physical_memory_ranges;
Vector<ContiguousReservedMemoryRange> reserved_memory_ranges;
};
SpinlockProtected<GlobalData, LockRank::None> m_global_data;
};