[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 11/23] efi: split out efi_init()
From: |
Daniel Kiper |
Subject: |
[PATCH v2 11/23] efi: split out efi_init() |
Date: |
Mon, 20 Jul 2015 16:29:06 +0200 |
..which initializes basic EFI variables. 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 | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 1f188fe..6f327cd 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -595,6 +595,22 @@ static char *__init get_value(const struct file *cfg,
const char *section,
return NULL;
}
+static void __init efi_init(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE
*SystemTable)
+{
+ efi_ih = ImageHandle;
+ efi_bs = SystemTable->BootServices;
+ efi_bs_revision = efi_bs->Hdr.Revision;
+ efi_rs = SystemTable->RuntimeServices;
+ efi_ct = SystemTable->ConfigurationTable;
+ efi_num_ct = SystemTable->NumberOfTableEntries;
+ efi_version = SystemTable->Hdr.Revision;
+ efi_fw_vendor = SystemTable->FirmwareVendor;
+ efi_fw_revision = SystemTable->FirmwareRevision;
+
+ StdOut = SystemTable->ConOut;
+ StdErr = SystemTable->StdErr ?: StdOut;
+}
+
static void __init setup_efi_pci(void)
{
EFI_STATUS status;
@@ -721,18 +737,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE
*SystemTable)
set_bit(EFI_PLATFORM, &efi.flags);
#endif
- efi_ih = ImageHandle;
- efi_bs = SystemTable->BootServices;
- efi_bs_revision = efi_bs->Hdr.Revision;
- efi_rs = SystemTable->RuntimeServices;
- efi_ct = SystemTable->ConfigurationTable;
- efi_num_ct = SystemTable->NumberOfTableEntries;
- efi_version = SystemTable->Hdr.Revision;
- efi_fw_vendor = SystemTable->FirmwareVendor;
- efi_fw_revision = SystemTable->FirmwareRevision;
+ efi_init(ImageHandle, SystemTable);
- StdOut = SystemTable->ConOut;
- StdErr = SystemTable->StdErr ?: StdOut;
use_cfg_file = efi_arch_use_config_file(SystemTable);
status = efi_bs->HandleProtocol(ImageHandle, &loaded_image_guid,
--
1.7.10.4
- [PATCH v2 00/23] x86: multiboot2 protocol support, Daniel Kiper, 2015/07/20
- [PATCH v2 01/23] x86/boot: remove unneeded instruction, Daniel Kiper, 2015/07/20
- [PATCH v2 04/23] x86/boot: call reloc() using cdecl calling convention, Daniel Kiper, 2015/07/20
- [PATCH v2 03/23] x86: zero BSS using stosl instead of stosb, Daniel Kiper, 2015/07/20
- [PATCH v2 07/23] x86/boot/reloc: Rename some variables and rearrange code a bit, Daniel Kiper, 2015/07/20
- [PATCH v2 06/23] x86/boot: use %ecx instead of %eax, Daniel Kiper, 2015/07/20
- [PATCH v2 05/23] x86/boot/reloc: create generic alloc and copy functions, Daniel Kiper, 2015/07/20
- [PATCH v2 08/23] x86: add multiboot2 protocol support, Daniel Kiper, 2015/07/20
- [PATCH v2 11/23] efi: split out efi_init(),
Daniel Kiper <=
- [PATCH v2 12/23] efi: split out efi_console_set_mode(), Daniel Kiper, 2015/07/20
- [PATCH v2 02/23] x86/boot: copy only text section from *.lnk file to *.bin file, Daniel Kiper, 2015/07/20
- [PATCH v2 13/23] efi: split out efi_get_gop(), Daniel Kiper, 2015/07/20
- [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