CorebootModulePkg: DEBUG print format corrections
authorScott Duplichan <scott@notabs.org>
Fri, 10 Apr 2015 02:42:04 +0000 (02:42 +0000)
committermauricema <mauricema@Edk2>
Fri, 10 Apr 2015 02:42:04 +0000 (02:42 +0000)
Fix DEBUG print formats so that pointers and 64-bit integer values
display correctly for both 32-bit and 64-bit builds.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Scott Duplichan <scott@notabs.org>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17153 6f19259b-4bc3-4df7-8a09-765794883524

CorebootModulePkg/CbSupportDxe/CbSupportDxe.c
CorebootModulePkg/CbSupportPei/CbSupportPei.c
CorebootModulePkg/Library/CbParseLib/CbParseLib.c

index e752d1212ec755e2d6d9012fff8dff63ff75a3f5..8419c9d481990065ece489a959e3190b7ea6cb79 100755 (executable)
@@ -49,7 +49,7 @@ CbReserveResourceInGcd (
     if (EFI_ERROR (Status)) {\r
       DEBUG ((\r
         EFI_D_ERROR,\r
-        "Failed to add memory space :0x%x 0x%x\n",\r
+        "Failed to add memory space :0x%lx 0x%lx\n",\r
         BaseAddress,\r
         Length\r
         ));\r
@@ -109,7 +109,7 @@ OnReadyToBoot (
        //\r
        IoOr16 (mPmCtrlReg, BIT0);\r
        \r
-       DEBUG ((EFI_D_ERROR, "Enable SCI bit at 0x%x before boot\n", mPmCtrlReg));      \r
+       DEBUG ((EFI_D_ERROR, "Enable SCI bit at 0x%lx before boot\n", (UINT64)mPmCtrlReg));     \r
 }\r
 \r
 /**\r
@@ -158,7 +158,7 @@ CbDxeEntryPoint (
        // Install Acpi Table\r
        //\r
        if (pSystemTableInfo->AcpiTableBase != 0 && pSystemTableInfo->AcpiTableSize != 0) {             \r
-               DEBUG ((EFI_D_ERROR, "Install Acpi Table at 0x%x, length 0x%x\n", (UINTN)pSystemTableInfo->AcpiTableBase, pSystemTableInfo->AcpiTableSize));    \r
+               DEBUG ((EFI_D_ERROR, "Install Acpi Table at 0x%lx, length 0x%x\n", pSystemTableInfo->AcpiTableBase, pSystemTableInfo->AcpiTableSize));  \r
                Status = gBS->InstallConfigurationTable (&gEfiAcpiTableGuid, (VOID *)(UINTN)pSystemTableInfo->AcpiTableBase);\r
                ASSERT_EFI_ERROR (Status);\r
        }\r
@@ -167,7 +167,7 @@ CbDxeEntryPoint (
        // Install Smbios Table\r
        //\r
        if (pSystemTableInfo->SmbiosTableBase != 0 && pSystemTableInfo->SmbiosTableSize != 0) {                 \r
-               DEBUG ((EFI_D_ERROR, "Install Smbios Table at 0x%x, length 0x%x\n", (UINTN)pSystemTableInfo->SmbiosTableBase, pSystemTableInfo->SmbiosTableSize));      \r
+               DEBUG ((EFI_D_ERROR, "Install Smbios Table at 0x%lx, length 0x%x\n", pSystemTableInfo->SmbiosTableBase, pSystemTableInfo->SmbiosTableSize));    \r
                Status = gBS->InstallConfigurationTable (&gEfiSmbiosTableGuid, (VOID *)(UINTN)pSystemTableInfo->SmbiosTableBase);\r
                ASSERT_EFI_ERROR (Status);\r
        }\r
@@ -180,7 +180,7 @@ CbDxeEntryPoint (
   pAcpiBoardInfo = (ACPI_BOARD_INFO *)GET_GUID_HOB_DATA (GuidHob); \r
   \r
   mPmCtrlReg = (UINTN)pAcpiBoardInfo->PmCtrlRegBase;\r
-       DEBUG ((EFI_D_ERROR, "PmCtrlReg at 0x%x\n", mPmCtrlReg));       \r
+       DEBUG ((EFI_D_ERROR, "PmCtrlReg at 0x%lx\n", (UINT64)mPmCtrlReg));      \r
         \r
        //\r
        // Register callback on the ready to boot event \r
index 49488438a2b8e3db1dda4db9010ec9ad1f0a93d7..148062ff399171c369696605626b5c2ff9a8d192 100644 (file)
@@ -121,7 +121,7 @@ CbPeiReportRemainedFvs (
                if (IsFvHeaderValid ((EFI_FIRMWARE_VOLUME_HEADER* )TempPtr)) {\r
                        if (TempPtr != (UINT8* )(UINTN) PcdGet32 (PcdPayloadFdMemBase))  {\r
                                // Skip the PEI FV\r
-                               DEBUG((EFI_D_ERROR, "Found one valid fv : 0x%x.\n", TempPtr, ((EFI_FIRMWARE_VOLUME_HEADER* )TempPtr)->FvLength));       \r
+                               DEBUG((EFI_D_ERROR, "Found one valid fv : 0x%lx.\n", TempPtr, ((EFI_FIRMWARE_VOLUME_HEADER* )TempPtr)->FvLength));      \r
                                \r
                                PeiServicesInstallFvInfoPpi (\r
                            NULL,\r
@@ -176,8 +176,8 @@ CbPeiEntryPoint (
        if (EFI_ERROR(Status)) \r
                return Status;\r
                \r
-       DEBUG((EFI_D_ERROR, "LowMemorySize: 0x%x.\n", LowMemorySize));\r
-       DEBUG((EFI_D_ERROR, "HighMemorySize: 0x%x.\n", HighMemorySize));\r
+       DEBUG((EFI_D_ERROR, "LowMemorySize: 0x%lx.\n", LowMemorySize));\r
+       DEBUG((EFI_D_ERROR, "HighMemorySize: 0x%lx.\n", HighMemorySize));\r
        \r
        ASSERT (LowMemorySize > 0);\r
        \r
@@ -248,8 +248,8 @@ CbPeiEntryPoint (
        //\r
        PeiMemBase = (LowMemorySize - PeiMemSize) & (~(BASE_64KB - 1));\r
        \r
-       DEBUG((EFI_D_ERROR, "PeiMemBase: 0x%x.\n", PeiMemBase));\r
-       DEBUG((EFI_D_ERROR, "PeiMemSize: 0x%x.\n", PeiMemSize)); \r
+       DEBUG((EFI_D_ERROR, "PeiMemBase: 0x%lx.\n", PeiMemBase));\r
+       DEBUG((EFI_D_ERROR, "PeiMemSize: 0x%lx.\n", PeiMemSize)); \r
    \r
        Status = PeiServicesInstallPeiMemory (\r
               PeiMemBase,            \r
@@ -319,7 +319,7 @@ CbPeiEntryPoint (
   pCbHeader = NULL;\r
   if ((CbParseGetCbHeader (1, &pCbHeader) == RETURN_SUCCESS) \r
        && ((UINTN)pCbHeader > BASE_4KB)) {\r
-       DEBUG((EFI_D_ERROR, "Actual Coreboot header: 0x%x.\n", (UINTN)pCbHeader));      \r
+       DEBUG((EFI_D_ERROR, "Actual Coreboot header: %p.\n", pCbHeader));       \r
        PcdSet32 (PcdCbHeaderPointer, (UINT32)(UINTN)pCbHeader);\r
   }\r
   \r
@@ -345,8 +345,8 @@ CbPeiEntryPoint (
        pSystemTableInfo->AcpiTableSize = AcpiTableSize;        \r
        pSystemTableInfo->SmbiosTableBase = (UINT64) (UINTN)pSmbiosTable;\r
        pSystemTableInfo->SmbiosTableSize = SmbiosTableSize;\r
-       DEBUG ((EFI_D_ERROR, "Detected Acpi Table at 0x%x, length 0x%x\n", (UINTN)pSystemTableInfo->AcpiTableBase, pSystemTableInfo->AcpiTableSize));   \r
-       DEBUG ((EFI_D_ERROR, "Detected Smbios Table at 0x%x, length 0x%x\n", (UINTN)pSystemTableInfo->SmbiosTableBase, pSystemTableInfo->SmbiosTableSize));     \r
+       DEBUG ((EFI_D_ERROR, "Detected Acpi Table at 0x%lx, length 0x%x\n", pSystemTableInfo->AcpiTableBase, pSystemTableInfo->AcpiTableSize)); \r
+       DEBUG ((EFI_D_ERROR, "Detected Smbios Table at 0x%lx, length 0x%x\n", pSystemTableInfo->SmbiosTableBase, pSystemTableInfo->SmbiosTableSize));   \r
        DEBUG ((EFI_D_ERROR, "Create system table info guid hob\n"));\r
        \r
        //\r
index f4ba69f2cc0f3f8762cb0526cad54442a1c7a526..c9b39b1de3f5c58fb3b722e000b4b167737053b7 100644 (file)
@@ -143,7 +143,7 @@ FindCbMemTable (
        if (pMemTableSize)\r
                *pMemTableSize = root->entries[Idx].size;\r
        \r
-       DEBUG ((EFI_D_ERROR, "Find CbMemTable Id 0x%x, base 0x%x, size 0x%x\n", TableId, *pMemTable, *pMemTableSize));\r
+       DEBUG ((EFI_D_ERROR, "Find CbMemTable Id 0x%x, base %p, size 0x%x\n", TableId, *pMemTable, *pMemTableSize));\r
        return RETURN_SUCCESS;\r
     }\r
   }\r
@@ -209,7 +209,7 @@ CbParseMemoryInfo (
     }\r
   }\r
   \r
-  DEBUG ((EFI_D_ERROR, "Low memory 0x%x, High Memory 0x%x\n", *pLowMemorySize, *pHighMemorySize));\r
+  DEBUG ((EFI_D_ERROR, "Low memory 0x%lx, High Memory 0x%lx\n", *pLowMemorySize, *pHighMemorySize));\r
   \r
   return RETURN_SUCCESS;       \r
 }\r
@@ -351,8 +351,8 @@ CbParseFadtInfo (
        if (!Rsdp)\r
                return RETURN_NOT_FOUND;\r
                \r
-       DEBUG ((EFI_D_ERROR, "Find Rsdp at 0x%x\n", Rsdp));\r
-       DEBUG ((EFI_D_ERROR, "Find Rsdt 0x%x, Xsdt 0x%x\n", Rsdp->RsdtAddress, Rsdp->XsdtAddress));\r
+       DEBUG ((EFI_D_ERROR, "Find Rsdp at %p\n", Rsdp));\r
+       DEBUG ((EFI_D_ERROR, "Find Rsdt 0x%x, Xsdt 0x%lx\n", Rsdp->RsdtAddress, Rsdp->XsdtAddress));\r
        \r
        //\r
        // Search Rsdt First\r
@@ -374,7 +374,7 @@ CbParseFadtInfo (
                \r
              if (pResetReg)   \r
                *pResetReg = (UINTN)Fadt->ResetReg.Address; \r
-             DEBUG ((EFI_D_ERROR, "Reset Reg 0x%x\n", Fadt->ResetReg.Address));\r
+             DEBUG ((EFI_D_ERROR, "Reset Reg 0x%lx\n", Fadt->ResetReg.Address));\r
                \r
              if (pResetValue)   \r
                *pResetValue = Fadt->ResetValue;\r
@@ -405,7 +405,7 @@ CbParseFadtInfo (
                \r
              if (pResetReg)   \r
                *pResetReg = (UINTN)Fadt->ResetReg.Address; \r
-             DEBUG ((EFI_D_ERROR, "Reset Reg 0x%x\n", Fadt->ResetReg.Address));\r
+             DEBUG ((EFI_D_ERROR, "Reset Reg 0x%lx\n", Fadt->ResetReg.Address));\r
                \r
              if (pResetValue)   \r
                *pResetValue = Fadt->ResetValue;\r
@@ -522,7 +522,7 @@ CbParseFbInfo (
                return RETURN_NOT_FOUND;\r
                \r
   DEBUG ((EFI_D_ERROR, "Found coreboot video frame buffer information\n"));\r
-  DEBUG ((EFI_D_ERROR, "physical_address: 0x%x\n", CbFbRec->physical_address));\r
+  DEBUG ((EFI_D_ERROR, "physical_address: 0x%lx\n", CbFbRec->physical_address));\r
   DEBUG ((EFI_D_ERROR, "x_resolution: 0x%x\n", CbFbRec->x_resolution));\r
   DEBUG ((EFI_D_ERROR, "y_resolution: 0x%x\n", CbFbRec->y_resolution));\r
   DEBUG ((EFI_D_ERROR, "bits_per_pixel: 0x%x\n", CbFbRec->bits_per_pixel));\r