Commit 890fbfa0 authored by Lv Zheng's avatar Lv Zheng Committed by Rafael J. Wysocki

ACPICA: acpidump: Add support for ACPI 1.0 GUID in Linux

For older EFI platforms, searches for the RSDP using ACPI 1.0 GUID if the
2.0 GUID search fails.
Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarDavid E. Box <david.e.box@linux.intel.com>
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 8aa5e56e
...@@ -77,6 +77,9 @@ osl_map_table(acpi_size address, ...@@ -77,6 +77,9 @@ osl_map_table(acpi_size address,
static void osl_unmap_table(struct acpi_table_header *table); static void osl_unmap_table(struct acpi_table_header *table);
static acpi_physical_address
osl_find_rsdp_via_efi_by_keyword(FILE * file, const char *keyword);
static acpi_physical_address osl_find_rsdp_via_efi(void); static acpi_physical_address osl_find_rsdp_via_efi(void);
static acpi_status osl_load_rsdp(void); static acpi_status osl_load_rsdp(void);
...@@ -415,6 +418,38 @@ acpi_os_get_table_by_index(u32 index, ...@@ -415,6 +418,38 @@ acpi_os_get_table_by_index(u32 index,
return (status); return (status);
} }
/******************************************************************************
*
* FUNCTION: osl_find_rsdp_via_efi_by_keyword
*
* PARAMETERS: keyword - Character string indicating ACPI GUID version
* in the EFI table
*
* RETURN: RSDP address if found
*
* DESCRIPTION: Find RSDP address via EFI using keyword indicating the ACPI
* GUID version.
*
*****************************************************************************/
static acpi_physical_address
osl_find_rsdp_via_efi_by_keyword(FILE * file, const char *keyword)
{
char buffer[80];
unsigned long long address = 0;
char format[32];
snprintf(format, 32, "%s=%s", keyword, "%llx");
fseek(file, 0, SEEK_SET);
while (fgets(buffer, 80, file)) {
if (sscanf(buffer, format, &address) == 1) {
break;
}
}
return ((acpi_physical_address) (address));
}
/****************************************************************************** /******************************************************************************
* *
* FUNCTION: osl_find_rsdp_via_efi * FUNCTION: osl_find_rsdp_via_efi
...@@ -430,20 +465,19 @@ acpi_os_get_table_by_index(u32 index, ...@@ -430,20 +465,19 @@ acpi_os_get_table_by_index(u32 index,
static acpi_physical_address osl_find_rsdp_via_efi(void) static acpi_physical_address osl_find_rsdp_via_efi(void)
{ {
FILE *file; FILE *file;
char buffer[80]; acpi_physical_address address = 0;
unsigned long address = 0;
file = fopen(EFI_SYSTAB, "r"); file = fopen(EFI_SYSTAB, "r");
if (file) { if (file) {
while (fgets(buffer, 80, file)) { address = osl_find_rsdp_via_efi_by_keyword(file, "ACPI20");
if (sscanf(buffer, "ACPI20=0x%lx", &address) == 1) { if (!address) {
break; address =
} osl_find_rsdp_via_efi_by_keyword(file, "ACPI");
} }
fclose(file); fclose(file);
} }
return ((acpi_physical_address) (address)); return (address);
} }
/****************************************************************************** /******************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment