X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=IntelFrameworkPkg%2FLibrary%2FDxeSmmDriverEntryPoint%2FDriverEntryPoint.c;h=e6892cbafefd3527b3e20477505a956fdb50d345;hb=2b649f74775d0efd1e75c91f77c3045ae6249cb4;hp=ed3d2c667a0ef9174d4a5ebf88760842785f2119;hpb=3abd5df7d91f14c8755e4248370656fde4a32c05;p=mirror_edk2.git diff --git a/IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DriverEntryPoint.c b/IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DriverEntryPoint.c index ed3d2c667a..e6892cbafe 100644 --- a/IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DriverEntryPoint.c +++ b/IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DriverEntryPoint.c @@ -3,8 +3,8 @@ EfiMain() is common driver entry point for all SMM driver who uses DxeSmmDriverEntryPoint library class. -Copyright (c) 2006, Intel Corporation
-All rights reserved. This program and the accompanying materials +Copyright (c) 2006, 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 http://opensource.org/licenses/bsd-license.php @@ -174,16 +174,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 // @@ -203,6 +193,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 // @@ -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; } @@ -232,19 +244,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 //