From owner-freebsd-arch Mon Oct 1 20:46:14 2001 Delivered-To: freebsd-arch@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id ACA5937B405 for ; Mon, 1 Oct 2001 20:46:10 -0700 (PDT) Received: (from dan@localhost) by dan.emsphone.com (8.11.4/8.11.4) id f923k4574676; Mon, 1 Oct 2001 22:46:05 -0500 (CDT) (envelope-from dan) Date: Mon, 1 Oct 2001 22:46:04 -0500 From: Dan Nelson To: Mike Silbersack Cc: freebsd-arch@FreeBSD.ORG Subject: Re: Reading physical memory in a cross-platform way Message-ID: <20011001224604.A29573@dan.emsphone.com> References: <20011001222450.A39302@dan.emsphone.com> <20011001222555.S7118-100000@achilles.silby.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011001222555.S7118-100000@achilles.silby.com> User-Agent: Mutt/1.3.22.1i X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (Oct 01), Mike Silbersack said: > On Mon, 1 Oct 2001, Dan Nelson wrote: > > It looks like 'physmem' (aka the hw.physmem sysctl) is defined the > > same way on all the systems; are you looking for something else? > > > > -- > > Dan Nelson > > dnelson@allantgroup.com > > physmem != hw.physmem. The sysctl is actually the output of a function, > not a simple int or the like. Yeah, but look at the function (i386 as an example): static int sysctl_hw_physmem(SYSCTL_HANDLER_ARGS) { int error = sysctl_handle_int(oidp, 0, ctob(physmem), req); return (error); } So the physmem value is just in pages; even though the different platforms use ctob() or _ptob(), the macros all expand to ((x) << PAGE_SHIFT). Junior Kernel Hacker project: convert alpha and ia64 to use ctob() in the name of consistency :) -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message