Subject: Re: MACHINE_NONCONTIG
To: None <tech-kern@NetBSD.ORG, gwr@mc.com>
From: Wolfgang Solfrank <ws@kurt.tools.de>
List: tech-kern
Date: 02/28/1997 16:15:24
> It would be nice if we could get rid of all the 
> 
> 	#ifdef MACHINE_NONCONTIG
> 
> junk in the VM code.

Yes, that does make a lot of sense to me.

However:

> /*
>  * Return the number of page indices in the range of
>  * possible return values for pmap_page_index() for
>  * all addresses provided by pmap_next_page().  This
>  * return value is used to allocate per-page data.
>  *
>  * Note that a machine with a "hole" in physical memory
>  * may include the pages in the hole in this count, and
>  * skip the pages in the hole in pmap_next_page().
>  */
> u_int
> pmap_free_pages()
> {
> 	int bytes;
> 
> 	bytes = avail_end - avail_start;
> 	return(atop(bytes));
> }

This routine needn't return the total amount of free pages (albeit it doesn't
hurt (much)), but only the amount that is still available.  So it's probably
better to change the code to use avail_next instead of avail_start, i.e.:

u_int
pmap_free_pages()
{
	int bytes;

	bytes = avail_end - avail_next;
	return(atop(bytes));
}
--
ws@TooLs.DE     (Wolfgang Solfrank, TooLs GmbH) 	+49-228-985800