Subject: Re: pmap & ISADMA
To: Robert Swindells <rjs@fdy2.demon.co.uk>
From: Ben Harris <bjh21@netbsd.org>
List: port-arm
Date: 02/22/2002 01:01:30
On Thu, 21 Feb 2002, Robert Swindells wrote:

> Ben Harris wrote:
> >On Wed, 20 Feb 2002, Matt Thomas wrote:
> >> The right way to fix this is to redo the arguments to pmap_bootstrap.
> >>
> >> It should be passed an array of the following struct:
> >>
> >> { int memreg_freelist; paddr_t memreg_start; psize_t memreg_size; }
>
> >Wouldn't it be easier to have the caller just register the memory with
> >uvm_page_physload() itself, and then have pmap_bootstrap() get back what
> >information it needs?  As far as I can see, this is what pmap_bootstrap()
> >does internally anyway.
>
> You only have two cases though, either all memory is the same or you
> have special areas.
>
> Why not code it up in one place as it is at present rather than
> needing a version in each port.

What do you mean by "it" here?  At present, MD code passes an array of
memory ranges, and an ISADMA range, to pmap_bootstrap().  pmap_bootstrap()
works out which memory ranges intersect the ISADMA range, and registers
the memory with uvm_page_physload(), putting memory in the ISADMA range on
its own free list.

Matt's suggestion was to move the ISADMA intersection checking out of
pmap_bootstrap(), and have the MD code pass an array of (memory range,
free list) tuples to pmap_bootstrap(), which would pass them straight on
to uvm_page_physload().

My suggestion was to have the MD code pass those tuples directly to
uvm_page_physload(), cutting out the middle man.

> Matt's suggestion works well for the SA1111 as you have several ranges
> that all need to map onto the same freelist.

I don't see how it works any better than mine.

-- 
Ben Harris                                                   <bjh21@netbsd.org>
Portmaster, NetBSD/arm26               <URL:http://www.netbsd.org/Ports/arm26/>