Skip to contentSkip to conversation

efi_loader: remove deprecated ConsoleControlProtocol

PATCH New Heinrich Schuchardt 2 participants 3 messages Mar 3, 2018 – Mar 9, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi_loader: remove deprecated ConsoleControlProtocol

The console control protocol is not defined in the UEFI standard.

It exists in EDK2's EdkCompatiblityPkg package. But this package is deprecated according to
https://github.com/tianocore/tianocore.github.io/wiki/Differences-between-EDK-and-EDK-II

---
 include/efi_api.h             | 18 -----------------
 lib/efi_loader/efi_boottime.c |  5 -----
 lib/efi_loader/efi_console.c  | 46 -------------------------------------------
 3 files changed, 69 deletions(-)
include/efi_api.h +0 -18
index 205f8f1f70..a2706a0ae4 100644
@@ -542,24 +542,6 @@ struct efi_simple_input_interface {
 	struct efi_event *wait_for_key;
 };
 
-#define CONSOLE_CONTROL_GUID \
-	EFI_GUID(0xf42f7782, 0x12e, 0x4c12, \
-		 0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21)
-#define EFI_CONSOLE_MODE_TEXT	0
-#define EFI_CONSOLE_MODE_GFX	1
-
-struct efi_console_control_protocol
-{
-	efi_status_t (EFIAPI *get_mode)(
-			struct efi_console_control_protocol *this, int *mode,
-			char *uga_exists, char *std_in_locked);
-	efi_status_t (EFIAPI *set_mode)(
-			struct efi_console_control_protocol *this, int mode);
-	efi_status_t (EFIAPI *lock_std_in)(
-			struct efi_console_control_protocol *this,
-			uint16_t *password);
-};
-
 #define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \
 	EFI_GUID(0x8b843e20, 0x8132, 0x4852, \
 		 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c)
lib/efi_loader/efi_boottime.c +0 -5
index da93498b36..599f0c597d 100644
@@ -1388,11 +1388,6 @@ efi_status_t efi_setup_loaded_image(
 	if (ret != EFI_SUCCESS)
 		goto failure;
 
-	ret = efi_add_protocol(obj->handle, &efi_guid_console_control,
-			       (void *)&efi_console_control);
-	if (ret != EFI_SUCCESS)
-		goto failure;
-
 	ret = efi_add_protocol(obj->handle,
 			       &efi_guid_device_path_to_text_protocol,
 			       (void *)&efi_device_path_to_text);
lib/efi_loader/efi_console.c +0 -46

68 lines not on this page · raw message

Signature · 1 line
2.15.1
#1 lore raw

PATCH 1/1 efi_loader: remove deprecated ConsoleControlProtocol

Quoted 7 lines · Heinrich Schuchardt

The console control protocol is not defined in the UEFI standard.

It exists in EDK2's EdkCompatiblityPkg package. But this package is deprecated according to
https://github.com/tianocore/tianocore.github.io/wiki/Differences-between-EDK-and-EDK-II

Grub uses it, but I can confirm that the code path it's using it in is perfectly happy with it not being available. So I think it's safe to remove.

Alex

#2 lore raw

PATCH 1/1 efi_loader: remove deprecated ConsoleControlProtocol

Quoted 8 lines · Alexander Graf
Quoted 7 lines · Heinrich Schuchardt

The console control protocol is not defined in the UEFI standard.

It exists in EDK2's EdkCompatiblityPkg package. But this package is deprecated according to
https://github.com/tianocore/tianocore.github.io/wiki/Differences-between-EDK-and-EDK-II

Quoted 10 lines
Quoted 1 line

Grub uses it, but I can confirm that the code path it's using it in is perfectly happy with it not being available. So I think it's safe to remove.

Alex

Even the very first UEFI spec (2.0, 2006) did not contain the ConsoleControlProtocol.

Grub is trying to switch the console to text mode (see function grub_efi_set_text_mode()). With UEFI text output is always available. This is why the protocol was obsoleted by UEFI. The current grub coding that allows to live without the console control protocol was introduced in 2006 in response to the first UEFI spec.

Regards

Heinrich