]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
MdeModulePkg/DriverSample: Add questions with bit/union VarStore
[mirror_edk2.git] / MdeModulePkg / Universal / DriverSampleDxe / NVDataStruc.h
index 195cc8ad62e77da4cd0eea1ae0e312ec4d599b67..40fb3d0964787c56ddca25479749edeeaa80d97b 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -31,8 +31,24 @@ Revision History:
 #include <Guid/ZeroGuid.h>\r
 \r
 #define CONFIGURATION_VARSTORE_ID    0x1234\r
+#define BITS_VARSTORE_ID             0x2345\r
 \r
 #pragma pack(1)\r
+\r
+typedef struct {\r
+  UINT16   NestByteField;\r
+  UINT8                    : 1;  // unamed field can be used for padding\r
+  UINT8    NestBitCheckbox : 1;\r
+  UINT8    NestBitOneof    : 2;\r
+  UINT8                    : 0;  // Special width 0 can be used to force alignment at the next word boundary\r
+  UINT8    NestBitNumeric  : 4;\r
+} MY_BITS_DATA;\r
+\r
+typedef union {\r
+  UINT16   BitField : 10;\r
+  UINT8    ByteField;\r
+} MY_EFI_UNION_DATA;\r
+\r
 typedef struct {\r
   UINT16  MyStringData[40];\r
   UINT16  SomethingHiddenForHtml;\r
@@ -67,6 +83,11 @@ typedef struct {
   UINT8   RefreshGuidCount;\r
   UINT8   Match2;\r
   UINT8   GetDefaultValueFromCallBackForOrderedList[3];\r
+  UINT8   BitCheckbox : 1;\r
+  UINT16  BitOneof    : 6;\r
+  UINT16  BitNumeric  : 12;\r
+  MY_BITS_DATA  MyBitData;\r
+  MY_EFI_UNION_DATA MyUnionData;\r
 } DRIVER_SAMPLE_CONFIGURATION;\r
 \r
 //\r
@@ -79,6 +100,17 @@ typedef struct {
   UINT16        SubmittedCallback;\r
 } MY_EFI_VARSTORE_DATA;\r
 \r
+//\r
+// 3rd NV data structure definition\r
+//\r
+typedef struct {\r
+  MY_BITS_DATA  BitsData;\r
+  UINT32   EfiBitGrayoutTest : 5;\r
+  UINT32   EfiBitNumeric     : 4;\r
+  UINT32   EfiBitOneof       : 10;\r
+  UINT32   EfiBitCheckbox    : 1;\r
+} MY_EFI_BITS_VARSTORE_DATA;\r
+\r
 //\r
 // Labels definition\r
 //\r