public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Zhichao" <zhichao.gao@intel.com>
To: devel@edk2.groups.io
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>,
	Jian J Wang <jian.j.wang@intel.com>, Hao Wu <hao.a.wu@intel.com>,
	Ray Ni <ray.ni@intel.com>, Star Zeng <star.zeng@intel.com>,
	Liming Gao <liming.gao@intel.com>,
	Sean Brogan <sean.brogan@microsoft.com>,
	Michael Turner <Michael.Turner@microsoft.com>
Subject: [PATCH V2 2/2] MdeModulePkg/CapsulePei: Update the debug code to print 64bit data
Date: Fri, 12 Apr 2019 08:13:39 +0800	[thread overview]
Message-ID: <20190412001339.13560-3-zhichao.gao@intel.com> (raw)
In-Reply-To: <20190412001339.13560-1-zhichao.gao@intel.com>

From: Bret Barkelew <Bret.Barkelew@microsoft.com>

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

For some pointer and UINT64 data, the debug code print with '%x'.
Which would loss the upper 32bit data. So update '%x' to '%lx'
for these data. And change the pointer value from '%x' to '%p'.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
---
 .../CapsulePei/Common/CapsuleCoalesce.c        | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c b/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c
index a88b2fff95..468eea5d3f 100644
--- a/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c
+++ b/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c
@@ -327,9 +327,9 @@ ValidateCapsuleIntegrity (
     return NULL;
   }
 
-  DEBUG ((DEBUG_INFO, "Ptr - 0x%x\n", Ptr));
-  DEBUG ((DEBUG_INFO, "Ptr->Length - 0x%x\n", Ptr->Length));
-  DEBUG ((DEBUG_INFO, "Ptr->Union - 0x%x\n", Ptr->Union.ContinuationPointer));
+  DEBUG ((DEBUG_INFO, "Ptr - 0x%p\n", Ptr));
+  DEBUG ((DEBUG_INFO, "Ptr->Length - 0x%lx\n", Ptr->Length));
+  DEBUG ((DEBUG_INFO, "Ptr->Union - 0x%lx\n", Ptr->Union.ContinuationPointer));
   while ((Ptr->Length != 0) || (Ptr->Union.ContinuationPointer != (EFI_PHYSICAL_ADDRESS) (UINTN) NULL)) {
     //
     // Make sure the descriptor is aligned at UINT64 in memory
@@ -348,9 +348,9 @@ ValidateCapsuleIntegrity (
       if (!ValidateCapsuleByMemoryResource (MemoryResource, (EFI_PHYSICAL_ADDRESS) (UINTN) Ptr, sizeof (EFI_CAPSULE_BLOCK_DESCRIPTOR))) {
         return NULL;
       }
-      DEBUG ((DEBUG_INFO, "Ptr(C) - 0x%x\n", Ptr));
-      DEBUG ((DEBUG_INFO, "Ptr->Length - 0x%x\n", Ptr->Length));
-      DEBUG ((DEBUG_INFO, "Ptr->Union - 0x%x\n", Ptr->Union.ContinuationPointer));
+      DEBUG ((DEBUG_INFO, "Ptr(C) - 0x%p\n", Ptr));
+      DEBUG ((DEBUG_INFO, "Ptr->Length - 0x%lx\n", Ptr->Length));
+      DEBUG ((DEBUG_INFO, "Ptr->Union - 0x%lx\n", Ptr->Union.ContinuationPointer));
     } else {
       if (!ValidateCapsuleByMemoryResource (MemoryResource, Ptr->Union.DataBlock, Ptr->Length)) {
         return NULL;
@@ -403,9 +403,9 @@ ValidateCapsuleIntegrity (
       if (!ValidateCapsuleByMemoryResource (MemoryResource, (EFI_PHYSICAL_ADDRESS) (UINTN) Ptr, sizeof (EFI_CAPSULE_BLOCK_DESCRIPTOR))) {
         return NULL;
       }
-      DEBUG ((DEBUG_INFO, "Ptr(B) - 0x%x\n", Ptr));
-      DEBUG ((DEBUG_INFO, "Ptr->Length - 0x%x\n", Ptr->Length));
-      DEBUG ((DEBUG_INFO, "Ptr->Union - 0x%x\n", Ptr->Union.ContinuationPointer));
+      DEBUG ((DEBUG_INFO, "Ptr(B) - 0x%p\n", Ptr));
+      DEBUG ((DEBUG_INFO, "Ptr->Length - 0x%lx\n", Ptr->Length));
+      DEBUG ((DEBUG_INFO, "Ptr->Union - 0x%lx\n", Ptr->Union.ContinuationPointer));
     }
   }
 
-- 
2.21.0.windows.1


  parent reply	other threads:[~2019-04-12  0:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-12  0:13 [PATCH V2 0/2] MdeModulePkg/CapsulePei: Update the debug code to print 64bit data Gao, Zhichao
2019-04-12  0:13 ` [PATCH V2 1/2] MdeModulePkg/CapsulePei: Change debug MACRO Gao, Zhichao
2019-04-12  0:13 ` Gao, Zhichao [this message]
2019-04-12  4:44 ` [edk2-devel] [PATCH V2 0/2] MdeModulePkg/CapsulePei: Update the debug code to print 64bit data Wu, Hao A
2019-04-16  5:08   ` Wu, Hao A

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=20190412001339.13560-3-zhichao.gao@intel.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