[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 14/18] efi: create efi_variables()
From: |
Daniel Kiper |
Subject: |
[PATCH 14/18] efi: create efi_variables() |
Date: |
Fri, 30 Jan 2015 18:54:18 +0100 |
..which collects variable store parameters. We need this to support
multiboot2 protocol on EFI platforms.
Signed-off-by: Daniel Kiper <address@hidden>
---
xen/common/efi/boot.c | 41 ++++++++++++++++++++++++-----------------
1 file changed, 24 insertions(+), 17 deletions(-)
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index cf0fbc2..2379022 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -822,6 +822,29 @@ static void __init setup_efi_pci(void)
efi_bs->FreePool(handles);
}
+static void __init efi_variables(void)
+{
+ EFI_STATUS status;
+
+ status = (efi_rs->Hdr.Revision >> 16) >= 2 ?
+ efi_rs->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE |
+ EFI_VARIABLE_BOOTSERVICE_ACCESS |
+ EFI_VARIABLE_RUNTIME_ACCESS,
+ &efi_boot_max_var_store_size,
+ &efi_boot_remain_var_store_size,
+ &efi_boot_max_var_size) :
+ EFI_INCOMPATIBLE_VERSION;
+ if ( EFI_ERROR(status) )
+ {
+ efi_boot_max_var_store_size = 0;
+ efi_boot_remain_var_store_size = 0;
+ efi_boot_max_var_size = status;
+ PrintStr(L"Warning: Could not query variable store: ");
+ DisplayUint(status, 0);
+ PrintStr(newline);
+ }
+}
+
static int __init __maybe_unused set_color(u32 mask, int bpp, u8 *pos, u8 *sz)
{
if ( bpp < 0 )
@@ -1061,23 +1084,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE
*SystemTable)
setup_efi_pci();
/* Get snapshot of variable store parameters. */
- status = (efi_rs->Hdr.Revision >> 16) >= 2 ?
- efi_rs->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE |
- EFI_VARIABLE_BOOTSERVICE_ACCESS |
- EFI_VARIABLE_RUNTIME_ACCESS,
- &efi_boot_max_var_store_size,
- &efi_boot_remain_var_store_size,
- &efi_boot_max_var_size) :
- EFI_INCOMPATIBLE_VERSION;
- if ( EFI_ERROR(status) )
- {
- efi_boot_max_var_store_size = 0;
- efi_boot_remain_var_store_size = 0;
- efi_boot_max_var_size = status;
- PrintStr(L"Warning: Could not query variable store: ");
- DisplayUint(status, 0);
- PrintStr(newline);
- }
+ efi_variables();
efi_arch_memory_setup();
--
1.7.10.4
- Re: [PATCH 04/18] xen/x86: add multiboot2 protocol support, (continued)
- [PATCH 05/18] efi: split efi_enabled to efi_platform and efi_loader, Daniel Kiper, 2015/01/30
- [PATCH 06/18] x86: remove commented out stale references to efi_enabled, Daniel Kiper, 2015/01/30
- [PATCH 08/18] efi: build xen.gz with EFI code, Daniel Kiper, 2015/01/30
- [PATCH 07/18] efi: run EFI specific code on EFI platform only, Daniel Kiper, 2015/01/30
- [PATCH 12/18] efi: create efi_find_gop_mode(), Daniel Kiper, 2015/01/30
- [PATCH 09/18] efi: create efi_init(), Daniel Kiper, 2015/01/30
- [PATCH 10/18] efi: create efi_console_set_mode(), Daniel Kiper, 2015/01/30
- [PATCH 11/18] efi: create efi_get_gop(), Daniel Kiper, 2015/01/30
- [PATCH 13/18] efi: create efi_tables(), Daniel Kiper, 2015/01/30
- [PATCH 14/18] efi: create efi_variables(),
Daniel Kiper <=
- [PATCH 16/18] efi: create efi_exit_boot(), Daniel Kiper, 2015/01/30
- [PATCH 15/18] efi: create efi_set_gop_mode(), Daniel Kiper, 2015/01/30
- [PATCH 17/18] x86/efi: create new early memory allocator, Daniel Kiper, 2015/01/30
- [PATCH 18/18] x86: add multiboot2 protocol support for EFI platforms, Daniel Kiper, 2015/01/30
- Re: [PATCH 00/18] x86: multiboot2 protocol support, Daniel Kiper, 2015/01/30
- Re: [PATCH 00/18] x86: multiboot2 protocol support, João Jerónimo, 2015/01/31