]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Universal / DriverSampleDxe / NVDataStruc.h
index 171d3baf08f277fc7442e7f477e2a9d0234060b8..86176176842579fc38ffd39aec68efa4413e9f72 100644 (file)
@@ -1,13 +1,7 @@
 /** @file\r
 \r
-Copyright (c) 2007 - 2008, Intel Corporation\r
-All rights reserved. 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
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 Module Name:\r
 \r
@@ -22,27 +16,43 @@ Revision History:
 \r
 **/\r
 \r
-#ifndef _NVDATASTRUC_H\r
-#define _NVDATASTRUC_H\r
-\r
-#define FORMSET_GUID \\r
-  { \\r
-    0xA04A27f4, 0xDF00, 0x4D42, 0xB5, 0x52, 0x39, 0x51, 0x13, 0x02, 0x11, 0x3D \\r
-  }\r
+#ifndef _NVDATASTRUC_H_\r
+#define _NVDATASTRUC_H_\r
 \r
-#define INVENTORY_GUID \\r
-  { \\r
-    0xb3f56470, 0x6141, 0x4621, 0x8f, 0x19, 0x70, 0x4e, 0x57, 0x7a, 0xa9, 0xe8 \\r
-  }\r
+#include <Guid/HiiPlatformSetupFormset.h>\r
+#include <Guid/HiiFormMapMethodGuid.h>\r
+#include <Guid/DriverSampleHii.h>\r
+#include <Guid/ZeroGuid.h>\r
 \r
 #define CONFIGURATION_VARSTORE_ID    0x1234\r
+#define BITS_VARSTORE_ID             0x2345\r
 \r
 #pragma pack(1)\r
+\r
+//\r
+// !!! 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
+// In the C code use sizeof() to get the size the strucure, the results may vary form the compiler(VS,GCC...).\r
+// But the size of the storage calculated by VfrCompiler is fixed (calculate with alignment).\r
+// 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
+// 1. Add bit field (with/without name) with remianing with for padding.\r
+// 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
+//\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
+  UINT8    UnionNumeric;\r
+  UINT8    UnionNumericAlias;\r
+} MY_EFI_UNION_DATA;\r
+\r
 typedef struct {\r
-  UINT16  WhatIsThePassword[20];\r
-  UINT16  WhatIsThePassword2[20];\r
   UINT16  MyStringData[40];\r
-  UINT16  PasswordClearText[20];\r
   UINT16  SomethingHiddenForHtml;\r
   UINT8   HowOldAreYouInYearsManual;\r
   UINT16  HowTallAreYouManual;\r
@@ -55,11 +65,33 @@ typedef struct {
   UINT8   ChooseToActivateNuclearWeaponry;\r
   UINT8   SuppressGrayOutSomething;\r
   UINT8   OrderedList[8];\r
-  UINT  BootOrder[8];\r
+  UINT16  BootOrder[8];\r
   UINT8   BootOrderLarge;\r
   UINT8   DynamicRefresh;\r
   UINT8   DynamicOneof;\r
   UINT8   DynamicOrderedList[5];\r
+  UINT8   Reserved;\r
+  EFI_HII_REF RefData;\r
+  UINT8   NameValueVar0;\r
+  UINT16  NameValueVar1;\r
+  UINT16  NameValueVar2[20];\r
+  UINT8   SerialPortNo;\r
+  UINT8   SerialPortStatus;\r
+  UINT16  SerialPortIo;\r
+  UINT8   SerialPortIrq;\r
+  UINT8   GetDefaultValueFromCallBack;\r
+  UINT8   GetDefaultValueFromAccess;\r
+  EFI_HII_TIME  Time;\r
+  UINT8   RefreshGuidCount;\r
+  UINT8   Match2;\r
+  UINT8   GetDefaultValueFromCallBackForOrderedList[3];\r
+  UINT8   BitCheckbox : 1;\r
+  UINT8   ReservedBits: 7;  // Reserved bit fields for padding.\r
+  UINT16  BitOneof    : 6;\r
+  UINT16              : 0;  // Width 0 used to force alignment.\r
+  UINT16  BitNumeric  : 12;\r
+  MY_BITS_DATA  MyBitData;\r
+  MY_EFI_UNION_DATA MyUnionData;\r
 } DRIVER_SAMPLE_CONFIGURATION;\r
 \r
 //\r
@@ -69,8 +101,28 @@ typedef struct {
   UINT8         Field8;\r
   UINT16        Field16;\r
   UINT8         OrderedList[3];\r
-} MY_DATA2;\r
+  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
+  UINT32                     : 0;  // Width 0 used to force alignment.\r
+} MY_EFI_BITS_VARSTORE_DATA;\r
+\r
+//\r
+// Labels definition\r
+//\r
+#define LABEL_UPDATE1               0x1234\r
+#define LABEL_UPDATE2               0x2234\r
+#define LABEL_UPDATE3               0x3234\r
+#define LABEL_END                   0x2223\r
 \r
 #pragma pack()\r
 \r