#include <Library/PerformanceLib.h>\r
#include <Library/UefiDecompressLib.h>\r
#include <Library/CustomDecompressLib.h>\r
-#include <Library/PeCoffLoaderLib.h>\r
#include <Library/CacheMaintenanceLib.h>\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/PeCoffLib.h>\r
extern EFI_HANDLE gDxeCoreImageHandle;\r
\r
extern EFI_DECOMPRESS_PROTOCOL gEfiDecompress;\r
-extern EFI_PEI_PE_COFF_LOADER_PROTOCOL *gEfiPeiPeCoffLoader;\r
\r
extern EFI_RUNTIME_ARCH_PROTOCOL *gRuntime;\r
extern EFI_CPU_ARCH_PROTOCOL *gCpu;\r
#include <Library/PeiServicesLib.h>\r
#include <Library/ReportStatusCodeLib.h>\r
#include <Library/CacheMaintenanceLib.h>\r
-#include <Library/PeCoffLoaderLib.h>\r
#include <Library/UefiDecompressLib.h>\r
#include <Library/CustomDecompressLib.h>\r
#include <Library/PeiServicesTablePointerLib.h>\r
\r
extern BOOLEAN gInMemory;\r
\r
-EFI_STATUS\r
-PeiFindFile (\r
- IN UINT8 Type,\r
- IN EFI_SECTION_TYPE SectionType,\r
- OUT EFI_GUID *FileName,\r
- OUT VOID **Pe32Data\r
- )\r
-;\r
-\r
EFI_STATUS\r
PeiLoadFile (\r
IN EFI_PEI_FILE_HANDLE FileHandle,\r
)\r
;\r
\r
-EFI_STATUS\r
-PeiImageRead (\r
- IN VOID *FileHandle,\r
- IN UINTN FileOffset,\r
- IN OUT UINTN *ReadSize,\r
- OUT VOID *Buffer\r
- )\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-DxeIplLoadFile (\r
- IN EFI_PEI_FV_FILE_LOADER_PPI *This,\r
- IN EFI_FFS_FILE_HEADER *FfsHeader,\r
- OUT EFI_PHYSICAL_ADDRESS *ImageAddress,\r
- OUT UINT64 *ImageSize,\r
- OUT EFI_PHYSICAL_ADDRESS *EntryPoint\r
- );\r
-\r
-EFI_STATUS\r
-ShadowDxeIpl (\r
- IN EFI_FFS_FILE_HEADER *DxeIpl,\r
- IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader\r
- );\r
-\r
EFI_STATUS\r
EFIAPI\r
DxeLoadCore (\r
IN EFI_PEI_PPI_DESCRIPTOR *EndOfPeiSignal\r
);\r
\r
-EFI_STATUS\r
-PeiProcessFile (\r
- IN EFI_SECTION_TYPE SectionType,\r
- IN EFI_FFS_FILE_HEADER *FfsFileHeader,\r
- OUT VOID **Pe32Data,\r
- IN EFI_PEI_HOB_POINTERS *OrigHob\r
- );\r
-\r
EFI_STATUS\r
EFIAPI\r
PeimInitializeDxeIpl (\r
\r
Routine Description:\r
\r
- Regitser PeCoffLoader to PeiCore PrivateData. And install\r
- Pei Load File PPI.\r
+ Install Pei Load File PPI.\r
\r
Arguments:\r
\r
#include <Library/PerformanceLib.h>\r
#include <Library/PeiServicesLib.h>\r
#include <Library/ReportStatusCodeLib.h>\r
+#include <Library/PeCoffLib.h>\r
#include <Library/PeCoffGetEntryPointLib.h>\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/CacheMaintenanceLib.h>\r
#include <Library/TimerLib.h>\r
-#include <Library/PeCoffLoaderLib.h>\r
#include <IndustryStandard/PeImage.h>\r
#include <Library/PeiServicesTablePointerLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
\r
Routine Description:\r
\r
- Regitser PeCoffLoader to PeiCore PrivateData. And install\r
- Pei Load File PPI.\r
+ Install Pei Load File PPI.\r
\r
Arguments:\r
\r
[Guids]\r
gPeiAprioriFileNameGuid\r
gEfiFirmwareFileSystem2Guid\r
- gEfiPeiPeCoffLoaderGuid\r
\r
[Ppis]\r
gEfiPeiSecurityPpiGuid # PPI_NOTIFY SOMETIMES_CONSUMED\r
+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- EdkPeCoffLoaderLib.h\r
-\r
-Abstract:\r
- Wrap the Base PE/COFF loader with the PE COFF Protocol\r
-\r
- \r
-\r
---*/\r
-\r
-#ifndef __PE_COFF_LOADER_LIB_H_\r
-#define __PE_COFF_LOADER_LIB_H_\r
-\r
-#include <Guid/PeiPeCoffLoader.h>\r
-\r
-EFI_PEI_PE_COFF_LOADER_PROTOCOL*\r
-EFIAPI\r
-GetPeCoffLoaderProtocol (\r
- VOID\r
- );\r
-\r
-#endif\r
+++ /dev/null
-#/** @file\r
-# EdkPeCoffLoaderLib library instance\r
-#\r
-# This library gets PeCoffLoader Protocol from Hob List\r
-# Copyright (c) 2006, Intel Corporation.\r
-#\r
-# All rights reserved. This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-#**/\r
-\r
-[Defines]\r
- INF_VERSION = 0x00010005\r
- BASE_NAME = EdkDxePeCoffLoaderFromHobLib\r
- FILE_GUID = ed3de5c8-c389-44f2-a35e-2ebdc9802a49\r
- MODULE_TYPE = DXE_DRIVER\r
- VERSION_STRING = 1.0\r
- LIBRARY_CLASS = PeCoffLoaderLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER \r
- EDK_RELEASE_VERSION = 0x00020000\r
- EFI_SPECIFICATION_VERSION = 0x00020000\r
-\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources.common]\r
- PeCoff.c\r
-\r
-[Packages]\r
- MdeModulePkg/MdeModulePkg.dec\r
- MdePkg/MdePkg.dec\r
-\r
-[LibraryClasses]\r
- HobLib\r
-\r
-\r
-[Guids]\r
- gEfiPeiPeCoffLoaderGuid # ALWAYS_CONSUMED\r
-\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
- <MsaHeader>\r
- <ModuleName>EdkDxePeCoffLoaderFromHobLib</ModuleName>\r
- <ModuleType>DXE_DRIVER</ModuleType>\r
- <GuidValue>ed3de5c8-c389-44f2-a35e-2ebdc9802a49</GuidValue>\r
- <Version>1.0</Version>\r
- <Abstract>EdkPeCoffLoaderLib library instance</Abstract>\r
- <Description>This library gets PeCoffLoader Protocol from Hob List</Description>\r
- <Copyright>Copyright (c) 2006, Intel Corporation.</Copyright>\r
- <License>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.</License>\r
- <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>\r
- </MsaHeader>\r
- <ModuleDefinitions>\r
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
- <BinaryModule>false</BinaryModule>\r
- <OutputFileBasename>EdkDxePeCoffLoaderFromHobLib</OutputFileBasename>\r
- </ModuleDefinitions>\r
- <LibraryClassDefinitions>\r
- <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER">\r
- <Keyword>EdkPeCoffLoaderLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>HobLib</Keyword>\r
- </LibraryClass>\r
- </LibraryClassDefinitions>\r
- <SourceFiles>\r
- <Filename>PeCoff.c</Filename>\r
- </SourceFiles>\r
- <PackageDependencies>\r
- <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
- <Package PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d"/>\r
- </PackageDependencies>\r
- <Guids>\r
- <GuidCNames Usage="ALWAYS_CONSUMED">\r
- <GuidCName>gEfiPeiPeCoffLoaderGuid</GuidCName>\r
- </GuidCNames>\r
- </Guids>\r
- <Externs>\r
- <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
- <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
- </Externs>\r
-</ModuleSurfaceArea>
\ No newline at end of file
+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- Decompress.c\r
-\r
-Abstract:\r
- \r
---*/\r
-\r
-\r
-#include <PiDxe.h>\r
-\r
-#include <Guid/PeiPeCoffLoader.h>\r
-\r
-#include <Library/PeCoffLoaderLib.h>\r
-#include <Library/HobLib.h>\r
-\r
-\r
-\r
-EFI_PEI_PE_COFF_LOADER_PROTOCOL *\r
-EFIAPI\r
-GetPeCoffLoaderProtocol (\r
- )\r
-{\r
- EFI_HOB_GUID_TYPE *GuidHob;\r
-\r
- GuidHob = GetFirstGuidHob (&gEfiPeiPeCoffLoaderGuid);\r
- if (GuidHob == NULL) {\r
- return NULL;\r
- } else {\r
- return (EFI_PEI_PE_COFF_LOADER_PROTOCOL *)(*(UINTN *)(GET_GUID_HOB_DATA (GuidHob)));\r
- }\r
-}\r
-\r
+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2006 - 2007, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- EdkPeCoffLoader.c\r
-\r
-Abstract:\r
-\r
- Wrap the Base PE/COFF loader with the PE COFF Protocol\r
-\r
-\r
---*/\r
-\r
-\r
-#include <PiPei.h>\r
-\r
-#include <Guid/PeiPeCoffLoader.h>\r
-\r
-#include <Library/PeCoffLib.h>\r
-\r
-#include <IndustryStandard/PeImage.h>\r
-\r
-\r
-STATIC\r
-EFI_STATUS\r
-EFIAPI\r
-PeCoffLoaderLibGetImageInfo (\r
- IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *This,\r
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext\r
- )\r
-{\r
- EFI_STATUS Status;\r
-\r
- Status = PeCoffLoaderGetImageInfo (ImageContext);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- switch (ImageContext->ImageType) {\r
-\r
- case EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION:\r
- ImageContext->ImageCodeMemoryType = EfiLoaderCode;\r
- ImageContext->ImageDataMemoryType = EfiLoaderData;\r
- break;\r
-\r
- case EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER:\r
- ImageContext->ImageCodeMemoryType = EfiBootServicesCode;\r
- ImageContext->ImageDataMemoryType = EfiBootServicesData;\r
- break;\r
-\r
- case EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER:\r
- case EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER:\r
- ImageContext->ImageCodeMemoryType = EfiRuntimeServicesCode;\r
- ImageContext->ImageDataMemoryType = EfiRuntimeServicesData;\r
- break;\r
-\r
- default:\r
- ImageContext->ImageError = IMAGE_ERROR_INVALID_SUBSYSTEM;\r
- return RETURN_UNSUPPORTED;\r
- }\r
-\r
- return Status;\r
-}\r
-\r
-STATIC\r
-EFI_STATUS\r
-EFIAPI\r
-PeCoffLoaderLibLoadImage (\r
- IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *This,\r
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext\r
- )\r
-{\r
- return PeCoffLoaderLoadImage (ImageContext);\r
-}\r
-\r
-STATIC\r
-EFI_STATUS\r
-EFIAPI\r
-PeCoffLoaderLibRelocateImage (\r
- IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *This,\r
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext\r
- )\r
-{\r
- return PeCoffLoaderRelocateImage (ImageContext);\r
-}\r
-\r
-STATIC\r
-EFI_STATUS\r
-EFIAPI\r
-PeCoffLoaderLibUnloadimage (\r
- IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *This,\r
- IN PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext\r
- )\r
-{\r
- return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_PEI_PE_COFF_LOADER_PROTOCOL mPeiEfiPeiPeCoffLoader = {\r
- PeCoffLoaderLibGetImageInfo,\r
- PeCoffLoaderLibLoadImage,\r
- PeCoffLoaderLibRelocateImage,\r
- PeCoffLoaderLibUnloadimage\r
-};\r
-\r
-EFI_PEI_PE_COFF_LOADER_PROTOCOL *\r
-EFIAPI\r
-GetPeCoffLoaderProtocol (\r
- )\r
-{\r
- return &mPeiEfiPeiPeCoffLoader;\r
-}\r
-\r
-\r
+++ /dev/null
-#/** @file\r
-# DxePeCoffLoaderLib library instance\r
-#\r
-# This library provides PeCoffLoader protocol based on PeCoffLib functions.\r
-# Copyright (c) 2006, Intel Corporation.\r
-#\r
-# All rights reserved. This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-#**/\r
-\r
-[Defines]\r
- INF_VERSION = 0x00010005\r
- BASE_NAME = PeiDxePeCoffLoaderLib\r
- FILE_GUID = 858bbbc9-474f-4556-a361-0ae52a44ffa5\r
- MODULE_TYPE = PEIM\r
- VERSION_STRING = 1.0\r
- LIBRARY_CLASS = PeCoffLoaderLib|DXE_CORE PEIM \r
- EDK_RELEASE_VERSION = 0x00020000\r
- EFI_SPECIFICATION_VERSION = 0x00020000\r
-\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources.common]\r
- PeCoffLoader.c\r
-\r
-\r
-[Packages]\r
- MdePkg/MdePkg.dec\r
- MdeModulePkg/MdeModulePkg.dec\r
-\r
-\r
-[LibraryClasses]\r
- PeCoffLib\r
-\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
- <MsaHeader>\r
- <ModuleName>PeiDxePeCoffLoaderLib</ModuleName>\r
- <ModuleType>PEIM</ModuleType>\r
- <GuidValue>858bbbc9-474f-4556-a361-0ae52a44ffa5</GuidValue>\r
- <Version>1.0</Version>\r
- <Abstract>DxePeCoffLoaderLib library instance</Abstract>\r
- <Description>This library provides PeCoffLoader protocol based on PeCoffLib functions.</Description>\r
- <Copyright>Copyright (c) 2006, Intel Corporation.</Copyright>\r
- <License>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.</License>\r
- <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>\r
- </MsaHeader>\r
- <ModuleDefinitions>\r
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
- <BinaryModule>false</BinaryModule>\r
- <OutputFileBasename>PeiDxePeCoffLoaderLib</OutputFileBasename>\r
- </ModuleDefinitions>\r
- <LibraryClassDefinitions>\r
- <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_CORE PEIM">\r
- <Keyword>PeiDxeCorePeCoffLoaderLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>PeCoffLib</Keyword>\r
- </LibraryClass>\r
- </LibraryClassDefinitions>\r
- <SourceFiles>\r
- <Filename>PeCoffLoader.c</Filename>\r
- <Filename>PeCoffLoaderLibInternals.h</Filename>\r
- </SourceFiles>\r
- <PackageDependencies>\r
- <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
- <Package PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d"/>\r
- </PackageDependencies>\r
- <Externs>\r
- <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
- <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
- </Externs>\r
-</ModuleSurfaceArea>
\ No newline at end of file
[LibraryClasses.common]\r
IpIoLib|Include/Library/IpIoLib.h\r
NetLib|Include/Library/NetLib.h \r
- PeCoffLoaderLib|Include/Library/PeCoffLoaderLib.h \r
ResetSystemLib|Include/Library/ResetSystemLib.h \r
UdpIoLib|Include/Library/UdpIoLib.h\r
S3Lib|Include/Library/S3Lib.h\r