From owner-freebsd-current@FreeBSD.ORG Thu Jul 10 04:10:28 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D9B51065671 for ; Thu, 10 Jul 2008 04:10:28 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outS.internet-mail-service.net (outs.internet-mail-service.net [216.240.47.242]) by mx1.freebsd.org (Postfix) with ESMTP id F2EDB8FC12 for ; Thu, 10 Jul 2008 04:10:27 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 3BFAF2353; Wed, 9 Jul 2008 21:10:28 -0700 (PDT) Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 628E02D600F; Wed, 9 Jul 2008 21:10:27 -0700 (PDT) Message-ID: <48758BB2.8040706@elischer.org> Date: Wed, 09 Jul 2008 21:10:26 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Peter Jeremy References: <5D267A3F22FD854F8F48B3D2B52381932677CC83F1@IRVEXCHCCR01.corp.ad.broadcom.com> <20080710035403.GZ62764@server.vk2pj.dyndns.org> In-Reply-To: <20080710035403.GZ62764@server.vk2pj.dyndns.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: David Christensen , "freebsd-current@freebsd.org" Subject: Re: Proper Printf Format for Printing Physical Addresses on 32 and 64 bit Systems X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2008 04:10:28 -0000 Peter Jeremy wrote: > On 2008-Jul-09 18:00:45 -0700, 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? > > %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 :-) >