📜  io地址和内存地址是什么意思 - 汇编代码示例

📅  最后修改于: 2022-03-11 14:48:10.239000             🧑  作者: Mango

代码示例2
Memory mapped I/O is a technique of performing I/O operations between the CPU and the I/O device. We can perform I/O simply by accessing bytes of memory and relying on the OS kernel to ensure that the changes to the memory are propagated to the mapped I/O device.

This technique can provide performance benefits like :

A normal read() or write() call involves two transfers. One between the I/O device and the kernel buffer cache, and the other between the buffer cache and a user-space buffer. Memory mapping eliminates the second of these transfers.
Memory mapping can also improve performance by lowering memory requirements. It uses one less buffer to store the data i.e. a single buffer is shared between the kernel space and user space.