]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Sample/Tools/Source/GenFvImage/GenFvImageLib.h
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Sample / Tools / Source / GenFvImage / GenFvImageLib.h
diff --git a/EdkCompatibilityPkg/Sample/Tools/Source/GenFvImage/GenFvImageLib.h b/EdkCompatibilityPkg/Sample/Tools/Source/GenFvImage/GenFvImageLib.h
new file mode 100644 (file)
index 0000000..e1db1b1
--- /dev/null
@@ -0,0 +1,140 @@
+/*++\r
+\r
+Copyright (c) 2004, 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
+  GenFvImageLib.h\r
+\r
+Abstract:\r
+\r
+  This file contains describes the public interfaces to the GenFvImage Library.\r
+  The basic purpose of the library is to create Firmware Volume images.\r
+\r
+--*/\r
+\r
+#ifndef _EFI_GEN_FV_IMAGE_LIB_H\r
+#define _EFI_GEN_FV_IMAGE_LIB_H\r
+\r
+//\r
+// Include files\r
+//\r
+#include "Efi2WinNT.h"\r
+#include "ParseInf.h"\r
+\r
+//\r
+// Following definition is used for FIT in IPF\r
+//\r
+#define COMP_TYPE_FIT_PEICORE 0x10\r
+#define COMP_TYPE_FIT_UNUSED  0x7F\r
+\r
+#define FIT_TYPE_MASK         0x7F\r
+#define CHECKSUM_BIT_MASK     0x80\r
+\r
+#pragma pack(1)\r
+\r
+typedef struct {\r
+  UINT64  CompAddress;\r
+  UINT32  CompSize;\r
+  UINT16  CompVersion;\r
+  UINT8   CvAndType;\r
+  UINT8   CheckSum;\r
+} FIT_TABLE;\r
+\r
+#pragma pack()\r
+//\r
+// Exported function prototypes\r
+//\r
+EFI_STATUS\r
+GenerateFvImage (\r
+  IN CHAR8    *InfFileImage,\r
+  IN UINTN    InfFileSize,\r
+  OUT UINT8   **FvImage,\r
+  OUT UINTN   *FvImageSize,\r
+  OUT CHAR8   **FvFileName,\r
+  OUT UINT8   **SymImage,\r
+  OUT UINTN   *SymImageSize,\r
+  OUT CHAR8   **SymFileName\r
+  )\r
+;\r
+\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  This is the main function which will be called from application.\r
+\r
+Arguments:\r
+\r
+  InfFileImage  Buffer containing the INF file contents.\r
+  InfFileSize   Size of the contents of the InfFileImage buffer.\r
+  FvImage       Pointer to the FV image created.\r
+  FvImageSize   Size of the FV image created and pointed to by FvImage.\r
+  FvFileName    Requested name for the FV file.\r
+  SymImage      Pointer to the Sym image created.\r
+  SymImageSize  Size of the Sym image created and pointed to by SymImage.\r
+  SymFileName   Requested name for the Sym file.\r
+    \r
+Returns:\r
\r
+  EFI_SUCCESS             Function completed successfully.\r
+  EFI_OUT_OF_RESOURCES    Could not allocate required resources.\r
+  EFI_ABORTED             Error encountered.\r
+  EFI_INVALID_PARAMETER   A required parameter was NULL.\r
+\r
+--*/\r
+EFI_STATUS\r
+UpdatePeiCoreEntryInFit (\r
+  IN FIT_TABLE     *FitTablePtr,\r
+  IN UINT64        PeiCorePhysicalAddress\r
+  )\r
+;\r
+\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  This function is used to update the Pei Core address in FIT, this can be used by Sec core to pass control from\r
+  Sec to Pei Core\r
+\r
+Arguments:\r
+\r
+  FitTablePtr             - The pointer of FIT_TABLE.\r
+  PeiCorePhysicalAddress  - The address of Pei Core entry.\r
+\r
+Returns:\r
+\r
+  EFI_SUCCESS             - The PEI_CORE FIT entry was updated successfully.\r
+  EFI_NOT_FOUND           - Not found the PEI_CORE FIT entry.\r
+\r
+--*/\r
+VOID\r
+UpdateFitCheckSum (\r
+  IN FIT_TABLE   *FitTablePtr\r
+  )\r
+;\r
+\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  This function is used to update the checksum for FIT.\r
+\r
+\r
+Arguments:\r
+\r
+  FitTablePtr             - The pointer of FIT_TABLE.\r
+\r
+Returns:\r
+\r
+  None.\r
+\r
+--*/\r
+#endif\r