]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BasePeCoffLib/Ebc/PeCoffLoaderEx.c
Removed CommonHeader.h generated file from the MdePkg.
[mirror_edk2.git] / MdePkg / Library / BasePeCoffLib / Ebc / PeCoffLoaderEx.c
index 6cfc566bd42519f9bb67f6891cabc626823a77d8..217545436cabf2086cc9008f3b62a4b5cb903c8b 100644 (file)
 \r
 **/\r
 \r
+#include "BasePeCoffLibInternals.h"\r
 \r
+/**\r
+  Performs an EBC specific relocation fixup.\r
+\r
+  @param  Reloc       Pointer to the relocation record.\r
+  @param  Fixup       Pointer to the address to fix up.\r
+  @param  FixupData   Pointer to a buffer to log the fixups.\r
+  @param  Adjust      The offset to adjust the fixup.\r
+\r
+  @retval EFI_UNSUPPORTED Unsupported now.\r
 \r
+**/\r
+RETURN_STATUS\r
+PeCoffLoaderRelocateImageEx (\r
+  IN UINT16      *Reloc,\r
+  IN OUT CHAR8   *Fixup,\r
+  IN OUT CHAR8   **FixupData,\r
+  IN UINT64      Adjust\r
+  )\r
+{\r
+  return RETURN_UNSUPPORTED;\r
+}\r
 \r
 /**\r
-  Performs an IA-32 specific relocation fixup.\r
+  Returns TRUE if the machine type of PE/COFF image is supported. Supported \r
+  does not mean the image can be executed it means the PE/COFF loader supports\r
+  loading and relocating of the image type. It's up to the caller to support\r
+  the entry point. \r
+\r
+  This function implies the basic PE/COFF loader/relocator supports IA32, EBC,\r
+  & X64 images. Calling the entry point in a correct mannor is up to the \r
+  consumer of this library.\r
+\r
+  @param  Machine   Machine type from the PE Header.\r
+\r
+  @return TRUE if this PE/COFF loader can load the image\r
+\r
+**/\r
+BOOLEAN\r
+PeCoffLoaderImageFormatSupported (\r
+  IN  UINT16  Machine\r
+  )\r
+{\r
+  if ((Machine == EFI_IMAGE_MACHINE_IA32) || (Machine == EFI_IMAGE_MACHINE_X64) || \r
+      (Machine ==  EFI_IMAGE_MACHINE_EBC)) {\r
+    return TRUE; \r
+  }\r
 \r
-  @param  Reloc Pointer to the relocation record.\r
+  return FALSE;\r
+}\r
 \r
-  @param  Fixup Pointer to the address to fix up.\r
 \r
-  @param  FixupData Pointer to a buffer to log the fixups.\r
+/**\r
+  Performs an Itanium-based specific re-relocation fixup and is a no-op on other\r
+  instruction sets. This is used to re-relocated the image into the EFI virtual\r
+  space for runtime calls.\r
 \r
-  @param  Adjust The offset to adjust the fixup.\r
+  @param  Reloc       Pointer to the relocation record.\r
+  @param  Fixup       Pointer to the address to fix up.\r
+  @param  FixupData   Pointer to a buffer to log the fixups.\r
+  @param  Adjust      The offset to adjust the fixup.\r
 \r
-  @retval  EFI_UNSUPPORTED Unsupported now.\r
+  @return Status code.\r
 \r
 **/\r
 RETURN_STATUS\r
-PeCoffLoaderRelocateImageEx (\r
+PeHotRelocateImageEx (\r
   IN UINT16      *Reloc,\r
   IN OUT CHAR8   *Fixup,\r
   IN OUT CHAR8   **FixupData,\r