- 论坛徽章:
- 9
|
humjb_1983 发表于 2014-08-06 08:53 ![]()
呵呵,兄弟说的哪个函数每次只能操作4k?应该不会吧,在get_vm_area后,vm_struct->pages是个数组,可以容 ...
sorry, 引用你的帖的时候点错了。这不,刚写完,打算去洗澡了吗,手快点错了。
4K的说法,应该是针对你如下的这个贴的:
void *io_mapping_map_atomic_wc(struct io_mapping *mapping,
unsigned long offset);
void *io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset);
Either function will return a kernel-space pointer which is mapped to the page at the given offset. The atomic form is essentially a kmap_atomic() call - it uses the KM_USER0 slot, which is a good thing for developers to know about. It is, by far, the faster of the two, but it requires that the mapping be held by atomic code, and only one page at a time can be mapped in this way. Code which might sleep must use io_mapping_map_wc(), which currently falls back to the old ioremap_wc() implementation.
每次调用都是给offset所在的页做映射,也就是可以的虚拟地址一直是4K,内容在轮换。 |
|