Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 09 Jul 2008 21:10:26 -0700
From:      Julian Elischer <julian@elischer.org>
To:        Peter Jeremy <peterjeremy@optushome.com.au>
Cc:        David Christensen <davidch@broadcom.com>, "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>
Subject:   Re: Proper Printf Format for Printing Physical Addresses on 32 and 64 bit Systems
Message-ID:  <48758BB2.8040706@elischer.org>
In-Reply-To: <20080710035403.GZ62764@server.vk2pj.dyndns.org>
References:  <5D267A3F22FD854F8F48B3D2B52381932677CC83F1@IRVEXCHCCR01.corp.ad.broadcom.com> <20080710035403.GZ62764@server.vk2pj.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Peter Jeremy wrote:
> On 2008-Jul-09 18:00:45 -0700, David Christensen <davidch@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 :-)


> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48758BB2.8040706>