X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FInclude%2FLibrary%2FPeCoffLib.h;h=ba65628a22405740d40893bfb081c083e935c2c0;hp=d1db92e17751c37bf13f1829f36e0d7bac3ef648;hb=HEAD;hpb=9095d37b8fe5bfc3d02adad6ba7fd7359ebc0107 diff --git a/MdePkg/Include/Library/PeCoffLib.h b/MdePkg/Include/Library/PeCoffLib.h index d1db92e177..b458794537 100644 --- a/MdePkg/Include/Library/PeCoffLib.h +++ b/MdePkg/Include/Library/PeCoffLib.h @@ -6,13 +6,7 @@ and can be ported easily to any environment. Copyright (c) 2006 - 2018, 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 that 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. +SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -82,121 +76,121 @@ typedef struct { /// /// Set by PeCoffLoaderGetImageInfo() to the ImageBase in the PE/COFF header. /// - PHYSICAL_ADDRESS ImageAddress; + PHYSICAL_ADDRESS ImageAddress; /// /// Set by PeCoffLoaderGetImageInfo() to the SizeOfImage in the PE/COFF header. /// Image size includes the size of Debug Entry if it is present. /// - UINT64 ImageSize; + UINT64 ImageSize; /// /// Is set to zero by PeCoffLoaderGetImageInfo(). If DestinationAddress is non-zero, /// PeCoffLoaderRelocateImage() will relocate the image using this base address. /// If the DestinationAddress is zero, the ImageAddress will be used as the base /// address of relocation. /// - PHYSICAL_ADDRESS DestinationAddress; + PHYSICAL_ADDRESS DestinationAddress; /// /// PeCoffLoaderLoadImage() sets EntryPoint to to the entry point of the PE/COFF image. /// - PHYSICAL_ADDRESS EntryPoint; + PHYSICAL_ADDRESS EntryPoint; /// /// Passed in by the caller to PeCoffLoaderGetImageInfo() and PeCoffLoaderLoadImage() /// to abstract accessing the image from the library. /// - PE_COFF_LOADER_READ_FILE ImageRead; + PE_COFF_LOADER_READ_FILE ImageRead; /// /// Used as the FileHandle passed into the ImageRead function when it's called. /// - VOID *Handle; + VOID *Handle; /// /// Caller allocated buffer of size FixupDataSize that can be optionally allocated /// prior to calling PeCoffLoaderRelocateImage(). /// This buffer is filled with the information used to fix up the image. /// The fixups have been applied to the image and this entry is just for information. /// - VOID *FixupData; + VOID *FixupData; /// /// Set by PeCoffLoaderGetImageInfo() to the Section Alignment in the PE/COFF header. /// If the image is a TE image, then this field is set to 0. /// - UINT32 SectionAlignment; + UINT32 SectionAlignment; /// /// Set by PeCoffLoaderGetImageInfo() to offset to the PE/COFF header. /// If the PE/COFF image does not start with a DOS header, this value is zero. /// Otherwise, it's the offset to the PE/COFF header. /// - UINT32 PeCoffHeaderOffset; + UINT32 PeCoffHeaderOffset; /// /// Set by PeCoffLoaderGetImageInfo() to the Relative Virtual Address of the debug directory, /// if it exists in the image /// - UINT32 DebugDirectoryEntryRva; + UINT32 DebugDirectoryEntryRva; /// /// Set by PeCoffLoaderLoadImage() to CodeView area of the PE/COFF Debug directory. /// - VOID *CodeView; + VOID *CodeView; /// /// Set by PeCoffLoaderLoadImage() to point to the PDB entry contained in the CodeView area. /// The PdbPointer points to the filename of the PDB file used for source-level debug of /// the image by a debugger. /// - CHAR8 *PdbPointer; + CHAR8 *PdbPointer; /// /// Is set by PeCoffLoaderGetImageInfo() to the Section Alignment in the PE/COFF header. /// - UINTN SizeOfHeaders; + UINTN SizeOfHeaders; /// /// Not used by this library class. Other library classes that layer on top of this library /// class fill in this value as part of their GetImageInfo call. /// This allows the caller of the library to know what type of memory needs to be allocated /// to load and relocate the image. /// - UINT32 ImageCodeMemoryType; + UINT32 ImageCodeMemoryType; /// /// Not used by this library class. Other library classes that layer on top of this library /// class fill in this value as part of their GetImageInfo call. /// This allows the caller of the library to know what type of memory needs to be allocated /// to load and relocate the image. /// - UINT32 ImageDataMemoryType; + UINT32 ImageDataMemoryType; /// /// Set by any of the library functions if they encounter an error. /// - UINT32 ImageError; + UINT32 ImageError; /// /// Set by PeCoffLoaderLoadImage() to indicate the size of FixupData that the caller must /// allocate before calling PeCoffLoaderRelocateImage(). /// - UINTN FixupDataSize; + UINTN FixupDataSize; /// /// Set by PeCoffLoaderGetImageInfo() to the machine type stored in the PE/COFF header. /// - UINT16 Machine; + UINT16 Machine; /// /// Set by PeCoffLoaderGetImageInfo() to the subsystem type stored in the PE/COFF header. /// - UINT16 ImageType; + UINT16 ImageType; /// /// Set by PeCoffLoaderGetImageInfo() to TRUE if the PE/COFF image does not contain /// relocation information. /// - BOOLEAN RelocationsStripped; + BOOLEAN RelocationsStripped; /// /// Set by PeCoffLoaderGetImageInfo() to TRUE if the image is a TE image. /// For a definition of the TE Image format, see the Platform Initialization Pre-EFI /// Initialization Core Interface Specification. /// - BOOLEAN IsTeImage; + BOOLEAN IsTeImage; /// /// Set by PeCoffLoaderLoadImage() to the HII resource offset /// if the image contains a custom PE/COFF resource with the type 'HII'. /// Otherwise, the entry remains to be 0. /// - PHYSICAL_ADDRESS HiiResourceData; + PHYSICAL_ADDRESS HiiResourceData; /// /// Private storage for implementation specific data. /// - UINT64 Context; + UINT64 Context; } PE_COFF_LOADER_IMAGE_CONTEXT; /** @@ -302,7 +296,6 @@ PeCoffLoaderLoadImage ( IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext ); - /** Reads contents of a PE/COFF image from a buffer in system memory. @@ -329,13 +322,12 @@ PeCoffLoaderLoadImage ( RETURN_STATUS EFIAPI PeCoffLoaderImageReadFromMemory ( - IN VOID *FileHandle, - IN UINTN FileOffset, - IN OUT UINTN *ReadSize, - OUT VOID *Buffer + IN VOID *FileHandle, + IN UINTN FileOffset, + IN OUT UINTN *ReadSize, + OUT VOID *Buffer ); - /** Reapply fixups on a fixed up PE32/PE32+ image to allow virtual calling at EFI runtime. @@ -362,10 +354,10 @@ PeCoffLoaderImageReadFromMemory ( VOID EFIAPI PeCoffLoaderRelocateImageForRuntime ( - IN PHYSICAL_ADDRESS ImageBase, - IN PHYSICAL_ADDRESS VirtImageBase, - IN UINTN ImageSize, - IN VOID *RelocationData + IN PHYSICAL_ADDRESS ImageBase, + IN PHYSICAL_ADDRESS VirtImageBase, + IN UINTN ImageSize, + IN VOID *RelocationData ); /** @@ -389,4 +381,5 @@ EFIAPI PeCoffLoaderUnloadImage ( IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext ); + #endif