]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/PeCoffLib.h
1) Move the structure definitions related GUID EFI_STATUS_CODE_SPECIFIC_DATA_GUID...
[mirror_edk2.git] / MdePkg / Include / Library / PeCoffLib.h
index 0a68ae640f146811d35bc6346730ee4d23214beb..93f8d06ad2e125481d1cfff61a0dfb3b4ca95f32 100644 (file)
@@ -1,22 +1,21 @@
 /** @file\r
-       Memory Only PE COFF loader\r
+  Memory Only PE COFF loader. \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
+  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:    PeCoffLib.h\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
 #ifndef __BASE_PE_COFF_LIB_H__\r
 #define __BASE_PE_COFF_LIB_H__\r
 \r
+#include <IndustryStandard/PeImage.h>\r
 //\r
 // Return status codes from the PE/COFF Loader services\r
 // BUGBUG: Find where used and see if can be replaced by RETURN_STATUS codes\r
@@ -33,7 +32,6 @@
 #define IMAGE_ERROR_FAILED_RELOCATION            9\r
 #define IMAGE_ERROR_FAILED_ICACHE_FLUSH          10\r
 \r
-\r
 //\r
 // PE/COFF Loader Read Function passed in by caller\r
 //\r
@@ -73,7 +71,6 @@ typedef struct {
   BOOLEAN                           IsTeImage;\r
 } PE_COFF_LOADER_IMAGE_CONTEXT;\r
 \r
-\r
 /**\r
   Retrieves information about a PE/COFF image.\r
 \r
@@ -157,4 +154,53 @@ PeCoffLoaderLoadImage (
   )\r
 ;\r
 \r
+\r
+/**\r
+  ImageRead function that operates on a memory buffer whos base is passed into\r
+  FileHandle. \r
+\r
+  @param  FileHandle        Ponter to baes of the input stream\r
+  @param  FileOffset        Offset to the start of the buffer\r
+  @param  ReadSize          Number of bytes to copy into the buffer\r
+  @param  Buffer            Location to place results of read\r
+\r
+  @retval RETURN_SUCCESS    Data is read from FileOffset from the Handle into \r
+                            the buffer.\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+PeCoffLoaderImageReadFromMemory (\r
+  IN     VOID    *FileHandle,\r
+  IN     UINTN   FileOffset,\r
+  IN OUT UINTN   *ReadSize,\r
+  OUT    VOID    *Buffer\r
+  )\r
+;\r
+\r
+\r
+/**\r
+  Reapply fixups on a fixed up PE32/PE32+ image to allow virutal calling at EFI\r
+  runtime. \r
+  \r
+  PE_COFF_LOADER_IMAGE_CONTEXT.FixupData stores information needed to reapply\r
+  the fixups with a virtual mapping.\r
+\r
+\r
+  @param  ImageBase          Base address of relocated image\r
+  @param  VirtImageBase      Virtual mapping for ImageBase\r
+  @param  ImageSize          Size of the image to relocate\r
+  @param  RelocationData     Location to place results of read\r
+  \r
+**/\r
+VOID\r
+EFIAPI\r
+PeCoffLoaderRelocateImageForRuntime (\r
+  IN  PHYSICAL_ADDRESS        ImageBase,\r
+  IN  PHYSICAL_ADDRESS        VirtImageBase,\r
+  IN  UINTN                   ImageSize,\r
+  IN  VOID                    *RelocationData\r
+  )\r
+;\r
+\r
+\r
 #endif\r