TianoCore EDK2 master
Loading...
Searching...
No Matches
PcdDataBaseSignatureGuid.h
Go to the documentation of this file.
1
9#ifndef _PCD_DATABASE_SIGNATURE_GUID_H_
10#define _PCD_DATABASE_SIGNATURE_GUID_H_
11
12#define PCD_DATA_BASE_SIGNATURE_GUID \
13{ 0x3c7d193c, 0x682c, 0x4c14, { 0xa6, 0x8f, 0x55, 0x2d, 0xea, 0x4f, 0x43, 0x7e } }
14
15extern EFI_GUID gPcdDataBaseSignatureGuid;
16
17//
18// Common definitions
19//
20typedef UINT64 SKU_ID;
21
22#define PCD_TYPE_SHIFT 28
23
24#define PCD_TYPE_DATA (0x0U << PCD_TYPE_SHIFT)
25#define PCD_TYPE_HII (0x8U << PCD_TYPE_SHIFT)
26#define PCD_TYPE_VPD (0x4U << PCD_TYPE_SHIFT)
27#define PCD_TYPE_STRING (0x1U << PCD_TYPE_SHIFT)
28
29#define PCD_TYPE_ALL_SET (PCD_TYPE_DATA | PCD_TYPE_HII | PCD_TYPE_VPD | PCD_TYPE_STRING)
30
31#define PCD_DATUM_TYPE_SHIFT 24
32
33#define PCD_DATUM_TYPE_POINTER (0x0U << PCD_DATUM_TYPE_SHIFT)
34#define PCD_DATUM_TYPE_UINT8 (0x1U << PCD_DATUM_TYPE_SHIFT)
35#define PCD_DATUM_TYPE_UINT16 (0x2U << PCD_DATUM_TYPE_SHIFT)
36#define PCD_DATUM_TYPE_UINT32 (0x4U << PCD_DATUM_TYPE_SHIFT)
37#define PCD_DATUM_TYPE_UINT64 (0x8U << PCD_DATUM_TYPE_SHIFT)
38
39#define PCD_DATUM_TYPE_ALL_SET (PCD_DATUM_TYPE_POINTER | \
40 PCD_DATUM_TYPE_UINT8 | \
41 PCD_DATUM_TYPE_UINT16 | \
42 PCD_DATUM_TYPE_UINT32 | \
43 PCD_DATUM_TYPE_UINT64)
44
45#define PCD_DATUM_TYPE_SHIFT2 20
46
47#define PCD_DATUM_TYPE_UINT8_BOOLEAN (0x1U << PCD_DATUM_TYPE_SHIFT2)
48
49#define PCD_DATABASE_OFFSET_MASK (~(PCD_TYPE_ALL_SET | PCD_DATUM_TYPE_ALL_SET | PCD_DATUM_TYPE_UINT8_BOOLEAN))
50
51typedef struct {
52 UINT32 ExTokenNumber;
53 UINT16 TokenNumber; // Token Number for Dynamic-Ex PCD.
54 UINT16 ExGuidIndex; // Index of GuidTable in units of GUID.
56
57typedef struct {
58 UINT32 StringIndex; // Offset in String Table in units of UINT8.
59 UINT32 DefaultValueOffset; // Offset of the Default Value.
60 UINT16 GuidTableIndex; // Offset in Guid Table in units of GUID.
61 UINT16 Offset; // Offset in Variable.
62 UINT32 Attributes; // Variable attributes.
63 UINT16 Property; // Variable property.
64 UINT16 Reserved;
66
67typedef struct {
68 UINT32 Offset;
69} VPD_HEAD;
70
71typedef UINT32 STRING_HEAD;
72
73typedef UINT16 SIZE_INFO;
74
75typedef struct {
76 UINT32 TokenSpaceCNameIndex; // Offset in String Table in units of UINT8.
77 UINT32 PcdCNameIndex; // Offset in String Table in units of UINT8.
79
80typedef UINT32 TABLE_OFFSET;
81
82typedef struct {
83 GUID Signature; // PcdDataBaseGuid.
84 UINT32 BuildVersion;
85 UINT32 Length; // Length of DEFAULT SKU PCD DB
86 SKU_ID SystemSkuId; // Current SkuId value.
87 UINT32 LengthForAllSkus; // Length of all SKU PCD DB
88 UINT32 UninitDataBaseSize; // Total size for PCD those default value with 0.
89 TABLE_OFFSET LocalTokenNumberTableOffset;
90 TABLE_OFFSET ExMapTableOffset;
91 TABLE_OFFSET GuidTableOffset;
92 TABLE_OFFSET StringTableOffset;
93 TABLE_OFFSET SizeTableOffset;
94 TABLE_OFFSET SkuIdTableOffset;
95 TABLE_OFFSET PcdNameTableOffset;
96 UINT16 LocalTokenCount; // LOCAL_TOKEN_NUMBER for all.
97 UINT16 ExTokenCount; // EX_TOKEN_NUMBER for DynamicEx.
98 UINT16 GuidTableCount; // The Number of Guid in GuidTable.
99 UINT8 Pad[6]; // Pad bytes to satisfy the alignment.
100
101 //
102 // Default initialized external PCD database binary structure
103 //
104 // Padding is needed to keep necessary alignment
105 //
106 // SKU_ID SkuIdTable[]; // SkuIds system supports.
107 // UINT64 ValueUint64[];
108 // UINT32 ValueUint32[];
109 // VPD_HEAD VpdHead[]; // VPD Offset
110 // DYNAMICEX_MAPPING ExMapTable[]; // DynamicEx PCD mapped to LocalIndex in LocalTokenNumberTable. It can be accessed by the ExMapTableOffset.
111 // UINT32 LocalTokenNumberTable[]; // Offset | DataType | PCD Type. It can be accessed by LocalTokenNumberTableOffset.
112 // GUID GuidTable[]; // GUID for DynamicEx and HII PCD variable Guid. It can be accessed by the GuidTableOffset.
113 // STRING_HEAD StringHead[]; // String PCD
114 // PCD_NAME_INDEX PcdNameTable[]; // PCD name index info. It can be accessed by the PcdNameTableOffset.
115 // VARIABLE_HEAD VariableHead[]; // HII PCD
116 // UINT8 StringTable[]; // String for String PCD value and HII PCD Variable Name. It can be accessed by StringTableOffset.
117 // SIZE_INFO SizeTable[]; // MaxSize and CurSize for String PCD. It can be accessed by SizeTableOffset.
118 // UINT16 ValueUint16[];
119 // UINT8 ValueUint8[];
120 // BOOLEAN ValueBoolean[];
122
123//
124// PEI and DXE Pcd driver use the same PCD database
125//
128
129typedef struct {
130 PEI_PCD_DATABASE *PeiDb;
131 DXE_PCD_DATABASE *DxeDb;
133
134typedef struct {
135 UINT32 Offset : 24;
136 UINT32 Value : 8;
138
139typedef struct {
140 SKU_ID SkuId;
141 UINT16 DefaultId;
142 UINT8 Reserved[6];
144
145typedef struct {
146 //
147 // Full size, it must be at 8 byte alignment.
148 //
149 UINT32 DataSize;
150 //
151 // HeaderSize includes HeaderSize fields and DefaultInfo arrays
152 //
153 UINT32 HeaderSize;
154 //
155 // DefaultInfo arrays those have the same default setting.
156 //
157 PCD_DEFAULT_INFO DefaultInfo[1];
158 //
159 // Default data is stored as variable storage or the array of DATA_DELTA.
160 //
162
163#define PCD_NV_STORE_DEFAULT_BUFFER_SIGNATURE SIGNATURE_32('N', 'S', 'D', 'B')
164
165typedef struct {
166 //
167 // PCD_NV_STORE_DEFAULT_BUFFER_SIGNATURE
168 //
169 UINT32 Signature;
170 //
171 // Length of the taken default buffer
172 //
173 UINT32 Length;
174 //
175 // Length of the total reserved buffer
176 //
177 UINT32 MaxLength;
178 //
179 // Reserved for 8 byte alignment
180 //
181 UINT32 Reserved;
182 // one or more PCD_DEFAULT_DATA
184
185//
186// NvStoreDefaultValueBuffer layout:
187// +-------------------------------------+
188// | PCD_NV_STORE_DEFAULT_BUFFER_HEADER |
189// +-------------------------------------+
190// | PCD_DEFAULT_DATA (DEFAULT, Standard)|
191// +-------------------------------------+
192// | PCD_DATA_DELTA (DEFAULT, Standard)|
193// +-------------------------------------+
194// | ...... |
195// +-------------------------------------+
196// | PCD_DEFAULT_DATA (SKU A, Standard) |
197// +-------------------------------------+
198// | PCD_DATA_DELTA (SKU A, Standard) |
199// +-------------------------------------+
200// | ...... |
201// +-------------------------------------+
202//
203
204#pragma pack(1)
205typedef struct {
206 SKU_ID SkuId;
207 SKU_ID SkuIdCompared;
208 UINT32 Length;
209 // PCD_DATA_DELTA DeltaData[]
211
212//
213// PCD database layout:
214// +---------------------------------+
215// | PCD_DATABASE_INIT (DEFAULT SKU) |
216// +---------------------------------+
217// | PCD_DATABASE_SKU_DELTA (SKU A) |
218// +---------------------------------+
219// | PCD_DATABASE_SKU_DELTA (SKU B) |
220// +---------------------------------+
221// | ...... |
222// +---------------------------------+
223//
224#pragma pack()
225
226#endif
Definition: Base.h:213