Skip to content
Snippets Groups Projects
Commit 1b68153a authored by Heinrich Schuchardt's avatar Heinrich Schuchardt Committed by Alexander Graf
Browse files

efi_loader: rework efi_search_obj


EFI_HANDLEs are used both in boottime and in runtime services.
efi_search_obj is a function that can be used to validate
handles. So let's make it accessible via efi_loader.h.

We can simplify the coding using list_for_each_entry.

Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent caf864e4
Branches
Tags
No related merge requests found
...@@ -192,6 +192,8 @@ void efi_restore_gd(void); ...@@ -192,6 +192,8 @@ void efi_restore_gd(void);
void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map); void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map);
/* Call this to set the current device name */ /* Call this to set the current device name */
void efi_set_bootdev(const char *dev, const char *devnr, const char *path); void efi_set_bootdev(const char *dev, const char *devnr, const char *path);
/* Call this to validate a handle and find the EFI object for it */
struct efi_object *efi_search_obj(void *handle);
/* Call this to create an event */ /* Call this to create an event */
efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl, efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl,
void (EFIAPI *notify_function) ( void (EFIAPI *notify_function) (
......
...@@ -684,14 +684,11 @@ static efi_status_t EFIAPI efi_check_event(struct efi_event *event) ...@@ -684,14 +684,11 @@ static efi_status_t EFIAPI efi_check_event(struct efi_event *event)
* @handle handle to find * @handle handle to find
* @return EFI object * @return EFI object
*/ */
static struct efi_object *efi_search_obj(void *handle) struct efi_object *efi_search_obj(void *handle)
{ {
struct list_head *lhandle;
list_for_each(lhandle, &efi_obj_list) {
struct efi_object *efiobj; struct efi_object *efiobj;
efiobj = list_entry(lhandle, struct efi_object, link); list_for_each_entry(efiobj, &efi_obj_list, link) {
if (efiobj->handle == handle) if (efiobj->handle == handle)
return efiobj; return efiobj;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment