/* * Search EFI system tables for RSDP. Preferred is ACPI_20_TABLE_GUID to * ACPI_TABLE_GUID because it has more features.
*/
rsdp_addr = efi_find_vendor_table(boot_params_ptr, cfg_tbl_pa, cfg_tbl_len,
ACPI_20_TABLE_GUID); if (rsdp_addr) return (acpi_physical_address)rsdp_addr;
/* No ACPI_20_TABLE_GUID found, fallback to ACPI_TABLE_GUID. */
rsdp_addr = efi_find_vendor_table(boot_params_ptr, cfg_tbl_pa, cfg_tbl_len,
ACPI_TABLE_GUID); if (rsdp_addr) return (acpi_physical_address)rsdp_addr;
/* Search a block of memory for the RSDP signature. */ static u8 *scan_mem_for_rsdp(u8 *start, u32 length)
{ struct acpi_table_rsdp *rsdp;
u8 *address, *end;
end = start + length;
/* Search from given start address for the requested length */ for (address = start; address < end; address += ACPI_RSDP_SCAN_STEP) { /* * Both RSDP signature and checksum must be correct. * Note: Sometimes there exists more than one RSDP in memory; * the valid RSDP has a valid checksum, all others have an * invalid checksum.
*/
rsdp = (struct acpi_table_rsdp *)address;
/* BAD Signature */ if (!ACPI_VALIDATE_RSDP_SIG(rsdp->signature)) continue;
/* Check the standard checksum */ if (compute_checksum((u8 *)rsdp, ACPI_RSDP_CHECKSUM_LENGTH)) continue;
/* Check extended checksum if table version >= 2 */ if ((rsdp->revision >= 2) &&
(compute_checksum((u8 *)rsdp, ACPI_RSDP_XCHECKSUM_LENGTH))) continue;
/* Signature and checksum valid, we have found a real RSDP */ return address;
} return NULL;
}
/* Get the location of the Extended BIOS Data Area (EBDA) */
address = *(u16 *)ACPI_EBDA_PTR_LOCATION;
address <<= 4;
/* * Search EBDA paragraphs (EBDA is required to be a minimum of * 1K length)
*/ if (address > 0x400) {
rsdp = scan_mem_for_rsdp((u8 *)address, ACPI_EBDA_WINDOW_SIZE); if (rsdp) return (acpi_physical_address)(unsignedlong)rsdp;
}
/* Search upper memory: 16-byte boundaries in E0000h-FFFFFh */
rsdp = scan_mem_for_rsdp((u8 *) ACPI_HI_RSDP_WINDOW_BASE,
ACPI_HI_RSDP_WINDOW_SIZE); if (rsdp) return (acpi_physical_address)(unsignedlong)rsdp;
/* * Check whether we were given an RSDP on the command line. We don't * stash this in boot params because the kernel itself may have * different ideas about whether to trust a command-line parameter.
*/
rsdp = (struct acpi_table_rsdp *)get_cmdline_acpi_rsdp(); if (!rsdp)
rsdp = (struct acpi_table_rsdp *)(long)
boot_params_ptr->acpi_rsdp_addr;
/** * count_immovable_mem_regions - Parse SRAT and cache the immovable * memory regions into the immovable_mem array. * * Return the number of immovable memory regions on success, 0 on failure: * * - Too many immovable memory regions * - ACPI off or no SRAT found * - No immovable memory region found.
*/ int count_immovable_mem_regions(void)
{ unsignedlong table_addr, table_end, table; struct acpi_subtable_header *sub_table; struct acpi_table_header *table_header; char arg[MAX_ACPI_ARG_LENGTH]; int num = 0;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.