public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael Kubacki" <mikuback@linux.microsoft.com>
To: devel@edk2.groups.io
Cc: Chasel Chiu <chasel.chiu@intel.com>,
	Nate DeSimone <nathaniel.l.desimone@intel.com>,
	Isaac Oram <isaac.w.oram@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Eric Dong <eric.dong@intel.com>
Subject: [edk2-platforms][PATCH v1 1/3] MinPlatformPkg: Fix invalid debug macros
Date: Tue,  4 Oct 2022 23:35:29 -0400	[thread overview]
Message-ID: <20221005033531.3994-2-mikuback@linux.microsoft.com> (raw)
In-Reply-To: <20221005033531.3994-1-mikuback@linux.microsoft.com>

From: Michael Kubacki <michael.kubacki@microsoft.com>

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4094

Updates several debug macros in MinPlatformPkg to correctly match
print specifiers to actual arguments.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
---
 Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckPci.c                  |  4 ++--
 Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckSmiHandlerInstrument.c |  4 ++--
 Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiCheckFvInfo.c               | 13 ++++--------
 Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiCheckHob.c                  | 22 +++++++-------------
 4 files changed, 16 insertions(+), 27 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckPci.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckPci.c
index 575284ccc727..3259dae757fe 100644
--- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckPci.c
+++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckPci.c
@@ -114,7 +114,7 @@ DumpPciBridge (
     PciData->Bridge.SecondaryBus,
     PciData->Bridge.SubordinateBus
     ));
