mirror of
https://github.com/memtest86plus/memtest86plus.git
synced 2025-02-25 18:55:23 -06:00
Use ACPI RSDP address from boot_params if provided by bootloader.
This commit is contained in:
parent
1d2bf57403
commit
bb667b600f
@ -86,15 +86,17 @@ typedef struct {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
screen_info_t screen_info;
|
screen_info_t screen_info;
|
||||||
uint8_t unused1[0x1c0 - 0x040];
|
uint8_t unused1[0x070 - 0x040];
|
||||||
|
uint64_t acpi_rsdp_addr;
|
||||||
|
uint8_t unused2[0x1c0 - 0x078];
|
||||||
efi_info_t efi_info;
|
efi_info_t efi_info;
|
||||||
uint8_t unused2[0x1e8 - 0x1e0];
|
uint8_t unused3[0x1e8 - 0x1e0];
|
||||||
uint8_t e820_entries;
|
uint8_t e820_entries;
|
||||||
uint8_t unused3[0x214 - 0x1e9];
|
uint8_t unused4[0x214 - 0x1e9];
|
||||||
uint32_t code32_start;
|
uint32_t code32_start;
|
||||||
uint8_t unused4[0x2d0 - 0x218];
|
uint8_t unused5[0x2d0 - 0x218];
|
||||||
e820_entry_t e820_map[E820_MAP_SIZE];
|
e820_entry_t e820_map[E820_MAP_SIZE];
|
||||||
uint8_t unused5[0xeec - 0xd00];
|
uint8_t unused6[0xeec - 0xd00];
|
||||||
} __attribute__((packed)) boot_params_t;
|
} __attribute__((packed)) boot_params_t;
|
||||||
|
|
||||||
#endif /* BOOTPARAMS_H */
|
#endif /* BOOTPARAMS_H */
|
||||||
|
@ -508,12 +508,16 @@ static bool find_cpus_in_rsdp(void)
|
|||||||
|
|
||||||
// Search for the RSDP
|
// Search for the RSDP
|
||||||
rsdp_t *rp = NULL;
|
rsdp_t *rp = NULL;
|
||||||
if (efi_info->loader_signature == EFI32_LOADER_SIGNATURE) {
|
if (boot_params->acpi_rsdp_addr != 0) {
|
||||||
|
// Validate it
|
||||||
|
rp = scan_for_rsdp(boot_params->acpi_rsdp_addr, 0x8);
|
||||||
|
}
|
||||||
|
if (rp == NULL && efi_info->loader_signature == EFI32_LOADER_SIGNATURE) {
|
||||||
uintptr_t system_table_addr = (uintptr_t)efi_info->sys_tab;
|
uintptr_t system_table_addr = (uintptr_t)efi_info->sys_tab;
|
||||||
rp = find_rsdp_in_efi32_system_table((efi32_system_table_t *)system_table_addr);
|
rp = find_rsdp_in_efi32_system_table((efi32_system_table_t *)system_table_addr);
|
||||||
}
|
}
|
||||||
#ifdef __x86_64__
|
#ifdef __x86_64__
|
||||||
if (efi_info->loader_signature == EFI64_LOADER_SIGNATURE) {
|
if (rp == NULL && efi_info->loader_signature == EFI64_LOADER_SIGNATURE) {
|
||||||
uintptr_t system_table_addr = (uintptr_t)efi_info->sys_tab_hi << 32 | (uintptr_t)efi_info->sys_tab;
|
uintptr_t system_table_addr = (uintptr_t)efi_info->sys_tab_hi << 32 | (uintptr_t)efi_info->sys_tab;
|
||||||
rp = find_rsdp_in_efi64_system_table((efi64_system_table_t *)system_table_addr);
|
rp = find_rsdp_in_efi64_system_table((efi64_system_table_t *)system_table_addr);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user