From owner-freebsd-arch Mon Oct 1 20:25: 7 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 C555B37B401 for ; Mon, 1 Oct 2001 20:25:04 -0700 (PDT) Received: (from dan@localhost) by dan.emsphone.com (8.11.4/8.11.4) id f923Oqq24491; Mon, 1 Oct 2001 22:24:52 -0500 (CDT) (envelope-from dan) Date: Mon, 1 Oct 2001 22:24:51 -0500 From: Dan Nelson To: Mike Silbersack Cc: freebsd-arch@FreeBSD.ORG Subject: Re: Reading physical memory in a cross-platform way Message-ID: <20011001222450.A39302@dan.emsphone.com> References: <20011001214234.W98394-100000@achilles.silby.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011001214234.W98394-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: > Right now I'm working on autoscaling files/procs/etc. It's an easy > job, except for one problem I keep bumping my head into: figuring out > how much memory the system has. It appears that for each > architecture we store the size of physical memory in a different way, > requiring conversion functions that are different for each > architecture. This makes my job difficult. :) > > So, two questions: > > 1. Is there a variable / function which contains the size of memory > across all platforms that I am missing? > > 2. If not, is there a problem if I add a u_int64_t containing the size of > physical memory in bytes in machdep.c for each architecture? 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message