Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Mar 2008 07:07:01 -0800 (PST)
From:      fchang@cs.ubc.ca
To:        Roman Divacky <rdivacky@freebsd.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Updating vmware3 (and missing "avail_end" from /usr/include/machine/pmap.h)
Message-ID:  <Pine.GSO.4.60.0803010703260.28678@cascade.cs.ubc.ca>
In-Reply-To: <20080301122041.GB73096@freebsd.org>
References:  <Pine.GSO.4.60.0802291321580.18632@cascade.cs.ubc.ca> <20080301121701.GA73096@freebsd.org> <20080301122041.GB73096@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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!





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.60.0803010703260.28678>