From d178836bd21ed1436ec612c8a8b5b4e1ca792087 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 9 Dec 2018 16:39:20 +0100 Subject: efi_loader: efi_connect_controller() use %pD EFI_ENTRY in efi_connect_controller() should use %pD to print the remaining device path. Signed-off-by: Heinrich Schuchardt Signed-off-by: Alexander Graf --- lib/efi_loader/efi_boottime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/efi_loader/efi_boottime.c') diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index cc9efbb0cbf..f592e4083ff 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -2825,7 +2825,7 @@ static efi_status_t EFIAPI efi_connect_controller( efi_status_t ret = EFI_NOT_FOUND; struct efi_object *efiobj; - EFI_ENTRY("%p, %p, %p, %d", controller_handle, driver_image_handle, + EFI_ENTRY("%p, %p, %pD, %d", controller_handle, driver_image_handle, remain_device_path, recursive); efiobj = efi_search_obj(controller_handle); -- cgit v1.2.3 From cc8e34178b5f141ed997843e86248e4d53f37298 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Fri, 28 Dec 2018 12:41:15 +0100 Subject: efi_loader: signature of StartImage and Exit We use u16* for Unicode strings and efi_uintn_t for UINTN. Correct the signature of efi_exit() and efi_start_image(). Signed-off-by: Heinrich Schuchardt Signed-off-by: Alexander Graf --- lib/efi_loader/efi_boottime.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/efi_loader/efi_boottime.c') diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index f592e4083ff..88386ff6760 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -1706,8 +1706,8 @@ error: * Return: status code */ static efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle, - unsigned long *exit_data_size, - s16 **exit_data) + efi_uintn_t *exit_data_size, + u16 **exit_data) { struct efi_loaded_image_obj *image_obj = (struct efi_loaded_image_obj *)image_handle; @@ -1773,8 +1773,8 @@ static efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle, */ static efi_status_t EFIAPI efi_exit(efi_handle_t image_handle, efi_status_t exit_status, - unsigned long exit_data_size, - int16_t *exit_data) + efi_uintn_t exit_data_size, + u16 *exit_data) { /* * TODO: We should call the unload procedure of the loaded @@ -1783,7 +1783,7 @@ static efi_status_t EFIAPI efi_exit(efi_handle_t image_handle, struct efi_loaded_image_obj *image_obj = (struct efi_loaded_image_obj *)image_handle; - EFI_ENTRY("%p, %ld, %ld, %p", image_handle, exit_status, + EFI_ENTRY("%p, %ld, %zu, %p", image_handle, exit_status, exit_data_size, exit_data); /* Make sure entry/exit counts for EFI world cross-overs match */ -- cgit v1.2.3 From 0bc81a717d1ce90008f9f8ae8b3c086d4405a295 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 9 Jan 2019 21:41:13 +0100 Subject: efi_loader: fix CopyMem() CopyMem() must support overlapping buffers. So replace memcpy() by memmove(). Signed-off-by: Heinrich Schuchardt Signed-off-by: Alexander Graf --- lib/efi_loader/efi_boottime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/efi_loader/efi_boottime.c') diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 88386ff6760..dbf0d56c1d3 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -2483,7 +2483,7 @@ static void EFIAPI efi_copy_mem(void *destination, const void *source, size_t length) { EFI_ENTRY("%p, %p, %ld", destination, source, (unsigned long)length); - memcpy(destination, source, length); + memmove(destination, source, length); EFI_EXIT(EFI_SUCCESS); } -- cgit v1.2.3 From c9bfb22296b09de84fba3f027d5d88842360ddcd Mon Sep 17 00:00:00 2001 From: Leif Lindholm Date: Mon, 21 Jan 2019 12:12:57 +0900 Subject: efi_loader: Initial HII database protocols This patch provides enough implementation of the following protocols to run EDKII's Shell.efi and UEFI SCT: * EfiHiiDatabaseProtocol * EfiHiiStringProtocol Not implemented are: * ExportPackageLists() * RegisterPackageNotify()/UnregisterPackageNotify() * SetKeyboardLayout() (i.e. *current* keyboard layout) HII database protocol in this patch series can handle only: * GUID package * string package * keyboard layout package (The other packages, except Device path package, will be necessary for interactive and graphical UI.) Signed-off-by: Leif Lindholm Signed-off-by: Rob Clark Signed-off-by: AKASHI Takahiro Signed-off-by: Alexander Graf --- lib/efi_loader/efi_boottime.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/efi_loader/efi_boottime.c') diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index dbf0d56c1d3..73af490377c 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -1558,6 +1558,18 @@ efi_status_t efi_setup_loaded_image(struct efi_device_path *device_path, if (ret != EFI_SUCCESS) goto failure; + ret = efi_add_protocol(&obj->header, + &efi_guid_hii_string_protocol, + (void *)&efi_hii_string); + if (ret != EFI_SUCCESS) + goto failure; + + ret = efi_add_protocol(&obj->header, + &efi_guid_hii_database_protocol, + (void *)&efi_hii_database); + if (ret != EFI_SUCCESS) + goto failure; + return ret; failure: printf("ERROR: Failure to install protocols for loaded image\n"); -- cgit v1.2.3 From cb728e51a77e515659f4834c2829a956b9f5c9f0 Mon Sep 17 00:00:00 2001 From: AKASHI Takahiro Date: Mon, 21 Jan 2019 12:13:00 +0900 Subject: efi: hii: add HII config routing/access protocols This patch is a place holder for HII configuration routing protocol and HII configuration access protocol. Signed-off-by: AKASHI Takahiro Signed-off-by: Alexander Graf --- lib/efi_loader/efi_boottime.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/efi_loader/efi_boottime.c') diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 73af490377c..fc26d6adc11 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -1570,6 +1570,12 @@ efi_status_t efi_setup_loaded_image(struct efi_device_path *device_path, if (ret != EFI_SUCCESS) goto failure; + ret = efi_add_protocol(&obj->header, + &efi_guid_hii_config_routing_protocol, + (void *)&efi_hii_config_routing); + if (ret != EFI_SUCCESS) + goto failure; + return ret; failure: printf("ERROR: Failure to install protocols for loaded image\n"); -- cgit v1.2.3 From 5fbb28958becc2e725d2ee14a35c3b2f0918c62f Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Mon, 11 Feb 2019 15:24:00 +0100 Subject: efi_loader: Make HII a config option Heinrich ran into issues with HII and iPXE which lead to #SErrors on his Odroid-C2 system. We definitely do not want to regress just yet, so let's not expose the HII protocols by default. Instead, let's make it a config option that people can play with This way, we can stabilize the code in tree without breaking any users. Once someone figures out, why this breaks iPXE (probably a NULL dereference), we can enable it by default. Reported-by: Heinrich Schuchardt Signed-off-by: Alexander Graf --- v1 -> v2: - Remove HII selftest as well v2 -> v3: - Make config option --- lib/efi_loader/efi_boottime.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/efi_loader/efi_boottime.c') diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index fc26d6adc11..f74f989e0ae 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -1558,6 +1558,7 @@ efi_status_t efi_setup_loaded_image(struct efi_device_path *device_path, if (ret != EFI_SUCCESS) goto failure; +#if CONFIG_IS_ENABLED(EFI_LOADER_HII) ret = efi_add_protocol(&obj->header, &efi_guid_hii_string_protocol, (void *)&efi_hii_string); @@ -1575,6 +1576,7 @@ efi_status_t efi_setup_loaded_image(struct efi_device_path *device_path, (void *)&efi_hii_config_routing); if (ret != EFI_SUCCESS) goto failure; +#endif return ret; failure: -- cgit v1.2.3