On Wednesday 19 September 2001 19:35, Calin A. Culianu wrote:
[...]
> I wonder how efficient it is though?  I am assuming a trap is generated
> whenever the user process accesses an mmapped file or device (so that
> the device's driver can take over the details of reading/writing).  I
> wonder if that still happens in the case of mmapping /dev/mem, or if
> there is some other workaround that linux applies to this case (like
> doing hackish things with the page tables/MMU).

There will be no pagefaults in the normal case. In many cases, the very 
idea with a mmap() "interface to a driver" is to *avoid* talking to the 
driver, and touch the memory directly.

For example, if you set a sound card up in mmap() mode, you'll get direct 
access to the DMA buffer, which the card is looping continously. Just 
write data into the buffer, and it'll be played. Keep track of the DMA 
position, and it might even sound good! ;-)


//David Olofson --- Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
|      Multimedia Application Integration Architecture      |
| A Free/Open Source Plugin API for Professional Multimedia |
`----------------------------> http://www.linuxdj.com/maia -'
.- David Olofson -------------------------------------------.
| Audio Hacker - Open Source Advocate - Singer - Songwriter |
`--------------------------------------> [EMAIL PROTECTED] -'

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/

Reply via email to