]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/Common/PeCoffLib.h
BaseTools: Clean up source files
[mirror_edk2.git] / BaseTools / Source / C / Common / PeCoffLib.h
index 31c6f0fca136103e394c20e3a9c9610208572fa7..80c8c33c76ff96883410fd351be7724aa5093e2e 100644 (file)
@@ -1,16 +1,14 @@
 /** @file\r
-       Function prototypes and defines on Memory Only PE COFF loader\r
+  Function prototypes and defines on Memory Only PE COFF loader\r
 \r
-       Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-  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 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  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
@@ -22,7 +20,7 @@
 // BUGBUG: Find where used and see if can be replaced by RETURN_STATUS codes\r
 //\r
 #define IMAGE_ERROR_SUCCESS                      0\r
-#define IMAGE_ERROR_IMAGE_READ                   1  \r
+#define IMAGE_ERROR_IMAGE_READ                   1\r
 #define IMAGE_ERROR_INVALID_PE_HEADER_SIGNATURE  2\r
 #define IMAGE_ERROR_INVALID_MACHINE_TYPE         3\r
 #define IMAGE_ERROR_INVALID_SUBSYSTEM            4\r
@@ -75,15 +73,15 @@ typedef struct {
 \r
 \r
 /**\r
-       Retrieves information on a PE/COFF image\r
+  Retrieves information on a PE/COFF image\r
 \r
-       @param  ImageContext The context of the image being loaded\r
+  @param  ImageContext The context of the image being loaded\r
 \r
-       @retval EFI_SUCCESS The information on the PE/COFF image was collected.\r
-       @retval EFI_INVALID_PARAMETER ImageContext is NULL.\r
-       @retval EFI_UNSUPPORTED The PE/COFF image is not supported.\r
-       @retval Otherwise The error status from reading the PE/COFF image using the\r
-       ImageContext->ImageRead() function\r
+  @retval  EFI_SUCCESS The information on the PE/COFF image was collected.\r
+  @retval  EFI_INVALID_PARAMETER ImageContext is NULL.\r
+  @retval  EFI_UNSUPPORTED The PE/COFF image is not supported.\r
+  @retval  Otherwise The error status from reading the PE/COFF image using the\r
+  ImageContext->ImageRead() function\r
 \r
 **/\r
 RETURN_STATUS\r
@@ -94,13 +92,13 @@ PeCoffLoaderGetImageInfo (
 ;\r
 \r
 /**\r
-       Relocates a PE/COFF image in memory\r
+  Relocates a PE/COFF image in memory\r
 \r
-       @param  ImageContext Contains information on the loaded image to relocate\r
+  @param  ImageContext Contains information on the loaded image to relocate\r
 \r
-       @retval EFI_SUCCESS      if the PE/COFF image was relocated\r
-       @retval EFI_LOAD_ERROR   if the image is not a valid PE/COFF image\r
-       @retval EFI_UNSUPPORTED  not support\r
+  @retval EFI_SUCCESS      if the PE/COFF image was relocated\r
+  @retval EFI_LOAD_ERROR   if the image is not a valid PE/COFF image\r
+  @retval EFI_UNSUPPORTED  not support\r
 \r
 **/\r
 RETURN_STATUS\r
@@ -111,14 +109,14 @@ PeCoffLoaderRelocateImage (
 ;\r
 \r
 /**\r
-       Loads a PE/COFF image into memory\r
+  Loads a PE/COFF image into memory\r
 \r
-       @param  ImageContext Contains information on image to load into memory\r
+  @param  ImageContext Contains information on image to load into memory\r
 \r
-       @retval EFI_SUCCESS            if the PE/COFF image was loaded\r
-       @retval EFI_BUFFER_TOO_SMALL   if the caller did not provide a large enough buffer\r
-       @retval EFI_LOAD_ERROR         if the image is a runtime driver with no relocations\r
-       @retval EFI_INVALID_PARAMETER  if the image address is invalid\r
+  @retval EFI_SUCCESS            if the PE/COFF image was loaded\r
+  @retval EFI_BUFFER_TOO_SMALL   if the caller did not provide a large enough buffer\r
+  @retval EFI_LOAD_ERROR         if the image is a runtime driver with no relocations\r
+  @retval EFI_INVALID_PARAMETER  if the image address is invalid\r
 \r
 **/\r
 RETURN_STATUS\r
@@ -150,7 +148,7 @@ PeCoffLoaderGetEntryPoint (
 //\r
 \r
 /**\r
-  Pass in a pointer to an ARM MOVT or MOVW immediate instruciton and \r
+  Pass in a pointer to an ARM MOVT or MOVW immediate instruciton and\r
   return the immediate data encoded in the instruction\r
 \r
   @param  Instruction   Pointer to ARM MOVT or MOVW immediate instruction\r
@@ -159,6 +157,7 @@ PeCoffLoaderGetEntryPoint (
 \r
 **/\r
 UINT16\r
+EFIAPI\r
 ThumbMovtImmediateAddress (\r
   IN UINT16 *Instruction\r
   );\r
@@ -171,11 +170,41 @@ ThumbMovtImmediateAddress (
 \r
 **/\r
 VOID\r
+EFIAPI\r
 ThumbMovtImmediatePatch (\r
   IN OUT UINT16 *Instruction,\r
   IN     UINT16 Address\r
   );\r
 \r
 \r
+/**\r
+  Pass in a pointer to an ARM MOVW/MOVT instruciton pair and\r
+  return the immediate data encoded in the two` instruction\r
+\r
+  @param  Instructions  Pointer to ARM MOVW/MOVT insturction pair\r
+\r
+  @return Immediate address encoded in the instructions\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+ThumbMovwMovtImmediateAddress (\r
+  IN UINT16 *Instructions\r
+  );\r
+\r
+/**\r
+  Update an ARM MOVW/MOVT immediate instruction instruction pair.\r
+\r
+  @param  Instructions  Pointer to ARM MOVW/MOVT instruction pair\r
+  @param  Address       New addres to patch into the instructions\r
+**/\r
+VOID\r
+EFIAPI\r
+ThumbMovwMovtImmediatePatch (\r
+  IN OUT UINT16 *Instructions,\r
+  IN     UINT32 Address\r
+  );\r
+\r
+\r
 \r
 #endif\r