From be29ac91de937979879bc4478a058cb46f75975f Mon Sep 17 00:00:00 2001 From: klu2 Date: Fri, 6 Jul 2007 05:19:36 +0000 Subject: [PATCH] 1) PcdDxeIplSupportCustomDecompress, PcdDxeIplSupportTianoDecompress, PcdDxeIplSupportEfiDecompress, PcdDxeIplBuildShareCodeHobs should in gEfiMdeModulePkgTokenSpaceGuid token space 2) Add DxePeCoffLoaderFromHobLib library instance for DxeCore git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3098 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf | 8 +- .../DxePeCoffLoaderFromHobLib.inf | 91 +++++++++++++++++++ .../EdkDxePeCoffLoaderFromHobLib.msa | 48 ++++++++++ .../DxePeCoffLoaderFromHobLib/PeCoff.c | 50 ++++++++++ MdeModulePkg/MdeModulePkg.dec | 8 +- MdeModulePkg/MdeModulePkg.dsc | 10 +- Nt32Pkg/Nt32Pkg.dsc | 14 +-- 7 files changed, 209 insertions(+), 20 deletions(-) create mode 100644 MdeModulePkg/Library/DxePeCoffLoaderFromHobLib/DxePeCoffLoaderFromHobLib.inf create mode 100644 MdeModulePkg/Library/DxePeCoffLoaderFromHobLib/EdkDxePeCoffLoaderFromHobLib.msa create mode 100644 MdeModulePkg/Library/DxePeCoffLoaderFromHobLib/PeCoff.c diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf index 19b2b4991c..5b8aaa4e0d 100644 --- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf +++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf @@ -150,10 +150,10 @@ ################################################################################ [PcdsFeatureFlag.common] - PcdDxeIplSupportCustomDecompress|gEfiEdkModulePkgTokenSpaceGuid - PcdDxeIplSupportTianoDecompress|gEfiEdkModulePkgTokenSpaceGuid - PcdDxeIplSupportEfiDecompress|gEfiEdkModulePkgTokenSpaceGuid - PcdDxeIplBuildShareCodeHobs|gEfiEdkModulePkgTokenSpaceGuid + PcdDxeIplSupportCustomDecompress|gEfiMdeModulePkgTokenSpaceGuid + PcdDxeIplSupportTianoDecompress|gEfiMdeModulePkgTokenSpaceGuid + PcdDxeIplSupportEfiDecompress|gEfiMdeModulePkgTokenSpaceGuid + PcdDxeIplBuildShareCodeHobs|gEfiMdeModulePkgTokenSpaceGuid [PcdsFeatureFlag.IA32] PcdDxeIplSwitchToLongMode|gEfiMdeModulePkgTokenSpaceGuid diff --git a/MdeModulePkg/Library/DxePeCoffLoaderFromHobLib/DxePeCoffLoaderFromHobLib.inf b/MdeModulePkg/Library/DxePeCoffLoaderFromHobLib/DxePeCoffLoaderFromHobLib.inf new file mode 100644 index 0000000000..dba4401d33 --- /dev/null +++ b/MdeModulePkg/Library/DxePeCoffLoaderFromHobLib/DxePeCoffLoaderFromHobLib.inf @@ -0,0 +1,91 @@ +#/** @file +# EdkPeCoffLoaderLib library instance +# +# This library gets PeCoffLoader Protocol from Hob List +# 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 +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# +#**/ + +################################################################################ +# +# Defines Section - statements that will be processed to create a Makefile. +# +################################################################################ +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = EdkDxePeCoffLoaderFromHobLib + FILE_GUID = ed3de5c8-c389-44f2-a35e-2ebdc9802a49 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + LIBRARY_CLASS = PeCoffLoaderLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 IPF EBC +# + +################################################################################ +# +# Sources Section - list of files that are required for the build to succeed. +# +################################################################################ + +[Sources.common] + PeCoff.c + CommonHeader.h + + +################################################################################ +# +# Includes Section - list of Include locations that are required for +# this module. +# +################################################################################ + +[Includes] + $(WORKSPACE)/MdePkg/Include/Library + +################################################################################ +# +# Package Dependency Section - list of Package files that are required for +# this module. +# +################################################################################ + +[Packages] + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + + +################################################################################ +# +# Library Class Section - list of Library Classes that are required for +# this module. +# +################################################################################ + +[LibraryClasses] + HobLib + + +################################################################################ +# +# Guid C Name Section - list of Guids that this module uses or produces. +# +################################################################################ + +[Guids] + gEfiPeiPeCoffLoaderGuid # ALWAYS_CONSUMED + diff --git a/MdeModulePkg/Library/DxePeCoffLoaderFromHobLib/EdkDxePeCoffLoaderFromHobLib.msa b/MdeModulePkg/Library/DxePeCoffLoaderFromHobLib/EdkDxePeCoffLoaderFromHobLib.msa new file mode 100644 index 0000000000..7351c7351a --- /dev/null +++ b/MdeModulePkg/Library/DxePeCoffLoaderFromHobLib/EdkDxePeCoffLoaderFromHobLib.msa @@ -0,0 +1,48 @@ + + + + EdkDxePeCoffLoaderFromHobLib + DXE_DRIVER + ed3de5c8-c389-44f2-a35e-2ebdc9802a49 + 1.0 + EdkPeCoffLoaderLib library instance + This library gets PeCoffLoader Protocol from Hob List + 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 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052 + + + IA32 X64 IPF EBC + false + EdkDxePeCoffLoaderFromHobLib + + + + EdkPeCoffLoaderLib + + + HobLib + + + + PeCoff.c + + + + + + + + gEfiPeiPeCoffLoaderGuid + + + + EFI_SPECIFICATION_VERSION 0x00020000 + EDK_RELEASE_VERSION 0x00020000 + + \ No newline at end of file diff --git a/MdeModulePkg/Library/DxePeCoffLoaderFromHobLib/PeCoff.c b/MdeModulePkg/Library/DxePeCoffLoaderFromHobLib/PeCoff.c new file mode 100644 index 0000000000..c1a43099b6 --- /dev/null +++ b/MdeModulePkg/Library/DxePeCoffLoaderFromHobLib/PeCoff.c @@ -0,0 +1,50 @@ +/*++ + +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 + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + Decompress.c + +Abstract: + +--*/ + +// +// The package level header files this module uses +// +#include +// +// The protocols, PPI and GUID defintions for this module +// +#include +// +// The Library classes this module consumes +// +#include +#include + + + +EFI_PEI_PE_COFF_LOADER_PROTOCOL * +EFIAPI +GetPeCoffLoaderProtocol ( + ) +{ + EFI_HOB_GUID_TYPE *GuidHob; + + GuidHob = GetFirstGuidHob (&gEfiPeiPeCoffLoaderGuid); + if (GuidHob == NULL) { + return NULL; + } else { + return (EFI_PEI_PE_COFF_LOADER_PROTOCOL *)(*(UINTN *)(GET_GUID_HOB_DATA (GuidHob))); + } +} + diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 223b247bc1..fd903a93f1 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -125,12 +125,12 @@ PcdPeiPcdDatabaseGetSizeEnabled|0x00010031|gEfiEdkModulePkgTokenSpaceGuid|BOOLEAN|TRUE PcdPeiPcdDatabaseCallbackOnSetEnabled|0x00010032|gEfiEdkModulePkgTokenSpaceGuid|BOOLEAN|TRUE PcdPeiPcdDatabaseExEnabled|0x00010033|gEfiEdkModulePkgTokenSpaceGuid|BOOLEAN|TRUE - PcdDxeIplSupportEfiDecompress|0x00010034|gEfiEdkModulePkgTokenSpaceGuid|BOOLEAN|TRUE - PcdDxeIplSupportTianoDecompress|0x00010035|gEfiEdkModulePkgTokenSpaceGuid|BOOLEAN|TRUE - PcdDxeIplSupportCustomDecompress|0x00010036|gEfiEdkModulePkgTokenSpaceGuid|BOOLEAN|TRUE + PcdDxeIplSupportEfiDecompress|0x00010034|gEfiMdeModulePkgTokenSpaceGuid|BOOLEAN|TRUE + PcdDxeIplSupportTianoDecompress|0x00010035|gEfiMdeModulePkgTokenSpaceGuid|BOOLEAN|TRUE + PcdDxeIplSupportCustomDecompress|0x00010036|gEfiMdeModulePkgTokenSpaceGuid|BOOLEAN|TRUE PcdDevicePathSupportDevicePathToText|0x00010037|gEfiEdkModulePkgTokenSpaceGuid|BOOLEAN|FALSE PcdDevicePathSupportDevicePathFromText|0x00010038|gEfiEdkModulePkgTokenSpaceGuid|BOOLEAN|FALSE - PcdDxeIplBuildShareCodeHobs|0x0001003c|gEfiEdkModulePkgTokenSpaceGuid|BOOLEAN|FALSE + PcdDxeIplBuildShareCodeHobs|0x0001003c|gEfiMdeModulePkgTokenSpaceGuid|BOOLEAN|FALSE PcdNtEmulatorEnable|0x0001003e|gEfiEdkModulePkgTokenSpaceGuid|BOOLEAN|FALSE [PcdsFixedAtBuild.common] diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc index 9c0355322f..35c885780e 100644 --- a/MdeModulePkg/MdeModulePkg.dsc +++ b/MdeModulePkg/MdeModulePkg.dsc @@ -312,11 +312,11 @@ PcdNtEmulatorEnable|gEfiEdkModulePkgTokenSpaceGuid|FALSE PcdDevicePathSupportDevicePathFromText|gEfiEdkModulePkgTokenSpaceGuid|FALSE PcdDevicePathSupportDevicePathToText|gEfiEdkModulePkgTokenSpaceGuid|FALSE - PcdDxeIplSupportCustomDecompress|gEfiEdkModulePkgTokenSpaceGuid|TRUE - PcdDxeIplBuildShareCodeHobs|gEfiEdkModulePkgTokenSpaceGuid|FALSE - PcdDxeIplSupportEfiDecompress|gEfiEdkModulePkgTokenSpaceGuid|TRUE - PcdDxeIplSupportTianoDecompress|gEfiEdkModulePkgTokenSpaceGuid|TRUE - PcdDxeIplSupportCustomDecompress|gEfiEdkModulePkgTokenSpaceGuid|TRUE + PcdDxeIplSupportCustomDecompress|gEfiMdeModulePkgTokenSpaceGuid|TRUE + PcdDxeIplBuildShareCodeHobs|gEfiMdeModulePkgTokenSpaceGuid|FALSE + PcdDxeIplSupportEfiDecompress|gEfiMdeModulePkgTokenSpaceGuid|TRUE + PcdDxeIplSupportTianoDecompress|gEfiMdeModulePkgTokenSpaceGuid|TRUE + PcdDxeIplSupportCustomDecompress|gEfiMdeModulePkgTokenSpaceGuid|TRUE # PcdStatusCodeUseOEM|gEfiIntelFrameworkModulePkgTokenSpaceGuid|FALSE diff --git a/Nt32Pkg/Nt32Pkg.dsc b/Nt32Pkg/Nt32Pkg.dsc index 49de31b476..637fb14b5e 100644 --- a/Nt32Pkg/Nt32Pkg.dsc +++ b/Nt32Pkg/Nt32Pkg.dsc @@ -93,7 +93,7 @@ MemoryAllocationLib|$(WORKSPACE)/MdePkg/Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf UefiLib|$(WORKSPACE)/MdePkg/Library/UefiLib/UefiLib.inf ReportStatusCodeLib|$(WORKSPACE)/IntelFrameworkPkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf - PeCoffLoaderLib|$(WORKSPACE)/MdeModulePkg/Library/PeiDxePeCoffLoaderLib/PeCoffLoaderLib.inf + PeCoffLoaderLib|$(WORKSPACE)/MdeModulePkg/Library/DxePeCoffLoaderFromHobLib/DxePeCoffLoaderFromHobLib.inf UefiRuntimeServicesTableLib|$(WORKSPACE)/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf DebugLib|$(WORKSPACE)/IntelFrameworkPkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf @@ -231,11 +231,11 @@ [PcdsFeatureFlag.common] PcdDevicePathSupportDevicePathFromText|gEfiEdkModulePkgTokenSpaceGuid|FALSE PcdDevicePathSupportDevicePathToText|gEfiEdkModulePkgTokenSpaceGuid|FALSE - PcdDxeIplSupportCustomDecompress|gEfiEdkModulePkgTokenSpaceGuid|TRUE - PcdDxeIplBuildShareCodeHobs|gEfiEdkModulePkgTokenSpaceGuid|FALSE - PcdDxeIplSupportEfiDecompress|gEfiEdkModulePkgTokenSpaceGuid|TRUE - PcdDxeIplSupportTianoDecompress|gEfiEdkModulePkgTokenSpaceGuid|TRUE - PcdDxeIplSupportCustomDecompress|gEfiEdkModulePkgTokenSpaceGuid|TRUE + PcdDxeIplSupportCustomDecompress|gEfiMdeModulePkgTokenSpaceGuid|TRUE + PcdDxeIplBuildShareCodeHobs|gEfiMdeModulePkgTokenSpaceGuid|TRUE + PcdDxeIplSupportEfiDecompress|gEfiMdeModulePkgTokenSpaceGuid|TRUE + PcdDxeIplSupportTianoDecompress|gEfiMdeModulePkgTokenSpaceGuid|TRUE + PcdDxeIplSupportCustomDecompress|gEfiMdeModulePkgTokenSpaceGuid|TRUE [PcdsPatchableInModule.IA32] PcdStatusCodeMemorySize|gEfiIntelFrameworkModulePkgTokenSpaceGuid|1 @@ -276,7 +276,7 @@ PcdDxeIplSupportEfiDecompress|gEfiMdeModulePkgTokenSpaceGuid|TRUE PcdDxeIplSupportTianoDecompress|gEfiMdeModulePkgTokenSpaceGuid|TRUE PcdDxeIplSupportCustomDecompress|gEfiMdeModulePkgTokenSpaceGuid|TRUE - PcdDxeIplBuildShareCodeHobs|gEfiMdeModulePkgTokenSpaceGuid|TRUE + PcdDxeIplBuildShareCodeHobs|gEfiMdeModulePkgTokenSpaceGuid|TRUE PcdDxePcdDatabaseTraverseEnabled|gEfiEdkModulePkgTokenSpaceGuid|TRUE PcdStatusCodeUseHardSerial|gEfiIntelFrameworkModulePkgTokenSpaceGuid|FALSE PcdStatusCodeUseEfiSerial|gEfiIntelFrameworkModulePkgTokenSpaceGuid|FALSE