From owner-freebsd-hackers@FreeBSD.ORG Sat Mar 1 15:07:04 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40AD11065678 for ; Sat, 1 Mar 2008 15:07:04 +0000 (UTC) (envelope-from fchang@cs.ubc.ca) Received: from smtp.cs.ubc.ca (smtp.cs.ubc.ca [142.103.6.52]) by mx1.freebsd.org (Postfix) with ESMTP id 0A02D8FC13 for ; Sat, 1 Mar 2008 15:07:03 +0000 (UTC) (envelope-from fchang@cs.ubc.ca) Received: from cascade.cs.ubc.ca (cascade.cs.ubc.ca [142.103.7.7]) by smtp.cs.ubc.ca (8.13.7/8.13.6) with ESMTP id m21F71K4024541 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 1 Mar 2008 07:07:02 -0800 Date: Sat, 1 Mar 2008 07:07:01 -0800 (PST) From: fchang@cs.ubc.ca To: Roman Divacky In-Reply-To: <20080301122041.GB73096@freebsd.org> Message-ID: References: <20080301121701.GA73096@freebsd.org> <20080301122041.GB73096@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Mailman-Approved-At: Sat, 01 Mar 2008 15:20:14 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: Updating vmware3 (and missing "avail_end" from /usr/include/machine/pmap.h) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2008 15:07:04 -0000 On Sat, 1 Mar 2008, Roman Divacky wrote: > I think you can use "ptoa(Maxmem) - round_page(MSGBUF_SIZE)", > the ptoa(Maxmem) > erm.. what I meant to say what > that hw.realmem - round_page(MSGBUF_SIZE) should work Hi: Before I saw your message, I continued my search and found an January 2007 mailing list message by Kip Macy on how to compute avail_end: http://groups.google.com/group/mailing.freebsd.current/msg/7039973c1586a8a7 static vm_paddr_t get_avail_end(void) { vm_paddr_t avail_end; int i; avail_end = phys_avail[1]; for (i = 0; phys_avail[i + 1]; i += 2) { if (phys_avail[i + 1] > avail_end) avail_end = phys_avail[i + 1]; } return avail_end; } Are the two methods equivalent? Also, how do I use hw.realmem like you suggested? I tried the following, but the file wouldn't compile: static vm_paddr_t avail_end = hw.realmem - round_page(MSGBUF_SIZE); Thank you!