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
This commit is contained in:
@@ -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
|
||||
@@ -313,21 +313,16 @@ _ModuleEntryPoint (
|
||||
EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath;
|
||||
EFI_HANDLE Handle;
|
||||
|
||||
//
|
||||
// Call constructor for all libraries
|
||||
//
|
||||
ProcessLibraryConstructorList (ImageHandle, SystemTable);
|
||||
|
||||
//
|
||||
// Cache a pointer to the Boot Services Table
|
||||
//
|
||||
mBS = SystemTable->BootServices;
|
||||
|
||||
//
|
||||
// Retrieve the Loaded Image Protocol
|
||||
//
|
||||
Status = mBS->HandleProtocol (
|
||||
ImageHandle,
|
||||
&gEfiLoadedImageProtocolGuid,
|
||||
(VOID*)&LoadedImage
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
//
|
||||
// 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,34 +384,18 @@ _ModuleEntryPoint (
|
||||
//
|
||||
Status = SmmBase->Register (SmmBase, CompleteFilePath, NULL, 0, &Handle, FALSE);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
return 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
|
||||
}
|
||||
|
||||
//
|
||||
// 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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user