[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC 3/3] acpi: use grub_efi_find_config_table to find tables
From: |
Leif Lindholm |
Subject: |
[RFC 3/3] acpi: use grub_efi_find_config_table to find tables |
Date: |
Tue, 1 Mar 2016 17:41:43 +0000 |
Use new helper function rather than manually iterating through UEFI
system table.
---
grub-core/kern/efi/acpi.c | 28 ++++------------------------
1 file changed, 4 insertions(+), 24 deletions(-)
diff --git a/grub-core/kern/efi/acpi.c b/grub-core/kern/efi/acpi.c
index 74f8cd1..523d682 100644
--- a/grub-core/kern/efi/acpi.c
+++ b/grub-core/kern/efi/acpi.c
@@ -25,35 +25,15 @@
struct grub_acpi_rsdp_v10 *
grub_machine_acpi_get_rsdpv1 (void)
{
- unsigned i;
- static grub_efi_packed_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID;
+ static grub_efi_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID;
- for (i = 0; i < grub_efi_system_table->num_table_entries; i++)
- {
- grub_efi_packed_guid_t *guid =
- &grub_efi_system_table->configuration_table[i].vendor_guid;
-
- if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_efi_packed_guid_t)))
- return (struct grub_acpi_rsdp_v10 *)
- grub_efi_system_table->configuration_table[i].vendor_table;
- }
- return 0;
+ return grub_efi_find_config_table (&acpi_guid);
}
struct grub_acpi_rsdp_v20 *
grub_machine_acpi_get_rsdpv2 (void)
{
- unsigned i;
- static grub_efi_packed_guid_t acpi20_guid = GRUB_EFI_ACPI_20_TABLE_GUID;
-
- for (i = 0; i < grub_efi_system_table->num_table_entries; i++)
- {
- grub_efi_packed_guid_t *guid =
- &grub_efi_system_table->configuration_table[i].vendor_guid;
+ static grub_efi_guid_t acpi20_guid = GRUB_EFI_ACPI_20_TABLE_GUID;
- if (! grub_memcmp (guid, &acpi20_guid, sizeof (grub_efi_packed_guid_t)))
- return (struct grub_acpi_rsdp_v20 *)
- grub_efi_system_table->configuration_table[i].vendor_table;
- }
- return 0;
+ return grub_efi_find_config_table (&acpi20_guid);
}
--
2.1.4
[RFC 2/3] arm64 linux loader: use grub_efi_find_config_table to find DT, Leif Lindholm, 2016/03/01
Re: [RFC 0/3] Add/use helper functions for finding UEFI config tables, Alexander Graf, 2016/03/01