From 9e620719100f80892adfa8e2f810a485bce32fb9 Mon Sep 17 00:00:00 2001 From: rsun3 Date: Thu, 31 Dec 2009 08:42:28 +0000 Subject: 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 --- .../EntryPoints/EdkIIGlueSmmDriverEntryPoint.c | 72 +++++++++++----------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'EdkCompatibilityPkg/Foundation') 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 @@ -347,6 +342,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 // @@ -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); -- cgit v1.2.3