博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
(2.6kernel)io_remap_page_range()与io_remap_pfn_range()
阅读量:2171 次
发布时间:2019-05-01

本文共 1994 字,大约阅读时间需要 6 分钟。

io_remap_page_range() 现在不被推荐使用;使用io_remap_pfn_range() 来代替()。

详情可参考:

io_remap_page_range() has always been a strange function. Its stated purpose is to portably map I/O memory into a process's address space. Its prototype has always differed from one system to the next, however, making portable use difficult. On most architectures it looks like this:

int io_remap_page_range(struct vm_area_struct *vma, unsigned long virt_addr,                            unsigned long phys_addr, unsigned long size,                             pgprot_t prot);

The sparc64 architecture, however, defines it this way:

int io_remap_page_range(struct vm_area_struct *vma, unsigned long virt_addr,                            unsigned long phys_addr, unsigned long size,                             pgprot_t prot, int space);

The extra argument (space) was necessary to deal with the inconvenient fact that I/O addresses on the sparc64 architecture would not fit into anunsigned long variable.

The from remap_page_range() toremap_pfn_range() was done, in part, to address (so to speak) this issue. Since remapping must be done on a page-aligned basis anyway, there is no real point in using a regular physical address, which contains the offset within the page. Said offset, after all, must be zero. By using a page frame number instead, the range of the phys_addr argument is extended far enough to reach into I/O memory on all architectures. Theremap_pfn_range() work stopped short of actually fixing the io_remap_page_range() problem, however.

Randy Dunlap has now finished the task with a set of patches adding io_remap_pfn_range():

int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,                           unsigned long pfn, unsigned long size,                            pgprot_t prot);

This function has the same prototype on all architectures. In-tree callers have been modified, and the feature removal schedule has been updated:io_remap_page_range() will go away in September, 2005.

转载地址:http://spqzb.baihongyu.com/

你可能感兴趣的文章
用 RNN 训练语言模型生成文本
查看>>
RNN与机器翻译
查看>>
用 Recursive Neural Networks 得到分析树
查看>>
RNN的高级应用
查看>>
TensorFlow-7-TensorBoard Embedding可视化
查看>>
轻松看懂机器学习十大常用算法
查看>>
一个框架解决几乎所有机器学习问题
查看>>
特征工程怎么做
查看>>
机器学习算法应用中常用技巧-1
查看>>
机器学习算法应用中常用技巧-2
查看>>
通过一个kaggle实例学习解决机器学习问题
查看>>
决策树的python实现
查看>>
Sklearn 快速入门
查看>>
了解 Sklearn 的数据集
查看>>
用ARIMA模型做需求预测
查看>>
推荐系统
查看>>
TensorFlow-11-策略网络
查看>>
浅谈 GBDT
查看>>
如何选择优化器 optimizer
查看>>
一文了解强化学习
查看>>