mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:48:10 +00:00
Kernel/aarch64: Account for reserved VideoCore range in the memory map
Instead of having a single available memory range that encompasses the whole 0x00000000-0x3EFFFFFF range of physical memory, create a separate reserved entry for the RAM range used by the VideoCore. This fixes a crash that happens when we try to allocate physical pages in the GPU's reserved range. This will eventually be replaced with parsing the data from the device tree, but for now, this should solve some of the recurring CI failures.
This commit is contained in:
parent
9359e49383
commit
c6c0ce78f5
1 changed files with 16 additions and 5 deletions
|
@ -186,14 +186,25 @@ extern "C" [[noreturn]] UNMAP_AFTER_INIT void init([[maybe_unused]] BootInfo con
|
|||
multiboot_framebuffer_type = boot_info.multiboot_framebuffer_type;
|
||||
#elif ARCH(AARCH64)
|
||||
// FIXME: For the aarch64 platforms, we should get the information by parsing a device tree instead of using multiboot.
|
||||
auto [ram_base, ram_size] = RPi::Mailbox::the().query_lower_arm_memory_range();
|
||||
auto [vcmem_base, vcmem_size] = RPi::Mailbox::the().query_videocore_memory_range();
|
||||
multiboot_memory_map_t mmap[] = {
|
||||
{ sizeof(struct multiboot_mmap_entry) - sizeof(u32),
|
||||
(u64)0x0,
|
||||
(u64)0x3F000000,
|
||||
MULTIBOOT_MEMORY_AVAILABLE }
|
||||
{
|
||||
sizeof(struct multiboot_mmap_entry) - sizeof(u32),
|
||||
(u64)ram_base,
|
||||
(u64)ram_size,
|
||||
MULTIBOOT_MEMORY_AVAILABLE,
|
||||
},
|
||||
{
|
||||
sizeof(struct multiboot_mmap_entry) - sizeof(u32),
|
||||
(u64)vcmem_base,
|
||||
(u64)vcmem_size,
|
||||
MULTIBOOT_MEMORY_RESERVED,
|
||||
},
|
||||
// FIXME: VideoCore only reports the first 1GB of RAM, the rest only shows up in the device tree.
|
||||
};
|
||||
multiboot_memory_map = mmap;
|
||||
multiboot_memory_map_count = 1;
|
||||
multiboot_memory_map_count = 2;
|
||||
|
||||
multiboot_modules = nullptr;
|
||||
multiboot_modules_count = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue