From ff6ce8da978bbcf283e34c07406085af2359f7b0 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 4 Apr 2023 07:17:48 +0200 Subject: efi_loader: avoid using HandleProtocol in helloworld.efi HandleProtocol() is deprecated and leaves an OpenedProtocolInformation behind. Use OpenProtocol(GET_PROTOCOL) instead. Signed-off-by: Heinrich Schuchardt Reviewed-by: Ilias Apalodimas --- lib/efi_loader/helloworld.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/efi_loader') diff --git a/lib/efi_loader/helloworld.c b/lib/efi_loader/helloworld.c index 49fa8cc2f00..6405f58ec3f 100644 --- a/lib/efi_loader/helloworld.c +++ b/lib/efi_loader/helloworld.c @@ -197,8 +197,10 @@ efi_status_t EFIAPI efi_main(efi_handle_t handle, print_config_tables(); /* Get the loaded image protocol */ - ret = boottime->handle_protocol(handle, &loaded_image_guid, - (void **)&loaded_image); + ret = boottime->open_protocol(handle, &loaded_image_guid, + (void **)&loaded_image, NULL, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if (ret != EFI_SUCCESS) { con_out->output_string (con_out, u"Cannot open loaded image protocol\r\n"); @@ -219,9 +221,10 @@ efi_status_t EFIAPI efi_main(efi_handle_t handle, (con_out, u"Missing device handle\r\n"); goto out; } - ret = boottime->handle_protocol(loaded_image->device_handle, - &device_path_guid, - (void **)&device_path); + ret = boottime->open_protocol(loaded_image->device_handle, + &device_path_guid, + (void **)&device_path, NULL, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (ret != EFI_SUCCESS) { con_out->output_string (con_out, u"Missing device path for device handle\r\n"); -- cgit v1.2.3 From 199675b9d54c9be682e98b4835d22da98c0b11e3 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 4 Apr 2023 07:23:53 +0200 Subject: efi_loader: avoid using HandleProtocol in initrddump.efi HandleProtocol() is deprecated and leaves an OpenedProtocolInformation behind. Use OpenProtocol(GET_PROTOCOL) instead. Signed-off-by: Heinrich Schuchardt Reviewed-by: Ilias Apalodimas --- lib/efi_loader/initrddump.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/efi_loader') diff --git a/lib/efi_loader/initrddump.c b/lib/efi_loader/initrddump.c index 971a3b6236c..5b470f48194 100644 --- a/lib/efi_loader/initrddump.c +++ b/lib/efi_loader/initrddump.c @@ -291,8 +291,9 @@ static efi_status_t get_initrd(void **initrd, efi_uintn_t *initrd_size) error(u"Load File2 protocol not found\r\n"); return ret; } - ret = bs->handle_protocol(handle, &load_file2_guid, - (void **)&load_file2_prot); + ret = bs->open_protocol(handle, &load_file2_guid, + (void **)&load_file2_prot, NULL, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); ret = load_file2_prot->load_file(load_file2_prot, dp, false, initrd_size, NULL); if (ret != EFI_BUFFER_TOO_SMALL) { -- cgit v1.2.3 From ee23830b6ed20827c24e3ef775e6c75948a61b94 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Wed, 5 Apr 2023 20:15:17 +0800 Subject: efi: loader: Make efi_event_queue and efi_register_notify_events static efi_event_queue and efi_register_notify_events are only referenced in efi_boottime.c Signed-off-by: Bin Meng --- lib/efi_loader/efi_boottime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/efi_loader') diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index caaab685ee0..d5065f296ae 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -35,7 +35,7 @@ LIST_HEAD(efi_obj_list); __efi_runtime_data LIST_HEAD(efi_events); /* List of queued events */ -LIST_HEAD(efi_event_queue); +static LIST_HEAD(efi_event_queue); /* Flag to disable timer activity in ExitBootServices() */ static bool timers_enabled = true; @@ -44,7 +44,7 @@ static bool timers_enabled = true; bool efi_st_keep_devices; /* List of all events registered by RegisterProtocolNotify() */ -LIST_HEAD(efi_register_notify_events); +static LIST_HEAD(efi_register_notify_events); /* Handle of the currently executing image */ static efi_handle_t current_image; -- cgit v1.2.3 From 207b686421563c574eb1179efd4fa7eedddfab5f Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Wed, 5 Apr 2023 20:15:18 +0800 Subject: efi: loader: Make efi_mem static efi_mem is only referenced in efi_memory.c Signed-off-by: Bin Meng --- lib/efi_loader/efi_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/efi_loader') diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index 8f82496740f..e2ca78d935f 100644 --- a/lib/efi_loader/efi_memory.c +++ b/lib/efi_loader/efi_memory.c @@ -36,7 +36,7 @@ struct efi_mem_list { #define EFI_CARVE_OVERLAPS_NONRAM -3 /* This list contains all memory map items */ -LIST_HEAD(efi_mem); +static LIST_HEAD(efi_mem); #ifdef CONFIG_EFI_LOADER_BOUNCE_BUFFER void *efi_bounce_buffer; -- cgit v1.2.3 From 6fc4fc38ac4d11ac53b4d539588d216d107f7703 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Wed, 5 Apr 2023 20:15:19 +0800 Subject: efi: loader: Make efi_runtime_mmio static efi_runtime_mmio is only referenced in efi_boottime.c Signed-off-by: Bin Meng --- lib/efi_loader/efi_runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/efi_loader') diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c index cee96bfc7fc..bf54d6ad871 100644 --- a/lib/efi_loader/efi_runtime.c +++ b/lib/efi_loader/efi_runtime.c @@ -32,7 +32,7 @@ struct efi_runtime_mmio_list { }; /* This list contains all runtime available mmio regions */ -LIST_HEAD(efi_runtime_mmio); +static LIST_HEAD(efi_runtime_mmio); static efi_status_t __efi_runtime EFIAPI efi_unimplemented(void); -- cgit v1.2.3