protos/linux_risc: Install memory reservation configuration table

This gets rid of some warnings when booting Linux on systems with a GIC v3
interrupt controller.
This commit is contained in:
Kacper Słomiński 2024-07-15 00:23:06 +02:00 committed by mintsuki
parent f3247cb530
commit 5cc85aa66f

View File

@ -36,6 +36,12 @@ struct linux_header {
uint32_t res4;
} __attribute__((packed));
struct linux_efi_memreserve {
int size;
int count;
uint64_t next;
};
// End of Linux code
#if defined(__riscv64)
@ -154,6 +160,21 @@ void *prepare_device_tree_blob(char *config, char *cmdline) {
panic(true, "linux: failed to set bootargs: '%s'", fdt_strerror(ret));
}
{
struct linux_efi_memreserve *rsv = ext_mem_alloc(sizeof(struct linux_efi_memreserve));
rsv->size = 0;
rsv->count = 0;
rsv->next = 0;
EFI_GUID memreserve_table_guid = {0x888eb0c6, 0x8ede, 0x4ff5, {0xa8, 0xf0, 0x9a, 0xee, 0x5c, 0xb9, 0x77, 0xc2}};
EFI_STATUS ret = gBS->InstallConfigurationTable(&memreserve_table_guid, rsv);
if (ret != EFI_SUCCESS) {
panic(true, "linux: failed to install memory reservation configuration table: '%x'", ret);
}
}
efi_exit_boot_services();
// Tell Linux about the UEFI memory map and system table.