]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/CapsulePei/UefiCapsule.c
MdeModulePkg/CapsulePei: Change debug MACRO
[mirror_edk2.git] / MdeModulePkg / Universal / CapsulePei / UefiCapsule.c
index 36b04e34064b1caec15d86b4fffb23e9bb6532af..e967599e96a9321b37403bb7db4fdfee8c6a6278 100644 (file)
@@ -420,7 +420,7 @@ ModeSwitch (
     if (ReservedRangeEnd < MemoryEnd64) {\r
       MemoryBase64 = ReservedRangeEnd;\r
     } else {\r
-      DEBUG ((EFI_D_ERROR, "Memory is not enough to process capsule!\n"));\r
+      DEBUG ((DEBUG_ERROR, "Memory is not enough to process capsule!\n"));\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r
   } else if (ReservedRangeBase < MemoryEnd64) {\r
@@ -518,7 +518,7 @@ FindCapsuleCoalesceImage (
                            &AuthenticationState\r
                            );\r
       if (EFI_ERROR (Status)) {\r
-        DEBUG ((EFI_D_ERROR, "Unable to find PE32 section in CapsuleX64 image ffs %r!\n", Status));\r
+        DEBUG ((DEBUG_ERROR, "Unable to find PE32 section in CapsuleX64 image ffs %r!\n", Status));\r
         return Status;\r
       }\r
       *CoalesceImageMachineType = PeCoffLoaderGetMachineType ((VOID *) (UINTN) CoalesceImageAddress);\r
@@ -567,7 +567,7 @@ GetLongModeContext (
                                   LongModeBuffer\r
                                   );\r
   if (EFI_ERROR (Status)) {\r
-    DEBUG (( EFI_D_ERROR, "Error Get LongModeBuffer variable %r!\n", Status));\r
+    DEBUG (( DEBUG_ERROR, "Error Get LongModeBuffer variable %r!\n", Status));\r
   }\r
   return Status;\r
 }\r
@@ -727,7 +727,7 @@ BuildMemoryResourceDescriptor (
   }\r
 \r
   if (Index == 0) {\r
-    DEBUG ((EFI_D_INFO | EFI_D_WARN, "No memory resource descriptor reported in HOB list before capsule Coalesce\n"));\r
+    DEBUG ((DEBUG_INFO | DEBUG_WARN, "No memory resource descriptor reported in HOB list before capsule Coalesce\n"));\r
 #if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)\r
     //\r
     // Allocate memory to hold memory resource descriptor,\r
@@ -739,7 +739,7 @@ BuildMemoryResourceDescriptor (
 \r
     MemoryResource[0].PhysicalStart = 0;\r
     MemoryResource[0].ResourceLength = LShiftU64 (1, GetPhysicalAddressBits ());\r
-    DEBUG ((EFI_D_INFO, "MemoryResource[0x0] - Start(0x%0lx) Length(0x%0lx)\n",\r
+    DEBUG ((DEBUG_INFO, "MemoryResource[0x0] - Start(0x%0lx) Length(0x%0lx)\n",\r
                         MemoryResource[0x0].PhysicalStart, MemoryResource[0x0].ResourceLength));\r
     return MemoryResource;\r
 #else\r
@@ -763,7 +763,7 @@ BuildMemoryResourceDescriptor (
   while (Hob.Raw != NULL) {\r
     ResourceDescriptor = (EFI_HOB_RESOURCE_DESCRIPTOR *) Hob.Raw;\r
     if (ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) {\r
-      DEBUG ((EFI_D_INFO, "MemoryResource[0x%x] - Start(0x%0lx) Length(0x%0lx)\n",\r
+      DEBUG ((DEBUG_INFO, "MemoryResource[0x%x] - Start(0x%0lx) Length(0x%0lx)\n",\r
                           Index, ResourceDescriptor->PhysicalStart, ResourceDescriptor->ResourceLength));\r
       MemoryResource[Index].PhysicalStart = ResourceDescriptor->PhysicalStart;\r
       MemoryResource[Index].ResourceLength = ResourceDescriptor->ResourceLength;\r
@@ -966,7 +966,7 @@ CapsuleCoalesce (
   //\r
   Status = PeiServicesGetBootMode (&BootMode);\r
   if (EFI_ERROR (Status) || (BootMode != BOOT_ON_FLASH_UPDATE)) {\r
-    DEBUG ((EFI_D_ERROR, "Boot mode is not correct for capsule update path.\n"));\r
+    DEBUG ((DEBUG_ERROR, "Boot mode is not correct for capsule update path.\n"));\r
     Status = EFI_NOT_FOUND;\r
     goto Done;\r
   }\r
@@ -1009,14 +1009,14 @@ CapsuleCoalesce (
       //\r
       // There is no capsule variables, quit\r
       //\r
-      DEBUG ((EFI_D_INFO,"Capsule variable Index = %d\n", Index));\r
+      DEBUG ((DEBUG_INFO,"Capsule variable Index = %d\n", Index));\r
       break;\r
     }\r
     VariableCount++;\r
     Index++;\r
   }\r
 \r
-  DEBUG ((EFI_D_INFO,"Capsule variable count = %d\n", VariableCount));\r
+  DEBUG ((DEBUG_INFO,"Capsule variable count = %d\n", VariableCount));\r
 \r
   //\r
   // The last entry is the end flag.\r
@@ -1027,7 +1027,7 @@ CapsuleCoalesce (
              );\r
 \r
   if (Status != EFI_SUCCESS) {\r
-    DEBUG ((EFI_D_ERROR, "AllocatePages Failed!, Status = %x\n", Status));\r
+    DEBUG ((DEBUG_ERROR, "AllocatePages Failed!, Status = %x\n", Status));\r
     goto Done;\r
   }\r
 \r
@@ -1039,7 +1039,7 @@ CapsuleCoalesce (
   //\r
   Status = GetCapsuleDescriptors (VariableArrayAddress);\r
   if (EFI_ERROR (Status)) {\r
-    DEBUG ((EFI_D_ERROR, "Fail to find capsule variables.\n"));\r
+    DEBUG ((DEBUG_ERROR, "Fail to find capsule variables.\n"));\r
     goto Done;\r
   }\r
 \r
@@ -1057,14 +1057,14 @@ CapsuleCoalesce (
     CoalesceImageEntryPoint = 0;\r
     Status = GetLongModeContext (&LongModeBuffer);\r
     if (EFI_ERROR (Status)) {\r
-      DEBUG ((EFI_D_ERROR, "Fail to find the variable for long mode context!\n"));\r
+      DEBUG ((DEBUG_ERROR, "Fail to find the variable for long mode context!\n"));\r
       Status = EFI_NOT_FOUND;\r
       goto Done;\r
     }\r
 \r
     Status = FindCapsuleCoalesceImage (&CoalesceImageEntryPoint, &CoalesceImageMachineType);\r
     if ((EFI_ERROR (Status)) || (CoalesceImageMachineType != EFI_IMAGE_MACHINE_X64)) {\r
-      DEBUG ((EFI_D_ERROR, "Fail to find CapsuleX64 module in FV!\n"));\r
+      DEBUG ((DEBUG_ERROR, "Fail to find CapsuleX64 module in FV!\n"));\r
       Status = EFI_NOT_FOUND;\r
       goto Done;\r
     }\r
@@ -1084,14 +1084,14 @@ CapsuleCoalesce (
   Status = CapsuleDataCoalesce (PeiServices, (EFI_PHYSICAL_ADDRESS *)(UINTN)VariableArrayAddress, MemoryResource, MemoryBase, MemorySize);\r
 #endif\r
 \r
-  DEBUG ((EFI_D_INFO, "Capsule Coalesce Status = %r!\n", Status));\r
+  DEBUG ((DEBUG_INFO, "Capsule Coalesce Status = %r!\n", Status));\r
 \r
   if (Status == EFI_BUFFER_TOO_SMALL) {\r
-    DEBUG ((EFI_D_ERROR, "There is not enough memory to process capsule!\n"));\r
+    DEBUG ((DEBUG_ERROR, "There is not enough memory to process capsule!\n"));\r
   }\r
 \r
   if (Status == EFI_NOT_FOUND) {\r
-    DEBUG ((EFI_D_ERROR, "Fail to parse capsule descriptor in memory!\n"));\r
+    DEBUG ((DEBUG_ERROR, "Fail to parse capsule descriptor in memory!\n"));\r
     REPORT_STATUS_CODE (\r
       EFI_ERROR_CODE | EFI_ERROR_MAJOR,\r
       (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_EC_INVALID_CAPSULE_DESCRIPTOR)\r
@@ -1156,7 +1156,7 @@ CapsuleTestPattern (
   //\r
   if (*TestPtr == 0x54534554) {\r
     RetValue = TRUE;\r
-    DEBUG ((EFI_D_INFO, "Capsule test pattern mode activated...\n"));\r
+    DEBUG ((DEBUG_INFO, "Capsule test pattern mode activated...\n"));\r
     TestSize = TestPtr[1] / sizeof (UINT32);\r
     //\r
     // Skip over the signature and the size fields in the pattern data header\r
@@ -1165,7 +1165,7 @@ CapsuleTestPattern (
     TestCounter = 0;\r
     while (TestSize > 0) {\r
       if (*TestPtr != TestCounter) {\r
-        DEBUG ((EFI_D_INFO, "Capsule test pattern mode FAILED: BaseAddr/FailAddr 0x%X 0x%X\n", (UINT32)(UINTN)(EFI_CAPSULE_PEIM_PRIVATE_DATA *)CapsuleBase, (UINT32)(UINTN)TestPtr));\r
+        DEBUG ((DEBUG_INFO, "Capsule test pattern mode FAILED: BaseAddr/FailAddr 0x%X 0x%X\n", (UINT32)(UINTN)(EFI_CAPSULE_PEIM_PRIVATE_DATA *)CapsuleBase, (UINT32)(UINTN)TestPtr));\r
         return TRUE;\r
       }\r
 \r
@@ -1174,7 +1174,7 @@ CapsuleTestPattern (
       TestSize--;\r
     }\r
 \r
-    DEBUG ((EFI_D_INFO, "Capsule test pattern mode SUCCESS\n"));\r
+    DEBUG ((DEBUG_INFO, "Capsule test pattern mode SUCCESS\n"));\r
   }\r
 \r
   return RetValue;\r
@@ -1219,11 +1219,11 @@ CreateState (
     return EFI_VOLUME_CORRUPTED;\r
   }\r
   if (PrivateData->CapsuleAllImageSize >= MAX_ADDRESS) {\r
-    DEBUG ((EFI_D_ERROR, "CapsuleAllImageSize too big - 0x%lx\n", PrivateData->CapsuleAllImageSize));\r
+    DEBUG ((DEBUG_ERROR, "CapsuleAllImageSize too big - 0x%lx\n", PrivateData->CapsuleAllImageSize));\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
   if (PrivateData->CapsuleNumber >= MAX_ADDRESS) {\r
-    DEBUG ((EFI_D_ERROR, "CapsuleNumber too big - 0x%lx\n", PrivateData->CapsuleNumber));\r
+    DEBUG ((DEBUG_ERROR, "CapsuleNumber too big - 0x%lx\n", PrivateData->CapsuleNumber));\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
   //\r
@@ -1241,13 +1241,13 @@ CreateState (
              );\r
 \r
   if (Status != EFI_SUCCESS) {\r
-    DEBUG ((EFI_D_ERROR, "AllocatePages Failed!\n"));\r
+    DEBUG ((DEBUG_ERROR, "AllocatePages Failed!\n"));\r
     return Status;\r
   }\r
   //\r
   // Copy to our new buffer for DXE\r
   //\r
-  DEBUG ((EFI_D_INFO, "Capsule copy from 0x%8X to 0x%8X with size 0x%8X\n", (UINTN)((UINT8 *)PrivateData + sizeof(EFI_CAPSULE_PEIM_PRIVATE_DATA) + (CapsuleNumber - 1) * sizeof(UINT64)), (UINTN) NewBuffer, Size));\r
+  DEBUG ((DEBUG_INFO, "Capsule copy from 0x%8X to 0x%8X with size 0x%8X\n", (UINTN)((UINT8 *)PrivateData + sizeof(EFI_CAPSULE_PEIM_PRIVATE_DATA) + (CapsuleNumber - 1) * sizeof(UINT64)), (UINTN) NewBuffer, Size));\r
   CopyMem ((VOID *) (UINTN) NewBuffer, (VOID *) (UINTN) ((UINT8 *)PrivateData + sizeof(EFI_CAPSULE_PEIM_PRIVATE_DATA) + (CapsuleNumber - 1) * sizeof(UINT64)), Size);\r
   //\r
   // Check for test data pattern. If it is the test pattern, then we'll\r