Hi:
I've tried to write a solaris 2.1 X86 mmap driver that allows me to mmap my Mach32
ATI's framebuffer region into user space. The framebuffer region is 4megs in
size. Not being the Solaris kernel guru, I have the following questions:
1. I've noticed that when I try to mmap(2) the 4Meg region, my device driver xxmmap(9E)
gets called for each 4k page of the 4Meg region. My xxmmap(9E) routine then calls
ddi_mmap_regs(9F). Each ddi_map_reg() call has the "size" parameter set to the total
register length I've specified in my driver.conf(4). Why is the kernel calling my xxmmap(9E)
routine that many times? Should I be calling ddi_map_regs(9F) on each invocation of
xxmmap(9E)?
2. When my test program does a munmap(2) call, how do I relate that to a driver function
that should do a ddi_unmap_regs(9F)? I'd rather not put the ddi_unmap_reg(9F) in my
xxclose(9E) routine as many legitimate uses of mmaping involve closing the device
after the mmap(2) is established. If there is no way to relate munmap(2) to any driver
routine, then how does the kernel clean up the region? What is ddi_unmap_reg(9F) then
used for?
Any help/comments/suggestions are greatly appreciated.
Doug Anson
--
-------------------------------------------
Doug Anson
Phone: 713.560.1274
FAX: 713.560.1277
SNAIL: Landmark Graphics Corporation LGC
15150 Memorial Drive
Houston, TX 77079
-------------------------------------------