summaryrefslogtreecommitdiff
path: root/lib/efi_loader
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2019-06-14 07:20:51 +0200
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2019-06-14 19:18:40 +0200
commit2ad238fcc48367b415625b8f0fcacb6eef83985a (patch)
tree105cb10083a9d912985387eee9a7ff26fd345c43 /lib/efi_loader
parentc5b63bec2f885e2b0a475aca33c7696c59ae6965 (diff)
efi_loader: fix SetMode()
Correct the check of the mode number in SetMode() service of the simple text output protocol. Clear the screen in SetMode(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib/efi_loader')
-rw-r--r--lib/efi_loader/efi_console.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
index 2fc25e118f..fef0b2e1e2 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -316,23 +316,6 @@ static efi_status_t EFIAPI efi_cout_query_mode(
return EFI_EXIT(EFI_SUCCESS);
}
-static efi_status_t EFIAPI efi_cout_set_mode(
- struct efi_simple_text_output_protocol *this,
- unsigned long mode_number)
-{
- EFI_ENTRY("%p, %ld", this, mode_number);
-
-
- if (mode_number > efi_con_mode.max_mode)
- return EFI_EXIT(EFI_UNSUPPORTED);
-
- efi_con_mode.mode = mode_number;
- efi_con_mode.cursor_column = 0;
- efi_con_mode.cursor_row = 0;
-
- return EFI_EXIT(EFI_SUCCESS);
-}
-
static const struct {
unsigned int fg;
unsigned int bg;
@@ -378,6 +361,20 @@ static efi_status_t EFIAPI efi_cout_clear_screen(
return EFI_EXIT(EFI_SUCCESS);
}
+static efi_status_t EFIAPI efi_cout_set_mode(
+ struct efi_simple_text_output_protocol *this,
+ unsigned long mode_number)
+{
+ EFI_ENTRY("%p, %ld", this, mode_number);
+
+ if (mode_number >= efi_con_mode.max_mode)
+ return EFI_EXIT(EFI_UNSUPPORTED);
+ efi_con_mode.mode = mode_number;
+ EFI_CALL(efi_cout_clear_screen(this));
+
+ return EFI_EXIT(EFI_SUCCESS);
+}
+
static efi_status_t EFIAPI efi_cout_reset(
struct efi_simple_text_output_protocol *this,
char extended_verification)