Subject: mmap and memory caching
To: None <tech-kern@netbsd.org>
From: None <kyle.unice@L-3com.com>
List: tech-kern
Date: 08/08/2002 08:35:49
If a program uses mmap to map a section of device memory to a virtual
address range, there appears to be little control over the attributes of
that range in terms of caching.  The device driver gets a call to its
xxx_mmap() entry point.  The xxx_mmap returns the physical address of the
memory being mapped but cant dictate whether the CPU should cache it or not.
This means that the application using mmap must use some APIs to flush the
cache related to that address range, to ensure the data the application
reads is consistent with the state of the memory of the device.   

I may be missing something here, but shouldn't the driver xxx_mmap() call be
able to dictate the caching bits associated with the physical address
returned?

Kyle

_____________________________________________
Kyle Unice
L-3 Communications / Communication Systems - West
Advanced Network Engineering
640 North 2200 West 
P.O.Box 16850
Salt Lake City, UT  84116

Voice: (801) 594-2687
Fax: (801) 594-3269