[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/18] efi: create efi_console_set_mode()
From: |
Daniel Kiper |
Subject: |
[PATCH 10/18] efi: create efi_console_set_mode() |
Date: |
Fri, 30 Jan 2015 18:54:14 +0100 |
..which sets console mode. We need this to support
multiboot2 protocol on EFI platforms.
Signed-off-by: Daniel Kiper <address@hidden>
---
xen/common/efi/boot.c | 37 ++++++++++++++++++++-----------------
1 file changed, 20 insertions(+), 17 deletions(-)
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 1bf88e4..9ce8a25 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -601,6 +601,25 @@ static void __init efi_init(EFI_HANDLE ImageHandle,
EFI_SYSTEM_TABLE *SystemTabl
StdErr = SystemTable->StdErr ?: StdOut;
}
+static void __init efi_console_set_mode(void)
+{
+ UINTN cols, rows, size;
+ unsigned int best, i;
+
+ for ( i = 0, size = 0, best = StdOut->Mode->Mode;
+ i < StdOut->Mode->MaxMode; ++i )
+ {
+ if ( StdOut->QueryMode(StdOut, i, &cols, &rows) == EFI_SUCCESS &&
+ cols * rows > size )
+ {
+ size = cols * rows;
+ best = i;
+ }
+ }
+ if ( best != StdOut->Mode->Mode )
+ StdOut->SetMode(StdOut, best);
+}
+
static void __init setup_efi_pci(void)
{
EFI_STATUS status;
@@ -787,23 +806,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE
*SystemTable)
}
if ( !base_video )
- {
- unsigned int best;
- UINTN cols, rows, size;
-
- for ( i = 0, size = 0, best = StdOut->Mode->Mode;
- i < StdOut->Mode->MaxMode; ++i )
- {
- if ( StdOut->QueryMode(StdOut, i, &cols, &rows) == EFI_SUCCESS
&&
- cols * rows > size )
- {
- size = cols * rows;
- best = i;
- }
- }
- if ( best != StdOut->Mode->Mode )
- StdOut->SetMode(StdOut, best);
- }
+ efi_console_set_mode();
}
PrintStr(L"Xen " __stringify(XEN_VERSION) "." __stringify(XEN_SUBVERSION)
--
1.7.10.4
- Re: [PATCH 02/18] x86/boot/reloc: create generic alloc and copy functions, (continued)
- [PATCH 03/18] x86/boot: use %ecx instead of %eax, Daniel Kiper, 2015/01/30
- [PATCH 04/18] xen/x86: add multiboot2 protocol support, Daniel Kiper, 2015/01/30
- [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 <=
- [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, 2015/01/30
- [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