request_mem_region 与 ioremap【转】

简介:

转自:http://blog.csdn.net/alada007/article/details/7700125

如果从根本上说起的话应该从Intel的处理器芯片与其它的芯片的不同说起,与这两个函数相关的是对 I/OPort与内存的寻址方式,intel的处理器中内存与外部IOPort是独立编址与寻址的,这就有了两种地址空间分别是内存地址空间与IO地址空间,访问IO地址空间需使用不同的指令。与intel不同的是有些处理器(如PowerPC等)就只有一个地址空间,即内存空间,在这种情况下,外设的I/OPort物理地址就需要被映射到内存地址空间才能被访问,这主就是所说的Memery-Mapped, 而Intel的把I/OPort物理地址映射到I/O地址空间中就是所说的IO-Mapped。

要使用I/OPort内存则需先申请再映射,即先调用request_mem_region,内核发现这样的函数调用会将该I/OPort地址标记为以被使用,如其它人再来申请则告之其该内存已使用。调用申请函数之后可以放心的映射(ioremap)了,当然不调用申请函数直接映射该I/OPort地址到虚拟空间也是可以的,但鬼才知道一个I/OPort地址指向多个虚拟空间什么发生什么事情! 把I/OPort地址映射到虚拟地址空间还有一个好处就是访问I/OPort可以虚拟地址上加一偏移就O啦。









本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/sky-heaven/p/5664372.html,如需转载请自行联系原作者





相关文章
|
8月前
|
容器
【问题处理】Error response from daemon: Pool overlaps with other one on this address space
Error response from daemon: Pool overlaps with other one on this address space
146 0
|
4月前
|
中间件 应用服务中间件 Apache
Higress有对max_request_bytes做限制吗?我有个应用上传文件报413 request entity too large错误
Higress有对max_request_bytes做限制吗?我有个应用上传文件报413 request entity too large错误
41 0
|
4月前
|
Serverless
函数计算FC的SD运行后报错怎么处理?{"ErrorCode":"ResourceThrottled","ErrorMessage":"Reserve resource exceeded limit"}
函数计算FC的SD运行后报错怎么处理?{"ErrorCode":"ResourceThrottled","ErrorMessage":"Reserve resource exceeded limit"}
168 1
|
5月前
|
负载均衡 监控 网络协议
502 Bad Gateway Registered endpoint failed to handle the request
502 Bad Gateway Registered endpoint failed to handle the request
64 1
|
8月前
|
前端开发 数据库
Failed to load response dataNo data found for resource with given identifier
Failed to load response dataNo data found for resource with given identifier
1042 0
|
存储 缓存 大数据
Starrocks执行查询报错:Memory of process exceed limit. Used: XXX, Limit: XXX. Mem usage has exceed the limit of BE
Starrocks执行查询报错:Memory of process exceed limit. Used: XXX, Limit: XXX. Mem usage has exceed the limit of BE
|
9月前
|
存储 Java
A timeout exceeded while waiting to proceed with the request, please reduce your request rate【已解决】
A timeout exceeded while waiting to proceed with the request, please reduce your request rate【已解决】
297 0
|
索引
ES报错:“type“=>“cluster_block_exception“, “reason“=>“blocked by: [FORBIDDEN/12/index read-only / allow
ES报错:“type“=>“cluster_block_exception“, “reason“=>“blocked by: [FORBIDDEN/12/index read-only / allow
273 0
ES报错:“type“=>“cluster_block_exception“, “reason“=>“blocked by: [FORBIDDEN/12/index read-only / allow
callbackend entry point - iwfndcl_mgw_request_manager~read_entity
007. callbackend entry point - /iwfnd/cl_mgw_request_manager~read_entity Created by Wang, Jerry, last modified on Jan 06, 2015
146 0
callbackend entry point - iwfndcl_mgw_request_manager~read_entity