]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLibNullClass.c
MdeModulePkg/DxeCapsuleLibFmp: Add more check for the UX capsule
[mirror_edk2.git] / MdeModulePkg / Library / VarCheckHiiLib / VarCheckHiiLibNullClass.c
index 3afa7962aa6128630718be322b3f1b9230655dd3..93ac5ec8f1cc6e33ecdc7dae557ff58a93c27b19 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Var Check Hii handler.\r
 \r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 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
@@ -60,7 +60,7 @@ VarCheckHiiInternalDumpHex (
 \r
     Val[Index * 3]  = 0;\r
     Str[Index]      = 0;\r
-    DEBUG ((EFI_D_INFO, "%*a%08X: %-48a *%a*\r\n", Indent, "", Offset, Val, Str));\r
+    DEBUG ((DEBUG_INFO , "%*a%08X: %-48a *%a*\r\n", Indent, "", Offset, Val, Str));\r
 \r
     Data += Size;\r
     Offset += Size;\r
@@ -93,34 +93,67 @@ VarCheckHiiQuestion (
   UINT8    *Ptr;\r
   UINT8    Index;\r
   UINT8    MaxContainers;\r
+  UINT8    StartBit;\r
+  UINT8    EndBit;\r
+  UINT8    TotalBits;\r
+  UINT16   VarOffsetByteLevel;\r
+  UINT8    StorageWidthByteLevel;\r
+\r
+  if (HiiQuestion->BitFieldStore) {\r
+    VarOffsetByteLevel    = HiiQuestion->VarOffset / 8;\r
+    TotalBits             = HiiQuestion->VarOffset % 8 + HiiQuestion->StorageWidth;\r
+    StorageWidthByteLevel = (TotalBits % 8 == 0 ? TotalBits / 8: TotalBits / 8 + 1);\r
+  } else {\r
+    VarOffsetByteLevel    = HiiQuestion->VarOffset;\r
+    StorageWidthByteLevel = HiiQuestion->StorageWidth;\r
+  }\r
 \r
-  if ((UINTN) (HiiQuestion->VarOffset + HiiQuestion->StorageWidth) > DataSize) {\r
-    DEBUG ((EFI_D_INFO, "VarCheckHiiQuestion fail: (VarOffset(0x%04x) + StorageWidth(0x%02x)) > Size(0x%x)\n", HiiQuestion->VarOffset, HiiQuestion->StorageWidth, DataSize));\r
+  if (((UINT32) VarOffsetByteLevel + StorageWidthByteLevel) > DataSize) {\r
+    DEBUG ((DEBUG_INFO , "VarCheckHiiQuestion fail: (VarOffset(0x%04x) + StorageWidth(0x%02x)) > Size(0x%x)\n", VarOffsetByteLevel, StorageWidthByteLevel, DataSize));\r
     return FALSE;\r
   }\r
 \r
   OneData = 0;\r
-  CopyMem (&OneData, (UINT8 *) Data + HiiQuestion->VarOffset, HiiQuestion->StorageWidth);\r
+  CopyMem (&OneData, (UINT8 *) Data + VarOffsetByteLevel, StorageWidthByteLevel);\r
+  if (HiiQuestion->BitFieldStore) {\r
+    //\r
+    // Get the value from the bit field.\r
+    //\r
+    StartBit = HiiQuestion->VarOffset % 8;\r
+    EndBit   = StartBit + HiiQuestion->StorageWidth - 1;\r
+    OneData  = BitFieldRead64 (OneData, StartBit, EndBit);\r
+  }\r
 \r
   switch (HiiQuestion->OpCode) {\r
     case EFI_IFR_ONE_OF_OP:\r
       Ptr = (UINT8 *) ((VAR_CHECK_HII_QUESTION_ONEOF *) HiiQuestion + 1);\r
       while ((UINTN) Ptr < (UINTN) HiiQuestion + HiiQuestion->Length) {\r
         OneValue = 0;\r
-        CopyMem (&OneValue, Ptr, HiiQuestion->StorageWidth);\r
+        if (HiiQuestion->BitFieldStore) {\r
+          //\r
+          // For OneOf stored in bit field, the value of options are saved as UINT32 type.\r
+          //\r
+          CopyMem (&OneValue, Ptr, sizeof (UINT32));\r
+        } else {\r
+          CopyMem (&OneValue, Ptr, HiiQuestion->StorageWidth);\r
+        }\r
         if (OneData == OneValue) {\r
           //\r
           // Match\r
           //\r
           break;\r
         }\r
-        Ptr += HiiQuestion->StorageWidth;\r
+        if (HiiQuestion->BitFieldStore) {\r
+          Ptr += sizeof (UINT32);\r
+        } else {\r
+          Ptr += HiiQuestion->StorageWidth;\r
+        }\r
       }\r
       if ((UINTN) Ptr >= ((UINTN) HiiQuestion + HiiQuestion->Length)) {\r
         //\r
         // No match\r
         //\r
-        DEBUG ((EFI_D_INFO, "VarCheckHiiQuestion fail: OneOf mismatch (0x%lx)\n", OneData));\r
+        DEBUG ((DEBUG_INFO , "VarCheckHiiQuestion fail: OneOf mismatch (0x%lx)\n", OneData));\r
         DEBUG_CODE (VarCheckHiiInternalDumpHex (2, 0, HiiQuestion->Length, (UINT8 *) HiiQuestion););\r
         return FALSE;\r
       }\r
@@ -128,7 +161,7 @@ VarCheckHiiQuestion (
 \r
     case EFI_IFR_CHECKBOX_OP:\r
       if ((OneData != 0) && (OneData != 1)) {\r
-        DEBUG ((EFI_D_INFO, "VarCheckHiiQuestion fail: CheckBox mismatch (0x%lx)\n", OneData));\r
+        DEBUG ((DEBUG_INFO , "VarCheckHiiQuestion fail: CheckBox mismatch (0x%lx)\n", OneData));\r
         DEBUG_CODE (VarCheckHiiInternalDumpHex (2, 0, HiiQuestion->Length, (UINT8 *) HiiQuestion););\r
         return FALSE;\r
       }\r
@@ -138,16 +171,26 @@ VarCheckHiiQuestion (
       Minimum = 0;\r
       Maximum = 0;\r
       Ptr = (UINT8 *) ((VAR_CHECK_HII_QUESTION_NUMERIC *) HiiQuestion + 1);\r
-      CopyMem (&Minimum, Ptr, HiiQuestion->StorageWidth);\r
-      Ptr += HiiQuestion->StorageWidth;\r
-      CopyMem (&Maximum, Ptr, HiiQuestion->StorageWidth);\r
-      Ptr += HiiQuestion->StorageWidth;\r
+      if (HiiQuestion->BitFieldStore) {\r
+        //\r
+        // For Numeric stored in bit field, the value of Maximum/Minimum are saved as UINT32 type.\r
+        //\r
+        CopyMem (&Minimum, Ptr, sizeof (UINT32));\r
+        Ptr += sizeof (UINT32);\r
+        CopyMem (&Maximum, Ptr, sizeof (UINT32));\r
+        Ptr += sizeof (UINT32);\r
+      } else {\r
+        CopyMem (&Minimum, Ptr, HiiQuestion->StorageWidth);\r
+        Ptr += HiiQuestion->StorageWidth;\r
+        CopyMem (&Maximum, Ptr, HiiQuestion->StorageWidth);\r
+        Ptr += HiiQuestion->StorageWidth;\r
+      }\r
 \r
       //\r
       // No need to check Step, because it is ONLY for UI.\r
       //\r
       if ((OneData < Minimum) || (OneData > Maximum)) {\r
-        DEBUG ((EFI_D_INFO, "VarCheckHiiQuestion fail: Numeric mismatch (0x%lx)\n", OneData));\r
+        DEBUG ((DEBUG_INFO , "VarCheckHiiQuestion fail: Numeric mismatch (0x%lx)\n", OneData));\r
         DEBUG_CODE (VarCheckHiiInternalDumpHex (2, 0, HiiQuestion->Length, (UINT8 *) HiiQuestion););\r
         return FALSE;\r
       }\r
@@ -155,8 +198,8 @@ VarCheckHiiQuestion (
 \r
     case EFI_IFR_ORDERED_LIST_OP:\r
       MaxContainers = ((VAR_CHECK_HII_QUESTION_ORDEREDLIST *) HiiQuestion)->MaxContainers;\r
-      if ((UINTN) (HiiQuestion->VarOffset + HiiQuestion->StorageWidth * MaxContainers) > DataSize) {\r
-        DEBUG ((EFI_D_INFO, "VarCheckHiiQuestion fail: (VarOffset(0x%04x) + StorageWidth(0x%02x) * MaxContainers(0x%02x)) > Size(0x%x)\n", HiiQuestion->VarOffset, HiiQuestion->StorageWidth, MaxContainers, DataSize));\r
+      if (((UINT32) HiiQuestion->VarOffset + HiiQuestion->StorageWidth * MaxContainers) > DataSize) {\r
+        DEBUG ((DEBUG_INFO , "VarCheckHiiQuestion fail: (VarOffset(0x%04x) + StorageWidth(0x%02x) * MaxContainers(0x%02x)) > Size(0x%x)\n", HiiQuestion->VarOffset, HiiQuestion->StorageWidth, MaxContainers, DataSize));\r
         return FALSE;\r
       }\r
       for (Index = 0; Index < MaxContainers; Index++) {\r
@@ -185,7 +228,7 @@ VarCheckHiiQuestion (
           //\r
           // No match\r
           //\r
-          DEBUG ((EFI_D_INFO, "VarCheckHiiQuestion fail: OrderedList mismatch\n"));\r
+          DEBUG ((DEBUG_INFO , "VarCheckHiiQuestion fail: OrderedList mismatch\n"));\r
           DEBUG_CODE (VarCheckHiiInternalDumpHex (2, 0, HiiQuestion->StorageWidth * MaxContainers, (UINT8 *) Data + HiiQuestion->VarOffset););\r
           DEBUG_CODE (VarCheckHiiInternalDumpHex (2, 0, HiiQuestion->Length, (UINT8 *) HiiQuestion););\r
           return FALSE;\r
@@ -251,19 +294,19 @@ SetVariableCheckHandlerHii (
       //\r
       // Found the Hii Variable that could be used to do check.\r
       //\r
-      DEBUG ((EFI_D_INFO, "VarCheckHiiVariable - %s:%g with Attributes = 0x%08x Size = 0x%x\n", VariableName, VendorGuid, Attributes, DataSize));\r
+      DEBUG ((DEBUG_INFO , "VarCheckHiiVariable - %s:%g with Attributes = 0x%08x Size = 0x%x\n", VariableName, VendorGuid, Attributes, DataSize));\r
       if (HiiVariable->Attributes != Attributes) {\r
-        DEBUG ((EFI_D_INFO, "VarCheckHiiVariable fail for Attributes - 0x%08x\n", HiiVariable->Attributes));\r
+        DEBUG ((DEBUG_INFO, "VarCheckHiiVariable fail for Attributes - 0x%08x\n", HiiVariable->Attributes));\r
         return EFI_SECURITY_VIOLATION;\r
       }\r
 \r
       if (DataSize == 0) {\r
-        DEBUG ((EFI_D_INFO, "VarCheckHiiVariable - CHECK PASS with DataSize == 0 !\n"));\r
+        DEBUG ((DEBUG_INFO, "VarCheckHiiVariable - CHECK PASS with DataSize == 0 !\n"));\r
         return EFI_SUCCESS;\r
       }\r
 \r
       if (HiiVariable->Size != DataSize) {\r
-        DEBUG ((EFI_D_INFO, "VarCheckHiiVariable fail for Size - 0x%x\n", HiiVariable->Size));\r
+        DEBUG ((DEBUG_INFO, "VarCheckHiiVariable fail for Size - 0x%x\n", HiiVariable->Size));\r
         return EFI_SECURITY_VIOLATION;\r
       }\r
 \r
@@ -282,7 +325,7 @@ SetVariableCheckHandlerHii (
         HiiQuestion = (VAR_CHECK_HII_QUESTION_HEADER *) HEADER_ALIGN (((UINTN) HiiQuestion + HiiQuestion->Length));\r
       }\r
 \r
-      DEBUG ((EFI_D_INFO, "VarCheckHiiVariable - ALL CHECK PASS!\n"));\r
+      DEBUG ((DEBUG_INFO, "VarCheckHiiVariable - ALL CHECK PASS!\n"));\r
       return EFI_SUCCESS;\r
     }\r
     //\r
@@ -318,7 +361,7 @@ HiiOpCodeToStr (
   )\r
 {\r
   UINTN     Index;\r
-  for (Index = 0; Index < sizeof (mHiiOpCodeStringTable) / sizeof (mHiiOpCodeStringTable[0]); Index++) {\r
+  for (Index = 0; Index < ARRAY_SIZE (mHiiOpCodeStringTable); Index++) {\r
     if (mHiiOpCodeStringTable[Index].HiiOpCode == HiiOpCode) {\r
       return mHiiOpCodeStringTable[Index].HiiOpCodeStr;\r
     }\r
@@ -343,92 +386,117 @@ DumpHiiQuestion (
   UINT64    OneValue;\r
   UINT8     *Ptr;\r
 \r
-  DEBUG ((EFI_D_INFO, "  VAR_CHECK_HII_QUESTION_HEADER\n"));\r
-  DEBUG ((EFI_D_INFO, "    OpCode        - 0x%02x (%a)\n", HiiQuestion->OpCode, HiiOpCodeToStr (HiiQuestion->OpCode)));\r
-  DEBUG ((EFI_D_INFO, "    Length        - 0x%02x\n", HiiQuestion->Length));\r
-  DEBUG ((EFI_D_INFO, "    VarOffset     - 0x%04x\n", HiiQuestion->VarOffset));\r
-  DEBUG ((EFI_D_INFO, "    StorageWidth  - 0x%02x\n", HiiQuestion->StorageWidth));\r
+  DEBUG ((DEBUG_INFO, "  VAR_CHECK_HII_QUESTION_HEADER\n"));\r
+  DEBUG ((DEBUG_INFO, "    OpCode        - 0x%02x (%a) (%a)\n", HiiQuestion->OpCode, HiiOpCodeToStr (HiiQuestion->OpCode), (HiiQuestion->BitFieldStore? "bit level": "byte level")));\r
+  DEBUG ((DEBUG_INFO, "    Length        - 0x%02x\n", HiiQuestion->Length));\r
+  DEBUG ((DEBUG_INFO, "    VarOffset     - 0x%04x (%a)\n", HiiQuestion->VarOffset, (HiiQuestion->BitFieldStore? "bit level": "byte level")));\r
+  DEBUG ((DEBUG_INFO, "    StorageWidth  - 0x%02x (%a)\n", HiiQuestion->StorageWidth, (HiiQuestion->BitFieldStore? "bit level": "byte level")));\r
 \r
   switch (HiiQuestion->OpCode) {\r
     case EFI_IFR_ONE_OF_OP:\r
       Ptr = (UINT8 *) ((VAR_CHECK_HII_QUESTION_ONEOF *) HiiQuestion + 1);\r
       while ((UINTN) Ptr < ((UINTN) HiiQuestion + HiiQuestion->Length)) {\r
         OneValue = 0;\r
-        CopyMem (&OneValue, Ptr, HiiQuestion->StorageWidth);\r
+        if (HiiQuestion->BitFieldStore) {\r
+          //\r
+          // For OneOf stored in bit field, the value of options are saved as UINT32 type.\r
+          //\r
+          CopyMem (&OneValue, Ptr, sizeof (UINT32));\r
+          DEBUG ((DEBUG_INFO, "    OneOfOption   - 0x%08x\n", OneValue));\r
+        } else {\r
+          CopyMem (&OneValue, Ptr, HiiQuestion->StorageWidth);\r
+          switch (HiiQuestion->StorageWidth) {\r
+            case sizeof (UINT8):\r
+              DEBUG ((DEBUG_INFO, "    OneOfOption   - 0x%02x\n", OneValue));\r
+              break;\r
+            case sizeof (UINT16):\r
+              DEBUG ((DEBUG_INFO, "    OneOfOption   - 0x%04x\n", OneValue));\r
+              break;\r
+            case sizeof (UINT32):\r
+              DEBUG ((DEBUG_INFO, "    OneOfOption   - 0x%08x\n", OneValue));\r
+              break;\r
+            case sizeof (UINT64):\r
+              DEBUG ((DEBUG_INFO, "    OneOfOption   - 0x%016lx\n", OneValue));\r
+              break;\r
+            default:\r
+              ASSERT (FALSE);\r
+              break;\r
+          }\r
+        }\r
+        if (HiiQuestion->BitFieldStore) {\r
+          Ptr += sizeof (UINT32);\r
+        } else {\r
+          Ptr += HiiQuestion->StorageWidth;\r
+        }\r
+      }\r
+      break;\r
+\r
+    case EFI_IFR_CHECKBOX_OP:\r
+      break;\r
+\r
+    case EFI_IFR_NUMERIC_OP:\r
+      Minimum = 0;\r
+      Maximum = 0;\r
+      Ptr = (UINT8 *) ((VAR_CHECK_HII_QUESTION_NUMERIC *) HiiQuestion + 1);\r
+      if(HiiQuestion->BitFieldStore) {\r
+        //\r
+        // For Numeric stored in bit field, the value of Maximum/Minimum are saved as UINT32 type.\r
+        //\r
+        CopyMem (&Minimum, Ptr, sizeof (UINT32));\r
+        Ptr += sizeof (UINT32);\r
+        CopyMem (&Maximum, Ptr, sizeof (UINT32));\r
+        Ptr += sizeof (UINT32);\r
+\r
+        DEBUG ((DEBUG_INFO, "    Minimum       - 0x%08x\n", Minimum));\r
+        DEBUG ((DEBUG_INFO, "    Maximum       - 0x%08x\n", Maximum));\r
+      } else {\r
+        CopyMem (&Minimum, Ptr, HiiQuestion->StorageWidth);\r
+        Ptr += HiiQuestion->StorageWidth;\r
+        CopyMem (&Maximum, Ptr, HiiQuestion->StorageWidth);\r
+        Ptr += HiiQuestion->StorageWidth;\r
+\r
         switch (HiiQuestion->StorageWidth) {\r
           case sizeof (UINT8):\r
-            DEBUG ((EFI_D_INFO, "    OneOfOption   - 0x%02x\n", OneValue));\r
+            DEBUG ((DEBUG_INFO, "    Minimum       - 0x%02x\n", Minimum));\r
+            DEBUG ((DEBUG_INFO, "    Maximum       - 0x%02x\n", Maximum));\r
             break;\r
           case sizeof (UINT16):\r
-            DEBUG ((EFI_D_INFO, "    OneOfOption   - 0x%04x\n", OneValue));\r
+            DEBUG ((DEBUG_INFO, "    Minimum       - 0x%04x\n", Minimum));\r
+            DEBUG ((DEBUG_INFO, "    Maximum       - 0x%04x\n", Maximum));\r
             break;\r
           case sizeof (UINT32):\r
-            DEBUG ((EFI_D_INFO, "    OneOfOption   - 0x%08x\n", OneValue));\r
+            DEBUG ((DEBUG_INFO, "    Minimum       - 0x%08x\n", Minimum));\r
+            DEBUG ((DEBUG_INFO, "    Maximum       - 0x%08x\n", Maximum));\r
             break;\r
           case sizeof (UINT64):\r
-            DEBUG ((EFI_D_INFO, "    OneOfOption   - 0x%016lx\n", OneValue));\r
+            DEBUG ((DEBUG_INFO, "    Minimum       - 0x%016lx\n", Minimum));\r
+            DEBUG ((DEBUG_INFO, "    Maximum       - 0x%016lx\n", Maximum));\r
             break;\r
           default:\r
             ASSERT (FALSE);\r
             break;\r
         }\r
-        Ptr += HiiQuestion->StorageWidth;\r
-      }\r
-      break;\r
-\r
-    case EFI_IFR_CHECKBOX_OP:\r
-      break;\r
-\r
-    case EFI_IFR_NUMERIC_OP:\r
-      Minimum = 0;\r
-      Maximum = 0;\r
-      Ptr = (UINT8 *) ((VAR_CHECK_HII_QUESTION_NUMERIC *) HiiQuestion + 1);\r
-      CopyMem (&Minimum, Ptr, HiiQuestion->StorageWidth);\r
-      Ptr += HiiQuestion->StorageWidth;\r
-      CopyMem (&Maximum, Ptr, HiiQuestion->StorageWidth);\r
-      Ptr += HiiQuestion->StorageWidth;\r
-\r
-      switch (HiiQuestion->StorageWidth) {\r
-        case sizeof (UINT8):\r
-          DEBUG ((EFI_D_INFO, "    Minimum       - 0x%02x\n", Minimum));\r
-          DEBUG ((EFI_D_INFO, "    Maximum       - 0x%02x\n", Maximum));\r
-          break;\r
-        case sizeof (UINT16):\r
-          DEBUG ((EFI_D_INFO, "    Minimum       - 0x%04x\n", Minimum));\r
-          DEBUG ((EFI_D_INFO, "    Maximum       - 0x%04x\n", Maximum));\r
-          break;\r
-        case sizeof (UINT32):\r
-          DEBUG ((EFI_D_INFO, "    Minimum       - 0x%08x\n", Minimum));\r
-          DEBUG ((EFI_D_INFO, "    Maximum       - 0x%08x\n", Maximum));\r
-          break;\r
-        case sizeof (UINT64):\r
-          DEBUG ((EFI_D_INFO, "    Minimum       - 0x%016lx\n", Minimum));\r
-          DEBUG ((EFI_D_INFO, "    Maximum       - 0x%016lx\n", Maximum));\r
-          break;\r
-        default:\r
-          ASSERT (FALSE);\r
-          break;\r
       }\r
       break;\r
 \r
     case EFI_IFR_ORDERED_LIST_OP:\r
-      DEBUG ((EFI_D_INFO, "    MaxContainers - 0x%02x\n", ((VAR_CHECK_HII_QUESTION_ORDEREDLIST *) HiiQuestion)->MaxContainers));\r
+      DEBUG ((DEBUG_INFO, "    MaxContainers - 0x%02x\n", ((VAR_CHECK_HII_QUESTION_ORDEREDLIST *) HiiQuestion)->MaxContainers));\r
       Ptr = (UINT8 *) ((VAR_CHECK_HII_QUESTION_ORDEREDLIST *) HiiQuestion + 1);\r
       while ((UINTN) Ptr < ((UINTN) HiiQuestion + HiiQuestion->Length)) {\r
         OneValue = 0;\r
         CopyMem (&OneValue, Ptr, HiiQuestion->StorageWidth);\r
         switch (HiiQuestion->StorageWidth) {\r
           case sizeof (UINT8):\r
-            DEBUG ((EFI_D_INFO, "    OneOfOption   - 0x%02x\n", OneValue));\r
+            DEBUG ((DEBUG_INFO, "    OneOfOption   - 0x%02x\n", OneValue));\r
             break;\r
           case sizeof (UINT16):\r
-            DEBUG ((EFI_D_INFO, "    OneOfOption   - 0x%04x\n", OneValue));\r
+            DEBUG ((DEBUG_INFO, "    OneOfOption   - 0x%04x\n", OneValue));\r
             break;\r
           case sizeof (UINT32):\r
-            DEBUG ((EFI_D_INFO, "    OneOfOption   - 0x%08x\n", OneValue));\r
+            DEBUG ((DEBUG_INFO, "    OneOfOption   - 0x%08x\n", OneValue));\r
             break;\r
           case sizeof (UINT64):\r
-            DEBUG ((EFI_D_INFO, "    OneOfOption   - 0x%016lx\n", OneValue));\r
+            DEBUG ((DEBUG_INFO, "    OneOfOption   - 0x%016lx\n", OneValue));\r
             break;\r
           default:\r
             ASSERT (FALSE);\r
@@ -457,15 +525,15 @@ DumpHiiVariable (
 {\r
   VAR_CHECK_HII_QUESTION_HEADER *HiiQuestion;\r
 \r
-  DEBUG ((EFI_D_INFO, "VAR_CHECK_HII_VARIABLE_HEADER\n"));\r
-  DEBUG ((EFI_D_INFO, "  Revision        - 0x%04x\n", HiiVariable->Revision));\r
-  DEBUG ((EFI_D_INFO, "  HeaderLength    - 0x%04x\n", HiiVariable->HeaderLength));\r
-  DEBUG ((EFI_D_INFO, "  Length          - 0x%08x\n", HiiVariable->Length));\r
-  DEBUG ((EFI_D_INFO, "  OpCode          - 0x%02x (%a)\n", HiiVariable->OpCode, HiiOpCodeToStr (HiiVariable->OpCode)));\r
-  DEBUG ((EFI_D_INFO, "  Size            - 0x%04x\n", HiiVariable->Size));\r
-  DEBUG ((EFI_D_INFO, "  Attributes      - 0x%08x\n", HiiVariable->Attributes));\r
-  DEBUG ((EFI_D_INFO, "  Guid            - %g\n", &HiiVariable->Guid));\r
-  DEBUG ((EFI_D_INFO, "  Name            - %s\n", HiiVariable + 1));\r
+  DEBUG ((DEBUG_INFO, "VAR_CHECK_HII_VARIABLE_HEADER\n"));\r
+  DEBUG ((DEBUG_INFO, "  Revision        - 0x%04x\n", HiiVariable->Revision));\r
+  DEBUG ((DEBUG_INFO, "  HeaderLength    - 0x%04x\n", HiiVariable->HeaderLength));\r
+  DEBUG ((DEBUG_INFO, "  Length          - 0x%08x\n", HiiVariable->Length));\r
+  DEBUG ((DEBUG_INFO, "  OpCode          - 0x%02x (%a)\n", HiiVariable->OpCode, HiiOpCodeToStr (HiiVariable->OpCode)));\r
+  DEBUG ((DEBUG_INFO, "  Size            - 0x%04x\n", HiiVariable->Size));\r
+  DEBUG ((DEBUG_INFO, "  Attributes      - 0x%08x\n", HiiVariable->Attributes));\r
+  DEBUG ((DEBUG_INFO, "  Guid            - %g\n", &HiiVariable->Guid));\r
+  DEBUG ((DEBUG_INFO, "  Name            - %s\n", HiiVariable + 1));\r
 \r
   //\r
   // For Hii Question header align.\r
@@ -498,7 +566,7 @@ DumpVarCheckHii (
 {\r
   VAR_CHECK_HII_VARIABLE_HEADER     *HiiVariable;\r
 \r
-  DEBUG ((EFI_D_INFO, "DumpVarCheckHii\n"));\r
+  DEBUG ((DEBUG_INFO, "DumpVarCheckHii\n"));\r
 \r
   //\r
   // For Hii Variable header align.\r