Browse Source

Moved LOADED_IMAGE_PROTOCOL definitions into efiprot.h,
with other protocol definitions.

Signed-off-by: Nathan Blythe <nblythe@lgsinnovations.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>

Nigel Croxon 9 years ago
parent
commit
3b31a5e394
3 changed files with 42 additions and 8 deletions
  1. 2 8
      inc/efiapi.h
  2. 1 0
      inc/efilib.h
  3. 39 0
      inc/efiprot.h

+ 2 - 8
inc/efiapi.h

@@ -351,15 +351,9 @@ EFI_STATUS
     IN CHAR16                       *ExitData OPTIONAL
     );
 
-typedef 
-EFI_STATUS
-(EFIAPI *EFI_IMAGE_UNLOAD) (
-    IN EFI_HANDLE                   ImageHandle
-    );
-
 
 // Image handle
-#define LOADED_IMAGE_PROTOCOL      \
+/*#define LOADED_IMAGE_PROTOCOL      \
     { 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
 
 #define EFI_IMAGE_INFORMATION_REVISION      0x1000
@@ -386,7 +380,7 @@ typedef struct {
     // If the driver image supports a dynamic unload request
     EFI_IMAGE_UNLOAD                Unload;
 
-} EFI_LOADED_IMAGE;
+} EFI_LOADED_IMAGE;*/
 
 
 typedef

+ 1 - 0
inc/efilib.h

@@ -63,6 +63,7 @@ extern EFI_GUID PciIoProtocol;
 extern EFI_GUID DriverBindingProtocol;
 extern EFI_GUID ComponentNameProtocol;
 extern EFI_GUID ComponentName2Protocol;
+extern EFI_GUID LoadedImageProtocol;
 extern EFI_GUID HashProtocol;
 
 extern EFI_GUID EfiGlobalVariable;

+ 39 - 0
inc/efiprot.h

@@ -926,5 +926,44 @@ typedef struct _EFI_COMPONENT_NAME2 {
   CHAR8                                   *SupportedLanguages;
 } EFI_COMPONENT_NAME2;
 
+
+//
+// Loaded Image Protocol
+//
+#define LOADED_IMAGE_PROTOCOL      \
+    { 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
+
+typedef 
+EFI_STATUS
+(EFIAPI *EFI_IMAGE_UNLOAD) (
+    IN EFI_HANDLE                   ImageHandle
+    );
+
+#define EFI_IMAGE_INFORMATION_REVISION      0x1000
+typedef struct {
+    UINT32                          Revision;
+    EFI_HANDLE                      ParentHandle;
+    struct _EFI_SYSTEM_TABLE        *SystemTable;
+
+    // Source location of image
+    EFI_HANDLE                      DeviceHandle;
+    EFI_DEVICE_PATH                 *FilePath;
+    VOID                            *Reserved;
+
+    // Images load options
+    UINT32                          LoadOptionsSize;
+    VOID                            *LoadOptions;
+
+    // Location of where image was loaded
+    VOID                            *ImageBase;
+    UINT64                          ImageSize;
+    EFI_MEMORY_TYPE                 ImageCodeType;
+    EFI_MEMORY_TYPE                 ImageDataType;
+
+    // If the driver image supports a dynamic unload request
+    EFI_IMAGE_UNLOAD                Unload;
+} EFI_LOADED_IMAGE;
+
+
 #endif