Re: Proper Printf Format for Printing Physical Addresses on 32 and 64 bit Systems

From: Julian Elischer <julian_at_elischer.org>
Date: Wed, 09 Jul 2008 21:10:26 -0700
Peter Jeremy wrote:
> On 2008-Jul-09 18:00:45 -0700, David Christensen <davidch_at_broadcom.com> wrote:
>> I have some debugging code in my network driver and I'd like
>> to print out the physical address of a memory block.  What's
>> the right way to use a printf() that works on both 32 and 64
>> bit platforms?
> 
> %p - see printf(3) or printf(9)

unfortunately he specified PHYSICAL address.
in a PAE machine you need a 64 bit number to hold it on
a "32 bit" machine.

and that isn't the only machine where physical and virtual addresses 
are not the same. (think original x86 :-)


> 
Received on Thu Jul 10 2008 - 02:10:28 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:32 UTC