summaryrefslogtreecommitdiff
path: root/IntelFrameworkPkg
diff options
context:
space:
mode:
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-04-16 02:43:41 +0000
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-04-16 02:43:41 +0000
commitd46dfe99e53e7f587f54a28c702d11199ccf3a20 (patch)
tree223189dffb8c1c2490a8844e5df93033f90c4cc9 /IntelFrameworkPkg
parentf8b30ae529b451e6bda94d30ed68f8492c309d8c (diff)
downloadedk2-platforms-d46dfe99e53e7f587f54a28c702d11199ccf3a20.tar.xz
remove the gEfiLoadPeImageProtocolGuid and replace all references for it with BasePeCoffLib.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8095 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkPkg')
-rw-r--r--IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DriverEntryPoint.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DriverEntryPoint.c b/IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DriverEntryPoint.c
index ed3d2c667a..afa09e75a6 100644
--- a/IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DriverEntryPoint.c
+++ b/IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DriverEntryPoint.c
@@ -175,16 +175,6 @@ _ModuleEntryPoint (
gBS = SystemTable->BootServices;
//
- // Retrieve the Loaded Image Protocol
- //
- Status = gBS->HandleProtocol (
- ImageHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID*)&LoadedImage
- );
- ASSERT_EFI_ERROR (Status);
-
- //
// Retrieve SMM Base Protocol
//
Status = gBS->LocateProtocol (
@@ -204,6 +194,15 @@ _ModuleEntryPoint (
//
if (!InSmm) {
//
+ // Retrieve the Loaded Image Protocol
+ //
+ Status = gBS->HandleProtocol (
+ ImageHandle,
+ &gEfiLoadedImageProtocolGuid,
+ (VOID*)&LoadedImage
+ );
+ ASSERT_EFI_ERROR (Status);
+ //
// Retrieve the Device Path Protocol from the DeviceHandle from which this driver was loaded
//
Status = gBS->HandleProtocol (
@@ -222,8 +221,21 @@ _ModuleEntryPoint (
// Load the image in memory to SMRAM; it will automatically generate the
// SMI.
//
- Status = SmmBase->Register (SmmBase, CompleteFilePath, NULL, 0, &Handle, FALSE);
+ Status = SmmBase->Register (SmmBase, CompleteFilePath, LoadedImage->ImageBase, 0, &Handle, FALSE);
ASSERT_EFI_ERROR (Status);
+ //
+ // Optionally install the unload handler
+ //
+ if (_gDriverUnloadImageCount > 0) {
+ Status = gBS->HandleProtocol (
+ ImageHandle,
+ &gEfiLoadedImageProtocolGuid,
+ (VOID **)&LoadedImage
+ );
+ ASSERT_EFI_ERROR (Status);
+ LoadedImage->Unload = _DriverUnloadHandler;
+ }
+
return Status;
}
@@ -233,19 +245,6 @@ _ModuleEntryPoint (
ProcessLibraryConstructorList (ImageHandle, SystemTable);
//
- // Optionally install the unload handler
- //
- if (_gDriverUnloadImageCount > 0) {
- Status = gBS->HandleProtocol (
- ImageHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID **)&LoadedImage
- );
- ASSERT_EFI_ERROR (Status);
- LoadedImage->Unload = _DriverUnloadHandler;
- }
-
- //
// Call the list of driver entry points
//
Status = ProcessModuleEntryPointList (ImageHandle, SystemTable);