]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdeModulePkg / Universal / DriverSampleDxe / NVDataStruc.h
CommitLineData
0bb0f8b8 1/** @file\r
2\r
36c50bd5
AC
3Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>*\r
4(C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>\r
9d510e61 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
0bb0f8b8 6\r
7Module Name:\r
8\r
9 NVDataStruc.h\r
10\r
11Abstract:\r
12\r
13 NVData structure used by the sample driver\r
14\r
15Revision History:\r
16\r
17\r
18**/\r
19\r
7064c0a5 20#ifndef _NVDATASTRUC_H_\r
21#define _NVDATASTRUC_H_\r
0bb0f8b8 22\r
d91c7bf9 23#include <Guid/HiiPlatformSetupFormset.h>\r
96a65fc8 24#include <Guid/HiiFormMapMethodGuid.h>\r
c8ad2d7a
LG
25#include <Guid/DriverSampleHii.h>\r
26#include <Guid/ZeroGuid.h>\r
78c2b9a3 27\r
1436aea4
MK
28#define CONFIGURATION_VARSTORE_ID 0x1234\r
29#define BITS_VARSTORE_ID 0x2345\r
0bb0f8b8 30\r
31#pragma pack(1)\r
911405a3 32\r
6b86f6f3
BD
33//\r
34// !!! For a structure with a series of bit fields and used as a storage in vfr file, and if the bit fields do not add up to the size of the defined type.\r
35// In the C code use sizeof() to get the size the strucure, the results may vary form the compiler(VS,GCC...).\r
36// But the size of the storage calculated by VfrCompiler is fixed (calculate with alignment).\r
37// To avoid above case, we need to make the total bit width in the structure aligned with the size of the defined type for these bit fields. We can:\r
38// 1. Add bit field (with/without name) with remianing with for padding.\r
39// 2. Add unnamed bit field with 0 for padding, the amount of padding is determined by the alignment characteristics of the members of the structure.\r
40//\r
911405a3 41typedef struct {\r
1436aea4
MK
42 UINT16 NestByteField;\r
43 UINT8 : 1; // unamed field can be used for padding\r
44 UINT8 NestBitCheckbox : 1;\r
45 UINT8 NestBitOneof : 2;\r
46 UINT8 : 0; // Special width 0 can be used to force alignment at the next word boundary\r
47 UINT8 NestBitNumeric : 4;\r
911405a3
DB
48} MY_BITS_DATA;\r
49\r
50typedef union {\r
f7d05bdd
DB
51 UINT8 UnionNumeric;\r
52 UINT8 UnionNumericAlias;\r
911405a3
DB
53} MY_EFI_UNION_DATA;\r
54\r
0bb0f8b8 55typedef struct {\r
1436aea4
MK
56 UINT16 MyStringData[40];\r
57 UINT16 SomethingHiddenForHtml;\r
58 UINT8 HowOldAreYouInYearsManual;\r
59 UINT16 HowTallAreYouManual;\r
60 UINT8 HowOldAreYouInYears;\r
61 UINT16 HowTallAreYou;\r
62 UINT8 MyFavoriteNumber;\r
63 UINT8 TestLateCheck;\r
64 UINT8 TestLateCheck2;\r
65 UINT8 QuestionAboutTreeHugging;\r
66 UINT8 ChooseToActivateNuclearWeaponry;\r
67 UINT8 SuppressGrayOutSomething;\r
68 UINT8 OrderedList[8];\r
69 UINT16 BootOrder[8];\r
70 UINT8 BootOrderLarge;\r
71 UINT8 DynamicRefresh;\r
72 UINT8 DynamicOneof;\r
73 UINT8 DynamicOrderedList[5];\r
74 UINT8 Reserved;\r
75 EFI_HII_REF RefData;\r
76 UINT8 NameValueVar0;\r
77 UINT16 NameValueVar1;\r
78 UINT16 NameValueVar2[20];\r
79 UINT8 SerialPortNo;\r
80 UINT8 SerialPortStatus;\r
81 UINT16 SerialPortIo;\r
82 UINT8 SerialPortIrq;\r
83 UINT8 GetDefaultValueFromCallBack;\r
84 UINT8 GetDefaultValueFromAccess;\r
85 EFI_HII_TIME Time;\r
86 UINT8 RefreshGuidCount;\r
87 UINT8 Match2;\r
88 UINT8 GetDefaultValueFromCallBackForOrderedList[3];\r
89 UINT8 BitCheckbox : 1;\r
90 UINT8 ReservedBits : 7; // Reserved bit fields for padding.\r
91 UINT16 BitOneof : 6;\r
92 UINT16 : 0; // Width 0 used to force alignment.\r
93 UINT16 BitNumeric : 12;\r
94 MY_BITS_DATA MyBitData;\r
95 MY_EFI_UNION_DATA MyUnionData;\r
96 UINT8 QuestionXUefiKeywordRestStyle;\r
97 UINT8 QuestionNonXUefiKeywordRestStyle;\r
0bb0f8b8 98} DRIVER_SAMPLE_CONFIGURATION;\r
99\r
100//\r
101// 2nd NV data structure definition\r
102//\r
103typedef struct {\r
1436aea4
MK
104 UINT8 Field8;\r
105 UINT16 Field16;\r
106 UINT8 OrderedList[3];\r
107 UINT16 SubmittedCallback;\r
78c2b9a3 108} MY_EFI_VARSTORE_DATA;\r
0bb0f8b8 109\r
911405a3
DB
110//\r
111// 3rd NV data structure definition\r
112//\r
113typedef struct {\r
1436aea4
MK
114 MY_BITS_DATA BitsData;\r
115 UINT32 EfiBitGrayoutTest : 5;\r
116 UINT32 EfiBitNumeric : 4;\r
117 UINT32 EfiBitOneof : 10;\r
118 UINT32 EfiBitCheckbox : 1;\r
119 UINT32 : 0; // Width 0 used to force alignment.\r
911405a3
DB
120} MY_EFI_BITS_VARSTORE_DATA;\r
121\r
7e3bcccb
LG
122//\r
123// Labels definition\r
124//\r
1436aea4
MK
125#define LABEL_UPDATE1 0x1234\r
126#define LABEL_UPDATE2 0x2234\r
127#define LABEL_UPDATE3 0x3234\r
128#define LABEL_END 0x2223\r
0bb0f8b8 129\r
130#pragma pack()\r
131\r
132#endif\r