Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src



On Wed Jan 26 2011 at 02:09:30 +0000, Mindaugas Rasiukevicius wrote:
> > + * Make a kernel mapping valid for I/O, e.g. non-cachable.
> > + * Alignment and length constraints are as-if NBPG==PAGE_SIZE.
> > + */
> > +int
> > +ioaccess(vaddr_t vaddr, paddr_t paddr, vsize_t len)
> > +{
> > +
> > +   while (len > PAGE_SIZE) {
> > +           pmap_kenter_pa(vaddr, paddr, VM_PROT_WRITE, 0);
> > +           len -= PAGE_SIZE;
> > +           vaddr += PAGE_SIZE;
> > +           paddr += PAGE_SIZE;
> > +   }
> > +
> > +   if (len) {
> > +           /* We could warn.. */
> > +           pmap_kenter_pa(vaddr, paddr, VM_PROT_WRITE, 0);
> > +   }
> > +
> > +   /* BUGBUG should use pmap_enter() instead and check results! */
> > +   return 0;
> > +}
> > +
> > +/*
> > + * Opposite to the above: just forget the mapping.
> > + */
> > +int
> > +iounaccess(vaddr_t vaddr, vsize_t len)
> > +{
> > +
> > +   pmap_kremove(vaddr, len);
> > +   return 0;
> > +}
> 
> What is this miracle, however?

IIRC that miracle is about mapping the flash which is not in kseg1.
The story included lots of details on how mapping an arbitrary physical
address was much easier on Mach ;)

The story was told last summer, though, so if you want more
clarifications, I can ask Sandro for a refresh.

I guess it could call pmap_update() to play nice, though.

-- 
älä karot toivorikkauttas, kyl rätei ja lumpui piisaa


Home | Main Index | Thread Index | Old Index