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