-  DEBUG ((DEBUG_INFO, " [00:00] [0000:0000] [0000:0000]",
+  DEBUG ((DEBUG_INFO, " [%02x:%02x] [%04x:%04x] [%04x:%04x]",
     PciData->Bridge.IoBase,
     PciData->Bridge.IoLimit,
     PciData->Bridge.MemoryBase,
@@ -122,7 +122,7 @@ DumpPciBridge (
     PciData->Bridge.PrefetchableMemoryBase,
     PciData->Bridge.PrefetchableMemoryLimit
     ));
-  DEBUG ((DEBUG_INFO, " [00000000:00000000] [0000:0000]",
+  DEBUG ((DEBUG_INFO, " [%08x:%08x] [%04x:%04x]",
     PciData->Bridge.PrefetchableBaseUpper32,
     PciData->Bridge.PrefetchableLimitUpper32,
     PciData->Bridge.IoBaseUpper16,
diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckSmiHandlerInstrument.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckSmiHandlerInstrument.c
index 80e8d26f4e1d..3a0e4ff90b7f 100644
--- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckSmiHandlerInstrument.c
+++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckSmiHandlerInstrument.c
@@ -596,12 +596,12 @@ DumpSmiHandler(
         if (ImageStruct != NULL) {
           DEBUG ((DEBUG_INFO, "         <RVA>0x%x</RVA>\n", (UINTN) (SmiHandlerStruct->Handler - ImageStruct->ImageBase)));
         }
-        DEBUG ((DEBUG_INFO, "      </Handler>\n", SmiHandlerStruct->Handler));
+        DEBUG ((DEBUG_INFO, "      </Handler>\n"));
         DEBUG ((DEBUG_INFO, "      <Caller Address=\"0x%lx\">\n", SmiHandlerStruct->CallerAddr));
         if (ImageStruct != NULL) {
           DEBUG ((DEBUG_INFO, "         <RVA>0x%x</RVA>\n", (UINTN) (SmiHandlerStruct->CallerAddr - ImageStruct->ImageBase)));
         }
-        DEBUG ((DEBUG_INFO, "      </Caller>\n", SmiHandlerStruct->Handler));
+        DEBUG ((DEBUG_INFO, "      </Caller>\n"));
         SmiHandlerStruct = (VOID *)((UINTN)SmiHandlerStruct + SmiHandlerStruct->Length);
         DEBUG ((DEBUG_INFO, "    </SmiHandler>\n"));
       }
diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiCheckFvInfo.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiCheckFvInfo.c
index 571743448eac..f8a651ee7222 100644
--- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiCheckFvInfo.c
+++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiCheckFvInfo.c
@@ -44,7 +44,7 @@ TestPointCheckFvInfo (
   EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI  *FvInfo2;
   UINTN                              Index;
   UINTN                              Index2;
-  
+
   DEBUG ((DEBUG_INFO, "==== TestPointCheckFvInfo - Enter\n"));
   DEBUG ((DEBUG_INFO, "FV Info PPI\n"));
   for (Index = 0; ; Index++) {
@@ -61,9 +61,7 @@ TestPointCheckFvInfo (
       "  BA=%08x  L=%08x  Format={%g}",
       (UINT32)(UINTN)FvInfo->FvInfo,
       FvInfo->FvInfoSize,
-      &FvInfo->FvFormat,
-      FvInfo->ParentFvName,
-      FvInfo->ParentFileName
+      &FvInfo->FvFormat
       ));
     if (FvInfo->ParentFvName != NULL) {
       DEBUG ((DEBUG_INFO,
@@ -79,7 +77,7 @@ TestPointCheckFvInfo (
     }
     DEBUG ((DEBUG_INFO, "\n"));
   }
-  
+
   DEBUG ((DEBUG_INFO, "FV Info2 PPI\n"));
   for (Index2 = 0; ; Index2++) {
     Status = PeiServicesLocatePpi (
@@ -95,10 +93,7 @@ TestPointCheckFvInfo (
       "  BA=%08x  L=%08x  Format={%g}",
       (UINT32)(UINTN)FvInfo2->FvInfo,
       FvInfo2->FvInfoSize,
-      &FvInfo2->FvFormat,
-      FvInfo2->ParentFvName,
-      FvInfo2->ParentFileName,
-      FvInfo2->AuthenticationStatus
+      &FvInfo2->FvFormat
       ));
     if (FvInfo2->ParentFvName != NULL) {
       DEBUG ((DEBUG_INFO,
diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiCheckHob.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiCheckHob.c
index b05f7ebab67f..92a14d7f40ae 100644
--- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiCheckHob.c
+++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiCheckHob.c
@@ -91,7 +91,7 @@ DumpPhitHob (
   )
 {
   EFI_HOB_HANDOFF_INFO_TABLE  *PhitHob;
-  
+
   PhitHob = HobList;
   ASSERT(GET_HOB_TYPE(HobList) == EFI_HOB_TYPE_HANDOFF);
   DEBUG ((DEBUG_INFO, "PHIT HOB\n"));
@@ -132,7 +132,7 @@ DumpResourceHob (
 {
   EFI_PEI_HOB_POINTERS        Hob;
   EFI_HOB_RESOURCE_DESCRIPTOR *ResourceHob;
-  
+
   DEBUG ((DEBUG_INFO, "Resource Descriptor HOBs\n"));
   for (Hob.Raw = HobList; !END_OF_HOB_LIST (Hob); Hob.Raw = GET_NEXT_HOB (Hob)) {
 
@@ -180,7 +180,7 @@ DumpFvHob (
   EFI_PEI_HOB_POINTERS        Hob;
   EFI_HOB_FIRMWARE_VOLUME     *FirmwareVolumeHob;
   EFI_HOB_FIRMWARE_VOLUME2    *FirmwareVolume2Hob;
-  
+
   DEBUG ((DEBUG_INFO, "FV HOBs\n"));
   for (Hob.Raw = HobList; !END_OF_HOB_LIST (Hob); Hob.Raw = GET_NEXT_HOB (Hob)) {
     if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV) {
@@ -234,15 +234,9 @@ DumpMemoryAllocationHob (
       DEBUG ((DEBUG_INFO, ShortNameOfMemoryType(MemoryHob->AllocDescriptor.MemoryType)));
       if (!IsZeroGuid(&MemoryHob->AllocDescriptor.Name)) {
         if (CompareGuid(&gEfiHobMemoryAllocStackGuid, &MemoryHob->AllocDescriptor.Name)) {
-          DEBUG ((DEBUG_INFO,
-            "  {Stack}",
-            &MemoryHob->AllocDescriptor.Name
-            ));
+          DEBUG ((DEBUG_INFO, "  {%g}", &MemoryHob->AllocDescriptor.Name));
         } else if (CompareGuid(&gEfiHobMemoryAllocBspStoreGuid, &MemoryHob->AllocDescriptor.Name)) {
-          DEBUG ((DEBUG_INFO,
-            "  {BspStore}",
-            &MemoryHob->AllocDescriptor.Name
-            ));
+          DEBUG ((DEBUG_INFO, "  {%g}", &MemoryHob->AllocDescriptor.Name));
         } else if (CompareGuid(&gEfiHobMemoryAllocModuleGuid, &MemoryHob->AllocDescriptor.Name)) {
           DEBUG ((DEBUG_INFO,
             "  {Module=%g,Entry=0x%lx}",
@@ -290,13 +284,13 @@ TestPointDumpHob (
   )
 {
   VOID                        *HobList;
-  
+
   DEBUG ((DEBUG_INFO, "==== TestPointDumpHob - Enter\n"));
   //
   // Get Hob list
   //
   HobList = GetHobList ();
-  
+
   DumpPhitHob (HobList);
 
   if (PhitHobOnly) {
@@ -329,7 +323,7 @@ TestPointCheckMemoryResource (
   EFI_HOB_RESOURCE_DESCRIPTOR *ResourceHob;
   EFI_PEI_HOB_POINTERS        Hob2;
   EFI_HOB_RESOURCE_DESCRIPTOR *ResourceHob2;
-  
+
   HobList = GetHobList ();
 
   //
-- 
2.28.0.windows.1


  reply	other threads:[~2022-10-05  3:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-05  3:35 [edk2-platforms][PATCH v1 0/3] Platform/Intel: Fix invalid DEBUG() macros Michael Kubacki
2022-10-05  3:35 ` Michael Kubacki [this message]
2022-10-05  3:35 ` [edk2-platforms][PATCH v1 2/3] TigerLakeOpenBoardPkg: Remove unnecessary debug macro argument Michael Kubacki
2022-10-06 12:19   ` Heng Luo
2022-10-06 23:59   ` Chaganty, Rangasai V
2022-10-05  3:35 ` [edk2-platforms][PATCH v1 3/3] WhitleyOpenBoardPkg: Fix invalid debug macros Michael Kubacki
2022-10-10 21:11 ` [edk2-platforms][PATCH v1 0/3] Platform/Intel: Fix invalid DEBUG() macros Isaac Oram
     [not found] ` <171CD17D6C79385E.7991@groups.io>
2022-10-10 21:17   ` [edk2-devel] " Isaac Oram

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221005033531.3994-2-mikuback@linux.microsoft.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox