summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Foundation
diff options
context:
space:
mode:
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2009-12-31 08:42:28 +0000
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2009-12-31 08:42:28 +0000
commit9e620719100f80892adfa8e2f810a485bce32fb9 (patch)
tree23f2cf4fd9ab14e563539569e7b143e7986c4f1d /EdkCompatibilityPkg/Foundation
parenta77e0eb17aecf3c4504e526063771eb8b4cc0968 (diff)
downloadedk2-platforms-9e620719100f80892adfa8e2f810a485bce32fb9.tar.xz
Add 4 Framework/PI SMM thunk drivers. Combined use of these drivers can support usage model of PI SMM infrastructure + Framework Chipset SMM code + Framework platform SMM code in ECP platforms.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9657 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Foundation')
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c
index 9d5f467cfd..6dd128af8c 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2006, Intel Corporation
+Copyright (c) 2004 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -314,19 +314,14 @@ _ModuleEntryPoint (
EFI_HANDLE Handle;
//
- // Cache a pointer to the Boot Services Table
+ // Call constructor for all libraries
//
- mBS = SystemTable->BootServices;
+ ProcessLibraryConstructorList (ImageHandle, SystemTable);
//
- // Retrieve the Loaded Image Protocol
+ // Cache a pointer to the Boot Services Table
//
- Status = mBS->HandleProtocol (
- ImageHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID*)&LoadedImage
- );
- ASSERT_EFI_ERROR (Status);
+ mBS = SystemTable->BootServices;
//
// Retrieve SMM Base Protocol
@@ -348,6 +343,27 @@ _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 (
@@ -368,33 +384,17 @@ _ModuleEntryPoint (
//
Status = SmmBase->Register (SmmBase, CompleteFilePath, NULL, 0, &Handle, FALSE);
ASSERT_EFI_ERROR (Status);
- 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;
+ } 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
+ //
+ // 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);