]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Sample/Tools/Source/GenFvImage/GenFvImageLib.h
1) Sync EdkCompatibilityPkg with EDK 1.04. The changes includes:
[mirror_edk2.git] / EdkCompatibilityPkg / Sample / Tools / Source / GenFvImage / GenFvImageLib.h
CommitLineData
3eb9473e 1/*++\r
2\r
3Copyright (c) 2004, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13 \r
14 GenFvImageLib.h\r
15\r
16Abstract:\r
17\r
18 This file contains describes the public interfaces to the GenFvImage Library.\r
19 The basic purpose of the library is to create Firmware Volume images.\r
20\r
21--*/\r
22\r
23#ifndef _EFI_GEN_FV_IMAGE_LIB_H\r
24#define _EFI_GEN_FV_IMAGE_LIB_H\r
25\r
26//\r
27// Include files\r
28//\r
95d675b5 29#include <windows.h>\r
3eb9473e 30#include "ParseInf.h"\r
31\r
32//\r
33// Following definition is used for FIT in IPF\r
34//\r
35#define COMP_TYPE_FIT_PEICORE 0x10\r
36#define COMP_TYPE_FIT_UNUSED 0x7F\r
37\r
38#define FIT_TYPE_MASK 0x7F\r
39#define CHECKSUM_BIT_MASK 0x80\r
40\r
41#pragma pack(1)\r
42\r
43typedef struct {\r
44 UINT64 CompAddress;\r
45 UINT32 CompSize;\r
46 UINT16 CompVersion;\r
47 UINT8 CvAndType;\r
48 UINT8 CheckSum;\r
49} FIT_TABLE;\r
50\r
51#pragma pack()\r
52//\r
53// Exported function prototypes\r
54//\r
55EFI_STATUS\r
56GenerateFvImage (\r
57 IN CHAR8 *InfFileImage,\r
58 IN UINTN InfFileSize,\r
59 OUT UINT8 **FvImage,\r
60 OUT UINTN *FvImageSize,\r
61 OUT CHAR8 **FvFileName,\r
62 OUT UINT8 **SymImage,\r
63 OUT UINTN *SymImageSize,\r
64 OUT CHAR8 **SymFileName\r
65 )\r
66;\r
67\r
68/*++\r
69\r
70Routine Description:\r
71\r
72 This is the main function which will be called from application.\r
73\r
74Arguments:\r
75\r
76 InfFileImage Buffer containing the INF file contents.\r
77 InfFileSize Size of the contents of the InfFileImage buffer.\r
78 FvImage Pointer to the FV image created.\r
79 FvImageSize Size of the FV image created and pointed to by FvImage.\r
80 FvFileName Requested name for the FV file.\r
81 SymImage Pointer to the Sym image created.\r
82 SymImageSize Size of the Sym image created and pointed to by SymImage.\r
83 SymFileName Requested name for the Sym file.\r
84 \r
85Returns:\r
86 \r
87 EFI_SUCCESS Function completed successfully.\r
88 EFI_OUT_OF_RESOURCES Could not allocate required resources.\r
89 EFI_ABORTED Error encountered.\r
90 EFI_INVALID_PARAMETER A required parameter was NULL.\r
91\r
92--*/\r
93EFI_STATUS\r
94UpdatePeiCoreEntryInFit (\r
95 IN FIT_TABLE *FitTablePtr,\r
96 IN UINT64 PeiCorePhysicalAddress\r
97 )\r
98;\r
99\r
100/*++\r
101\r
102Routine Description:\r
103\r
104 This function is used to update the Pei Core address in FIT, this can be used by Sec core to pass control from\r
105 Sec to Pei Core\r
106\r
107Arguments:\r
108\r
109 FitTablePtr - The pointer of FIT_TABLE.\r
110 PeiCorePhysicalAddress - The address of Pei Core entry.\r
111\r
112Returns:\r
113\r
114 EFI_SUCCESS - The PEI_CORE FIT entry was updated successfully.\r
115 EFI_NOT_FOUND - Not found the PEI_CORE FIT entry.\r
116\r
117--*/\r
118VOID\r
119UpdateFitCheckSum (\r
120 IN FIT_TABLE *FitTablePtr\r
121 )\r
122;\r
123\r
124/*++\r
125\r
126Routine Description:\r
127\r
128 This function is used to update the checksum for FIT.\r
129\r
130\r
131Arguments:\r
132\r
133 FitTablePtr - The pointer of FIT_TABLE.\r
134\r
135Returns:\r
136\r
137 None.\r
138\r
139--*/\r
140#endif\r