当前位置:网站首页>Mmio and PMIO Technology
Mmio and PMIO Technology
2022-04-21 07:26:00 【longyu_ wlz】
MMIO technology
PMIO What is it? ?
PMIO Its full name is port-mapped I/O, It is used specifically to perform I/O A special class designed for operation CPU Instructions , Such as x86 and x86-64 In the architecture in and out Instructions .I/O The device has an address space independent of general memory , Can pass CPU Additional on the physical interface I/O Pin to achieve . because I/O The address space of is isolated from the address space of main memory , So this is sometimes called isolation I/O.
advantage :
- I/O The port address does not occupy memory space ; Use special I/O Command to operate on the port ,I/O Short instruction , Fast execution .
- Due to the use of special I/O Command access port , also I/O Port address and memory address are separate ,I/O Port address and memory address can overlap , Without confusing each other .
shortcoming :
- cpu Separate instructions need to be designed , The implementation is relatively complex
- Only use EAX、AX and AL Register to control the reading and writing of data , visit I/O The device needs many instructions to complete
- Special instructions are required to operate I/O Space , Cannot operate with general memory access instructions , High coding cost
In the early cpu The number of bits and memory space are small ,PMIO It has the advantage of not occupying memory space , With the expansion of processor bits and memory space ,PMIO This advantage of architecture is gradually lost ,MMIO Architecture is becoming mainstream .
MMIO What is it? ?
MMIO Its full name is Memory-mapped I/O, Memory mapping I/O For memory and I/O Devices are addressed using the same address space .I/O The memory and registers of the device are mapped into a unified address space .
In this framework , Memory address can refer to physical address RAM Part of , Can also refer to I/O Memory and registers of the device . Used to access memory cpu Instructions may also be used to access peripherals I/O Memory and register space .
MMIO The advantages of
- MMIO As a different CPU To device communication method , Will not affect the equipment DMA The process
- MMIO Discarded port I/O The complexity ,cpu Requires less internal logic
- MMIO Under the architecture , General memory instructions can be used to access I/O peripherals ,CPU All addressing modes of can be used for I/O And memory .
MMIO Examples of use
linux The kernel uses ioremap To map I/O Physical memory , Examples are as follows :
gpio_base_addr = ioremap(GPIO_BASE_ADDR, 0x7000);
ioremap When the mapping is complete , Reading and writing I/O Register is consistent with ordinary memory read and write operations , No special code is required , Examples are as follows :
unsigned int *base_addr;
base_addr = (unsigned int *)(gpio_base_addr + offset);
*base_addr &= ~(0x8 << 7);
MMIO Do not access I/O Registers do not require any special instructions , visit I/O Registers are consistent with accessing normal memory space .
版权声明
本文为[longyu_ wlz]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210618507325.html
边栏推荐
猜你喜欢
随机推荐
How to prevent SQL injection
Fundamentals of graphics | PBR review
【保姆安装教程】Linux操作系统中源码下载MySQL5.7
图形学基础|PBR回顾
读书笔记-精进 如何成为一个很厉害的人
图形学基础|深度缓冲(DepthBuffer)
Udevd retrieves the kernel module and loads the demo
Fundamentals of graphics | skin rendering
Setpci command and kernel PCI_ enable_ Device and PCI_ disable_ Device function
PG database cannot use zh_ CN. UTF-8:initdb: error: locale “zh_CN.UTF-8“ requires unsupported encoding “GBK“
图形学基础|皮肤渲染
C# Winform 关于ListView显示不全问题
Learn Ruixin micro rk3399pro record (10)
sqlmap的安装和使用
利用GoogleColab进行YOLO行人检测计数(YOLOv3+DeepSORT)
力扣-354.俄罗斯套娃信封问题
获取进程最后一次执行的 cpu 核的方法及原理
Method and principle of obtaining the CPU core of the last execution of the process
Database splitting under microservice architecture
Change picture suffix









