[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 15/23] efi: split out efi_tables()
From: |
Daniel Kiper |
Subject: |
[PATCH v2 15/23] efi: split out efi_tables() |
Date: |
Mon, 20 Jul 2015 16:29:10 +0200 |
..which collects system tables data. We want to re-use this
code to support multiboot2 protocol on EFI platforms.
Signed-off-by: Daniel Kiper <address@hidden>
---
v2 - suggestions/fixes:
- improve commit message
(suggested by Jan Beulich).
---
xen/common/efi/boot.c | 61 +++++++++++++++++++++++++++----------------------
1 file changed, 34 insertions(+), 27 deletions(-)
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 8d16470..fd62125 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -717,6 +717,39 @@ static UINTN __init
efi_find_gop_mode(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop,
return gop_mode;
}
+static void __init efi_tables(void)
+{
+ unsigned int i;
+
+ /* Obtain basic table pointers. */
+ for ( i = 0; i < efi_num_ct; ++i )
+ {
+ static EFI_GUID __initdata acpi2_guid = ACPI_20_TABLE_GUID;
+ static EFI_GUID __initdata acpi_guid = ACPI_TABLE_GUID;
+ static EFI_GUID __initdata mps_guid = MPS_TABLE_GUID;
+ static EFI_GUID __initdata smbios_guid = SMBIOS_TABLE_GUID;
+ static EFI_GUID __initdata smbios3_guid = SMBIOS3_TABLE_GUID;
+
+ if ( match_guid(&acpi2_guid, &efi_ct[i].VendorGuid) )
+ efi.acpi20 = (long)efi_ct[i].VendorTable;
+ if ( match_guid(&acpi_guid, &efi_ct[i].VendorGuid) )
+ efi.acpi = (long)efi_ct[i].VendorTable;
+ if ( match_guid(&mps_guid, &efi_ct[i].VendorGuid) )
+ efi.mps = (long)efi_ct[i].VendorTable;
+ if ( match_guid(&smbios_guid, &efi_ct[i].VendorGuid) )
+ efi.smbios = (long)efi_ct[i].VendorTable;
+ if ( match_guid(&smbios3_guid, &efi_ct[i].VendorGuid) )
+ efi.smbios3 = (long)efi_ct[i].VendorTable;
+ }
+
+#ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
+ dmi_efi_get_table(efi.smbios != EFI_INVALID_TABLE_ADDR
+ ? (void *)(long)efi.smbios : NULL,
+ efi.smbios3 != EFI_INVALID_TABLE_ADDR
+ ? (void *)(long)efi.smbios3 : NULL);
+#endif
+}
+
static void __init setup_efi_pci(void)
{
EFI_STATUS status;
@@ -1039,33 +1072,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE
*SystemTable)
/* XXX Collect EDID info. */
efi_arch_cpu();
- /* Obtain basic table pointers. */
- for ( i = 0; i < efi_num_ct; ++i )
- {
- static EFI_GUID __initdata acpi2_guid = ACPI_20_TABLE_GUID;
- static EFI_GUID __initdata acpi_guid = ACPI_TABLE_GUID;
- static EFI_GUID __initdata mps_guid = MPS_TABLE_GUID;
- static EFI_GUID __initdata smbios_guid = SMBIOS_TABLE_GUID;
- static EFI_GUID __initdata smbios3_guid = SMBIOS3_TABLE_GUID;
-
- if ( match_guid(&acpi2_guid, &efi_ct[i].VendorGuid) )
- efi.acpi20 = (long)efi_ct[i].VendorTable;
- if ( match_guid(&acpi_guid, &efi_ct[i].VendorGuid) )
- efi.acpi = (long)efi_ct[i].VendorTable;
- if ( match_guid(&mps_guid, &efi_ct[i].VendorGuid) )
- efi.mps = (long)efi_ct[i].VendorTable;
- if ( match_guid(&smbios_guid, &efi_ct[i].VendorGuid) )
- efi.smbios = (long)efi_ct[i].VendorTable;
- if ( match_guid(&smbios3_guid, &efi_ct[i].VendorGuid) )
- efi.smbios3 = (long)efi_ct[i].VendorTable;
- }
-
-#ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
- dmi_efi_get_table(efi.smbios != EFI_INVALID_TABLE_ADDR
- ? (void *)(long)efi.smbios : NULL,
- efi.smbios3 != EFI_INVALID_TABLE_ADDR
- ? (void *)(long)efi.smbios3 : NULL);
-#endif
+ efi_tables();
/* Collect PCI ROM contents. */
setup_efi_pci();
--
1.7.10.4
- [PATCH v2 16/23] efi: split out efi_variables(), (continued)
- [PATCH v2 16/23] efi: split out efi_variables(), Daniel Kiper, 2015/07/20
- [PATCH v2 19/23] x86/efi: create new early memory allocator, Daniel Kiper, 2015/07/20
- [PATCH v2 18/23] efi: split out efi_exit_boot(), Daniel Kiper, 2015/07/20
- [PATCH v2 21/23] x86/boot: implement early command line parser in C, Daniel Kiper, 2015/07/20
- [PATCH v2 20/23] x86: add multiboot2 protocol support for EFI platforms, Daniel Kiper, 2015/07/20
- [PATCH v2 09/23] efi: create efi_enabled(), Daniel Kiper, 2015/07/20
- [PATCH v2 14/23] efi: split out efi_find_gop_mode(), Daniel Kiper, 2015/07/20
- [PATCH v2 10/23] efi: build xen.gz with EFI code, Daniel Kiper, 2015/07/20
- [PATCH v2 22/23] x86: make Xen early boot code relocatable, Daniel Kiper, 2015/07/20
- [PATCH v2 17/23] efi: split out efi_set_gop_mode(), Daniel Kiper, 2015/07/20
- [PATCH v2 15/23] efi: split out efi_tables(),
Daniel Kiper <=
- [PATCH v2 23/23] x86: add multiboot2 protocol support for relocatable images, Daniel Kiper, 2015/07/20
- Re: [PATCH v2 00/23] x86: multiboot2 protocol support, Jan Beulich, 2015/07/21