]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/CodeTools/TianoTools/GenFvImage/GenFvImageLib.h
Restructuring for better separation of Tool packages.
[mirror_edk2.git] / Tools / CodeTools / TianoTools / 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 <Common/UefiBaseTypes.h>
30 #include <Common/MultiPhase.h>
31
32 #include "ParseInf.h"
33
34 //
35 // Following definition is used for FIT in IPF
36 //
37 #define COMP_TYPE_FIT_PEICORE 0x10
38 #define COMP_TYPE_FIT_UNUSED 0x7F
39
40 #define FIT_TYPE_MASK 0x7F
41 #define CHECKSUM_BIT_MASK 0x80
42
43 #pragma pack(1)
44
45 typedef struct {
46 UINT64 CompAddress;
47 UINT32 CompSize;
48 UINT16 CompVersion;
49 UINT8 CvAndType;
50 UINT8 CheckSum;
51 } FIT_TABLE;
52
53 #pragma pack()
54 //
55 // Exported function prototypes
56 //
57 EFI_STATUS
58 GenerateFvImage (
59 IN CHAR8 *InfFileImage,
60 IN UINTN InfFileSize,
61 OUT UINT8 **FvImage,
62 OUT UINTN *FvImageSize,
63 OUT CHAR8 **FvFileName,
64 OUT UINT8 **SymImage,
65 OUT UINTN *SymImageSize,
66 OUT CHAR8 **SymFileName
67 )
68 ;
69
70 /*++
71
72 Routine Description:
73
74 This is the main function which will be called from application.
75
76 Arguments:
77
78 InfFileImage Buffer containing the INF file contents.
79 InfFileSize Size of the contents of the InfFileImage buffer.
80 FvImage Pointer to the FV image created.
81 FvImageSize Size of the FV image created and pointed to by FvImage.
82 FvFileName Requested name for the FV file.
83 SymImage Pointer to the Sym image created.
84 SymImageSize Size of the Sym image created and pointed to by SymImage.
85 SymFileName Requested name for the Sym file.
86
87 Returns:
88
89 EFI_SUCCESS Function completed successfully.
90 EFI_OUT_OF_RESOURCES Could not allocate required resources.
91 EFI_ABORTED Error encountered.
92 EFI_INVALID_PARAMETER A required parameter was NULL.
93
94 --*/
95 EFI_STATUS
96 UpdatePeiCoreEntryInFit (
97 IN FIT_TABLE *FitTablePtr,
98 IN UINT64 PeiCorePhysicalAddress
99 )
100 ;
101
102 /*++
103
104 Routine Description:
105
106 This function is used to update the Pei Core address in FIT, this can be used by Sec core to pass control from
107 Sec to Pei Core
108
109 Arguments:
110
111 FitTablePtr - The pointer of FIT_TABLE.
112 PeiCorePhysicalAddress - The address of Pei Core entry.
113
114 Returns:
115
116 EFI_SUCCESS - The PEI_CORE FIT entry was updated successfully.
117 EFI_NOT_FOUND - Not found the PEI_CORE FIT entry.
118
119 --*/
120 VOID
121 UpdateFitCheckSum (
122 IN FIT_TABLE *FitTablePtr
123 )
124 ;
125
126 /*++
127
128 Routine Description:
129
130 This function is used to update the checksum for FIT.
131
132
133 Arguments:
134
135 FitTablePtr - The pointer of FIT_TABLE.
136
137 Returns:
138
139 None.
140
141 --*/
142 #endif