diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/efi_loader/efi_console.c | 30 | ||||
-rw-r--r-- | lib/efi_loader/efi_load_initrd.c | 19 |
2 files changed, 33 insertions, 16 deletions
diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c index 3354b217a9a..ab83f8bf828 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); } @@ -1351,9 +1359,7 @@ efi_status_t efi_console_get_u16_string(struct efi_simple_text_input_protocol *c ANSI_CLEAR_LINE_TO_END ANSI_CURSOR_SHOW, row, col); - ret = EFI_CALL(cin->reset(cin, false)); - if (ret != EFI_SUCCESS) - return ret; + efi_cin_empty_buffer(); for (;;) { do { diff --git a/lib/efi_loader/efi_load_initrd.c b/lib/efi_loader/efi_load_initrd.c index 87fde3f88c2..193433782c2 100644 --- a/lib/efi_loader/efi_load_initrd.c +++ b/lib/efi_loader/efi_load_initrd.c @@ -213,7 +213,7 @@ efi_status_t efi_initrd_register(void) &efi_guid_device_path, &dp_lf2_handle, /* LOAD_FILE2 */ &efi_guid_load_file2_protocol, - (void *)&efi_lf2_protocol, + &efi_lf2_protocol, NULL); return ret; @@ -227,11 +227,22 @@ efi_status_t efi_initrd_register(void) * * Return: status code */ -void efi_initrd_deregister(void) +efi_status_t efi_initrd_deregister(void) { + efi_status_t ret; + if (!efi_initrd_handle) - return; + return EFI_SUCCESS; - efi_delete_handle(efi_initrd_handle); + ret = efi_uninstall_multiple_protocol_interfaces(efi_initrd_handle, + /* initramfs */ + &efi_guid_device_path, + &dp_lf2_handle, + /* LOAD_FILE2 */ + &efi_guid_load_file2_protocol, + &efi_lf2_protocol, + NULL); efi_initrd_handle = NULL; + + return ret; } |