Subject: Re: mmap'ing framebuffer memory in MI drivers...
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: Eduardo E. Horvath <>
List: tech-kern
Date: 03/06/1999 07:49:26
On Fri, 5 Mar 1999, Jonathan Stone wrote:

> In message <>Jason Thorpe writes
> >On Fri, 5 Mar 1999 18:50:07 -0800 (PST) 
> > "Eduardo E. Horvath" <> wrote:
> >...because, for one, the first N times it's called, you're not entering
> >any mappings at all... You're just checking that the mapping request is
> >valid.
> >
> >Take a look at udv_fault() for how the mappings are actually entered.
> i.e., it just iterates over each page in the region, calling the
> d_mmap() routine to verify that permission and bounds checks will
> succeed.

And it immediately calls pmap_enter() if the mapping would succeed.  There
is no instance I can find where if the d_mmap() routine is called and
returns a success, pmap_enter is not immediately called.  I see no other
calls just to check for permissions.

> But what do you think of GWR's idea of a separate once-per-mmap() call
> to do that?  If we had that entrypoint, couldn't we do what Eduardo
> suggests?

That would also work.  Probably good to have it called for unmapping
(pmap_remove()) so the driver (and bus_space*()) can free up any resources
they may have needed to allocate for the mapping.

Eduardo Horvath
	"I need to find a pithy new quote." -- me