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