3

I'm writing device driver for embedded linux machine and i have the next question: is it possible to allocate buffer in kernel space by device driver, than mmap() it by application program so, that there would not be any caching while reading/writing to buffer from driver and program, i.e. program will see immideately what driver has written to that buffer and vise versa.

As far as i know - opening device file with O_DIRECT flag isn't purposed for mmap (it's for read() and write() syscalls), i noticed in one emaillist that flag MAP_UNCAHED can be usefull - but it is not defined for my arch.

I need that uncached buffer for perfomance purposes - the data from hardware is placed to buffer, then program works with it once - and old data in buffer will not be in use, so, cache is not usefull there.

0 Answers0