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

Julian Elischer julian at elischer.org
Thu Jul 10 04:10:28 UTC 2008


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 :-)


> 



More information about the freebsd-current mailing list