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

Scott Long scottl at samsco.org
Thu Jul 10 03:50:35 UTC 2008


David Christensen 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?
> 
> Dave
> 
>

Cast it to a uintmax_t and use %ju or %jx

Scott


More information about the freebsd-current mailing list