diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-16 12:43:44 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-16 12:43:44 +0000 |
commit | 83b009c7eeb1a7f2261b1b082c2eac1a6dd39800 (patch) | |
tree | bf70e421bb847d1d049832dbcb7fcf84f131725c | |
parent | f7eb3b463c8d0a0c31a7ae12e93c880863dc781e (diff) | |
download | edk2-83b009c7eeb1a7f2261b1b082c2eac1a6dd39800.tar.gz |
sync part of patch r11904 from main trunk.
To roll back the updating in EdkIIGlueSmmDriverEntryPoint.c from patch r9657. ProcessLibraryConstructorList() should only be invoked in SMM.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/branches/UDK2010@11835 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c index c359bbb627..f364ac8d7b 100644 --- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c +++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c @@ -321,14 +321,19 @@ _ModuleEntryPoint ( EFI_HANDLE Handle;
//
- // Call constructor for all libraries
+ // Cache a pointer to the Boot Services Table
//
- ProcessLibraryConstructorList (ImageHandle, SystemTable);
+ mBS = SystemTable->BootServices;
//
- // Cache a pointer to the Boot Services Table
+ // Retrieve the Loaded Image Protocol
//
- mBS = SystemTable->BootServices;
+ Status = mBS->HandleProtocol (
+ ImageHandle,
+ &gEfiLoadedImageProtocolGuid,
+ (VOID*)&LoadedImage
+ );
+ ASSERT_EFI_ERROR (Status);
//
// Retrieve SMM Base Protocol
@@ -350,27 +355,6 @@ _ModuleEntryPoint ( //
if (!InSmm) {
//
- // Retrieve the Loaded Image Protocol
- //
- Status = mBS->HandleProtocol (
- ImageHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID*)&LoadedImage
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // Install the unload handler
- //
- Status = mBS->HandleProtocol (
- ImageHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID **)&LoadedImage
- );
- ASSERT_EFI_ERROR (Status);
- LoadedImage->Unload = _DriverUnloadHandler;
-
- //
// Retrieve the Device Path Protocol from the DeviceHandle tha this driver was loaded from
//
Status = mBS->HandleProtocol (
@@ -391,18 +375,34 @@ _ModuleEntryPoint ( //
Status = SmmBase->Register (SmmBase, CompleteFilePath, NULL, 0, &Handle, FALSE);
ASSERT_EFI_ERROR (Status);
- } else {
-
- //
- // Call the list of driver entry points
- //
- #ifdef __EDKII_GLUE_MODULE_ENTRY_POINT__
- Status = (__EDKII_GLUE_MODULE_ENTRY_POINT__ (ImageHandle, SystemTable));
- #else
- Status = EFI_SUCCESS;
- #endif
+ return Status;
}
+ //
+ // Call constructor for all libraries
+ //
+ ProcessLibraryConstructorList (ImageHandle, SystemTable);
+
+ //
+ // Install the unload handler
+ //
+ Status = mBS->HandleProtocol (
+ ImageHandle,
+ &gEfiLoadedImageProtocolGuid,
+ (VOID **)&LoadedImage
+ );
+ ASSERT_EFI_ERROR (Status);
+ LoadedImage->Unload = _DriverUnloadHandler;
+
+ //
+ // Call the list of driver entry points
+ //
+ #ifdef __EDKII_GLUE_MODULE_ENTRY_POINT__
+ Status = (__EDKII_GLUE_MODULE_ENTRY_POINT__ (ImageHandle, SystemTable));
+ #else
+ Status = EFI_SUCCESS;
+ #endif
+
if (EFI_ERROR (Status)) {
ProcessLibraryDestructorList (ImageHandle, SystemTable);
}
|