]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkUnixPkg/Library/EdkUnixPeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c
Retiring the ANT/JAVA build and removing the older EDK II packages that required...
[mirror_edk2.git] / EdkUnixPkg / Library / EdkUnixPeiPeCoffGetEntryPointLib / PeCoffGetEntryPoint.c
diff --git a/EdkUnixPkg/Library/EdkUnixPeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c b/EdkUnixPkg/Library/EdkUnixPeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c
deleted file mode 100644 (file)
index c5f2453..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*++\r
-\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:\r
-\r
-  PeCoffGetEntryPoint.c\r
-\r
-Abstract:\r
-\r
-  Tiano PE/COFF loader\r
-\r
-Revision History\r
-\r
---*/\r
-\r
-\r
-RETURN_STATUS\r
-EFIAPI\r
-PeCoffLoaderGetEntryPoint (\r
-  IN     VOID  *Pe32Data,\r
-  IN OUT VOID  **EntryPoint\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Loads a PE/COFF image into memory, this is not follow the original purpose of \r
-  PeCoffGetEntryPoint library class.  But it's ok that Unix package not run on a real \r
-  platform and this is for source level debug.\r
-\r
-Arguments:\r
-\r
-  Pe32Data   - Pointer to a PE/COFF Image\r
-\r
-  EntryPoint - Pointer to the entry point of the PE/COFF image\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS            if the EntryPoint was returned\r
-  EFI_INVALID_PARAMETER  if the EntryPoint could not be found from Pe32Data\r
-\r
---*/\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_PEI_PPI_DESCRIPTOR  *PpiDescriptor;\r
-  UNIX_PEI_LOAD_FILE_PPI *PeiUnixService;\r
-  EFI_PHYSICAL_ADDRESS    ImageAddress;\r
-  UINT64                  ImageSize;\r
-  EFI_PHYSICAL_ADDRESS    ImageEntryPoint;\r
-\r
-  Status = PeiServicesLocatePpi (\r
-             &gUnixPeiLoadFilePpiGuid,\r
-             0,\r
-             &PpiDescriptor,\r
-             (void **)&PeiUnixService\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Status = PeiUnixService->PeiLoadFileService (\r
-                           Pe32Data,\r
-                           &ImageAddress,\r
-                           &ImageSize,\r
-                           &ImageEntryPoint\r
-                           );\r
-  *EntryPoint = (VOID*)(UINTN)ImageEntryPoint;\r
-  return Status;\r
-}\r
-\r
-/**\r
-  Returns the machine type of PE/COFF image. \r
-  This is copied from MDE BasePeCoffGetEntryPointLib, the code should be sync with it.\r
-  The reason is Unix package needs to load the image to memory to support source\r
-  level debug.\r
-   \r
-\r
-  @param  Image   Pointer to a PE/COFF header\r
-\r
-  @return         Machine type or zero if not a valid iamge\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-PeCoffLoaderGetMachineType (\r
-  IN  VOID  *Pe32Data\r
-  )\r
-{  \r
-  EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION  Hdr;\r
-  EFI_IMAGE_DOS_HEADER                 *DosHdr;\r
-\r
-  DosHdr = (EFI_IMAGE_DOS_HEADER  *)Pe32Data;\r
-  if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {\r
-    Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)Pe32Data + DosHdr->e_lfanew);\r
-  } else {\r
-    Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)Pe32Data);\r
-  }\r
-\r
-  if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE)  {\r
-    return Hdr.Pe32->FileHeader.Machine;\r
-  }\r
-\r
-  return 0x0000;\r
-}\r
-\r