]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLibNullClass.c
MdeModulePkg/VarCheckHiiLib: Replace EFI_D_INFO with DEBUG_INFO
[mirror_edk2.git] / MdeModulePkg / Library / VarCheckHiiLib / VarCheckHiiLibNullClass.c
index b9ca9084915b220ef84072db9f897f2d2adc0c2c..46a93bdb8a1b65e6112b5f25e4294a33cda74028 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
@@ -94,8 +94,8 @@ VarCheckHiiQuestion (
   UINT8    Index;\r
   UINT8    MaxContainers;\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) HiiQuestion->VarOffset + HiiQuestion->StorageWidth) > DataSize) {\r
+    DEBUG ((DEBUG_INFO , "VarCheckHiiQuestion fail: (VarOffset(0x%04x) + StorageWidth(0x%02x)) > Size(0x%x)\n", HiiQuestion->VarOffset, HiiQuestion->StorageWidth, DataSize));\r
     return FALSE;\r
   }\r
 \r
@@ -120,7 +120,7 @@ VarCheckHiiQuestion (
         //\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 +128,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
@@ -147,7 +147,7 @@ VarCheckHiiQuestion (
       // 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 +155,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 +185,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 +251,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 +282,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
@@ -343,11 +343,11 @@ 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)\n", HiiQuestion->OpCode, HiiOpCodeToStr (HiiQuestion->OpCode)));\r
+  DEBUG ((DEBUG_INFO, "    Length        - 0x%02x\n", HiiQuestion->Length));\r
+  DEBUG ((DEBUG_INFO, "    VarOffset     - 0x%04x\n", HiiQuestion->VarOffset));\r
+  DEBUG ((DEBUG_INFO, "    StorageWidth  - 0x%02x\n", HiiQuestion->StorageWidth));\r
 \r
   switch (HiiQuestion->OpCode) {\r
     case EFI_IFR_ONE_OF_OP:\r
@@ -357,16 +357,16 @@ DumpHiiQuestion (
         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
@@ -390,20 +390,20 @@ DumpHiiQuestion (
 \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
+          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, "    Minimum       - 0x%04x\n", Minimum));\r
-          DEBUG ((EFI_D_INFO, "    Maximum       - 0x%04x\n", Maximum));\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, "    Minimum       - 0x%08x\n", Minimum));\r
-          DEBUG ((EFI_D_INFO, "    Maximum       - 0x%08x\n", Maximum));\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, "    Minimum       - 0x%016lx\n", Minimum));\r
-          DEBUG ((EFI_D_INFO, "    Maximum       - 0x%016lx\n", Maximum));\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
@@ -412,23 +412,23 @@ DumpHiiQuestion (
       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 +457,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 +498,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