tech-kern archive

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

Re: drivers customizing mmap(2)



On Wed, Mar 6, 2013 at 2:08 AM, Taylor R Campbell <riastradh%netbsd.org@localhost> wrote:
   Date: Mon, 4 Mar 2013 19:15:37 -0600
   From: David Young <dyoung%pobox.com@localhost>

                                                          I thought that
   perhaps the device's cdevsw could provide an alternate to d_mmap,
   int (*d_get_pagerops)(dev_t, struct uvm_pagerops **) or something,
   for uvm_mmap to call.

This is more or less what FreeBSD did -- they added a d_mmap_single
operation to struct cdevsw,

   int (*d_mmap_single)(struct cdev *, vm_ooffset_t *, vm_size_t,
       struct vm_object **, int);

which returns a vm object rather than a set of pager ops for a vm
object.  This would obviously serve too, since it worked for FreeBSD's
drm purposes, and might be easier to implement.

vm_object containing ... what?  DMA memory?  Device's memory?

NetBSD's bus_dma(9) allocates "raw" managed pages.  One idea is to make it a UVM object, but I've not thoroughly considered its implications.


Home | Main Index | Thread Index | Old Index