3

I am developing a real-time application for Linux 3.5.7. The application needs to manage a PCI-E device.

In order to access the PCI-E card spaces, I have been using mmap in combination with /dev/mem. However (please correct me if I am wrong) each time I read or write the mapped memory, a system call is required for the /dev/mem pseudo-driver to handle the memory access.

To avoid the overhead of this system call, I think it should be possible to write a kernel module so that, within e.g. a ioctl call I can modify the process page table, in order to map the physical device pages to userspace pages and avoid the system call.

Can you give me some orientation on this?

Thanks and regards

4

1 回答 1

7

但是(如果我错了请纠正我)每次读取或写入映射内存时,都需要系统调用

你错了。

应该可以编写一个内核模块,以便在例如 ioctl 调用中我可以修改进程页表

这正是 mmap() 所做的。

于 2013-06-05T19:49:15.987 回答