Subject: Re: mmap() from kernel to user
To: Lennart Augustsson <lennart@augustsson.net>
From: Kamal R. Prasad <kamalp@acm.org>
List: tech-kern
Date: 11/27/2004 18:27:41
Lennart Augustsson wrote:

> Kamal R. Prasad wrote:
>
>> Is there some src code using the mmap() "method" that does just that?
>>
>
> I don't know of a really good example in the kernel, but you could
> look e.g., at the audio driver.  Not exactly what you want, but still.
>
>     -- Lennart

Thanks. I found the code for the mmap() method in pcm/dsp.c [in the 
freebsd codebase].
One potential bug is that it does an spltty(), but I would probably end 
up doing something like splusb().

BTW -I find that while the ATTACH()/DETACH() methods are being called 
correctly, a call to mydev_read()/mydev_poll() does not take place on 
doing a read()/poll() on the fd obtained by opening the device. Instead 
-it goes to usbread() and usbpoll() -which doesn't contain the reqd 
functionality. I copied code from other usb drives as I do not know much 
about the framework. Id appreciate any help on this.

thanks
-kamal