diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2022-10-15 11:13:59 +0200 |
---|---|---|
committer | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2022-10-16 12:23:22 +0200 |
commit | f32723663b464ab82285b22af57bf58bd32f759f (patch) | |
tree | bc6e7d12773c622979a3da1918b60c11c5976548 /lib/efi_loader/efi_console.c | |
parent | c98f6fed93ca49a956d628200b2dfa1454ce6fbb (diff) |
efi_loader: avoid EFI_CALL() for clearing screen
Carve out function efi_clear_screen.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'lib/efi_loader/efi_console.c')
-rw-r--r-- | lib/efi_loader/efi_console.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c index 3354b217a9..6d4784e140 100644 --- a/lib/efi_loader/efi_console.c +++ b/lib/efi_loader/efi_console.c @@ -462,6 +462,20 @@ static efi_status_t EFIAPI efi_cout_set_attribute( /** * efi_cout_clear_screen() - clear screen + */ +static void efi_clear_screen(void) +{ + /* + * The Linux console wants both a clear and a home command. The video + * uclass does not support <ESC>[H without coordinates, yet. + */ + printf(ESC "[2J" ESC "[1;1H"); + efi_con_mode.cursor_column = 0; + efi_con_mode.cursor_row = 0; +} + +/** + * efi_cout_clear_screen() - clear screen * * This function implements the ClearScreen service of the simple text output * protocol. See the Unified Extensible Firmware Interface (UEFI) specification @@ -475,13 +489,7 @@ static efi_status_t EFIAPI efi_cout_clear_screen( { EFI_ENTRY("%p", this); - /* - * The Linux console wants both a clear and a home command. The video - * uclass does not support <ESC>[H without coordinates, yet. - */ - printf(ESC "[2J" ESC "[1;1H"); - efi_con_mode.cursor_column = 0; - efi_con_mode.cursor_row = 0; + efi_clear_screen(); return EFI_EXIT(EFI_SUCCESS); } @@ -510,7 +518,7 @@ static efi_status_t EFIAPI efi_cout_set_mode( return EFI_EXIT(EFI_UNSUPPORTED); efi_con_mode.mode = mode_number; - EFI_CALL(efi_cout_clear_screen(this)); + efi_clear_screen(); return EFI_EXIT(EFI_SUCCESS); } @@ -536,7 +544,7 @@ static efi_status_t EFIAPI efi_cout_reset( efi_con_mode.attribute = 0x07; printf(ESC "[0;37;40m"); /* Clear screen */ - EFI_CALL(efi_cout_clear_screen(this)); + efi_clear_screen(); return EFI_EXIT(EFI_SUCCESS); } |