]> git.proxmox.com Git - mirror_edk2.git/commitdiff
remove the gEfiLoadPeImageProtocolGuid and replace all references for it with BasePeC...
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 16 Apr 2009 02:43:41 +0000 (02:43 +0000)
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 16 Apr 2009 02:43:41 +0000 (02:43 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8095 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DriverEntryPoint.c

index ed3d2c667a0ef9174d4a5ebf88760842785f2119..afa09e75a6832da5ec144d0a4035cf6e48654833 100644 (file)
@@ -174,16 +174,6 @@ _ModuleEntryPoint (
   //\r
   gBS = SystemTable->BootServices;\r
 \r
-  //\r
-  // Retrieve the Loaded Image Protocol\r
-  //\r
-  Status = gBS->HandleProtocol (\r
-                  ImageHandle,\r
-                  &gEfiLoadedImageProtocolGuid,\r
-                  (VOID*)&LoadedImage\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
   //\r
   // Retrieve SMM Base Protocol\r
   //\r
@@ -203,6 +193,15 @@ _ModuleEntryPoint (
   //\r
   //\r
   if (!InSmm) {\r
+    //\r
+    // Retrieve the Loaded Image Protocol\r
+    //\r
+    Status = gBS->HandleProtocol (\r
+                  ImageHandle,\r
+                  &gEfiLoadedImageProtocolGuid,\r
+                  (VOID*)&LoadedImage\r
+                  );\r
+    ASSERT_EFI_ERROR (Status);\r
     //\r
     // Retrieve the Device Path Protocol from the DeviceHandle from which this driver was loaded\r
     //\r
@@ -222,8 +221,21 @@ _ModuleEntryPoint (
     // Load the image in memory to SMRAM; it will automatically generate the\r
     // SMI.\r
     //\r
-    Status = SmmBase->Register (SmmBase, CompleteFilePath, NULL, 0, &Handle, FALSE);\r
+    Status = SmmBase->Register (SmmBase, CompleteFilePath, LoadedImage->ImageBase, 0, &Handle, FALSE);\r
     ASSERT_EFI_ERROR (Status);\r
+    //\r
+    // Optionally install the unload handler\r
+    //\r
+    if (_gDriverUnloadImageCount > 0) {\r
+      Status = gBS->HandleProtocol (\r
+                      ImageHandle,\r
+                      &gEfiLoadedImageProtocolGuid,\r
+                      (VOID **)&LoadedImage\r
+                      );\r
+      ASSERT_EFI_ERROR (Status);\r
+      LoadedImage->Unload = _DriverUnloadHandler;\r
+    }\r
+\r
     return Status;\r
   }\r
 \r
@@ -232,19 +244,6 @@ _ModuleEntryPoint (
   //\r
   ProcessLibraryConstructorList (ImageHandle, SystemTable);\r
 \r
-  //\r
-  // Optionally install the unload handler\r
-  //\r
-  if (_gDriverUnloadImageCount > 0) {\r
-    Status = gBS->HandleProtocol (\r
-                    ImageHandle,\r
-                    &gEfiLoadedImageProtocolGuid,\r
-                    (VOID **)&LoadedImage\r
-                    );\r
-    ASSERT_EFI_ERROR (Status);\r
-    LoadedImage->Unload = _DriverUnloadHandler;\r
-  }\r
-\r
   //\r
   // Call the list of driver entry points\r
   //\r