]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkUnixPkg/Library/UnixPeCoffLoaderLib/UnixPeCoffLoader.c
Unix version of EFI emulator
[mirror_edk2.git] / EdkUnixPkg / Library / UnixPeCoffLoaderLib / UnixPeCoffLoader.c
diff --git a/EdkUnixPkg/Library/UnixPeCoffLoaderLib/UnixPeCoffLoader.c b/EdkUnixPkg/Library/UnixPeCoffLoaderLib/UnixPeCoffLoader.c
new file mode 100644 (file)
index 0000000..ead7752
--- /dev/null
@@ -0,0 +1,52 @@
+/*++\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
+\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
+  TianoPeCoffLoader.c\r
+\r
+Abstract:\r
+\r
+  Wrap the Base PE/COFF loader with the PE COFF Protocol\r
+\r
+\r
+--*/\r
+\r
+\r
+\r
+EFI_PEI_PE_COFF_LOADER_PROTOCOL  *mPeiEfiPeiPeCoffLoader;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+PeCoffLoaderConstructor (\r
+  IN EFI_FFS_FILE_HEADER      *FfsHeader,\r
+  IN EFI_PEI_SERVICES          **PeiServices\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+\r
+  Status = (*PeiServices)->LocatePpi (\r
+                            PeiServices,\r
+                            &gEfiPeiPeCoffLoaderGuid,\r
+                            0,\r
+                            NULL,\r
+                            (VOID **)&mPeiEfiPeiPeCoffLoader\r
+                            );\r
+  return Status;\r
+}\r
+\r
+EFI_PEI_PE_COFF_LOADER_PROTOCOL *\r
+EFIAPI\r
+GetPeCoffLoaderProtocol (\r
+  )\r
+{\r
+  return mPeiEfiPeiPeCoffLoader;\r
+}\r