Commit cd73aba6 authored by Heinrich Schuchardt's avatar Heinrich Schuchardt
Browse files

efi_loader: mark started images



In UnloadImage() we need to know if an image is already started.

Add a field to the handle structure identifying loaded and started images.
Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
parent 8dfb5e6e
...@@ -179,6 +179,18 @@ struct efi_handler { ...@@ -179,6 +179,18 @@ struct efi_handler {
struct list_head open_infos; struct list_head open_infos;
}; };
/**
* enum efi_object_type - type of EFI object
*
* In UnloadImage we must be able to identify if the handle relates to a
* started image.
*/
enum efi_object_type {
EFI_OBJECT_TYPE_UNDEFINED = 0,
EFI_OBJECT_TYPE_LOADED_IMAGE,
EFI_OBJECT_TYPE_STARTED_IMAGE,
};
/** /**
* struct efi_object - dereferenced EFI handle * struct efi_object - dereferenced EFI handle
* *
...@@ -201,6 +213,7 @@ struct efi_object { ...@@ -201,6 +213,7 @@ struct efi_object {
struct list_head link; struct list_head link;
/* The list of protocols */ /* The list of protocols */
struct list_head protocols; struct list_head protocols;
enum efi_object_type type;
}; };
/** /**
......
...@@ -1554,6 +1554,7 @@ efi_status_t efi_setup_loaded_image(struct efi_device_path *device_path, ...@@ -1554,6 +1554,7 @@ efi_status_t efi_setup_loaded_image(struct efi_device_path *device_path,
free(info); free(info);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
obj->header.type = EFI_OBJECT_TYPE_LOADED_IMAGE;
/* Add internal object to object list */ /* Add internal object to object list */
efi_add_handle(&obj->header); efi_add_handle(&obj->header);
...@@ -2678,6 +2679,7 @@ efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle, ...@@ -2678,6 +2679,7 @@ efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
} }
current_image = image_handle; current_image = image_handle;
image_obj->header.type = EFI_OBJECT_TYPE_STARTED_IMAGE;
EFI_PRINT("Jumping into 0x%p\n", image_obj->entry); EFI_PRINT("Jumping into 0x%p\n", image_obj->entry);
ret = EFI_CALL(image_obj->entry(image_handle, &systab)); ret = EFI_CALL(image_obj->entry(image_handle, &systab));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment