summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/efi_loader.h13
-rw-r--r--lib/efi_loader/efi_boottime.c2
2 files changed, 15 insertions, 0 deletions
diff --git a/include/efi_loader.h b/include/efi_loader.h
index 7af3f16ef84..3b50cd28ef0 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -180,6 +180,18 @@ struct efi_handler {
};
/**
+ * 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
*
* @link: pointers to put the handle into a linked list
@@ -201,6 +213,7 @@ struct efi_object {
struct list_head link;
/* The list of protocols */
struct list_head protocols;
+ enum efi_object_type type;
};
/**
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 0c92cc1807c..45e4d987081 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1554,6 +1554,7 @@ efi_status_t efi_setup_loaded_image(struct efi_device_path *device_path,
free(info);
return EFI_OUT_OF_RESOURCES;
}
+ obj->header.type = EFI_OBJECT_TYPE_LOADED_IMAGE;
/* Add internal object to object list */
efi_add_handle(&obj->header);
@@ -2678,6 +2679,7 @@ efi_status_t EFIAPI efi_start_image(efi_handle_t 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);
ret = EFI_CALL(image_obj->entry(image_handle, &systab));