_______________________________________________
Linux 内核开发中文邮件列表
Linux-...@zh-kernel.org
http://zh-kernel.org/mailman/listinfo/linux-kernel
Linux 内核开发中文社区: http://zh-kernel.org
在 2011年7月14日星期四,下午12:38,卞磊 写道:
> 在 2011年7月14日 上午11:20,jojo <rji...@gmail.com (mailto:rji...@gmail.com)> 写道:
> > hi all,
> > RT,我之前实验了下,我的硬件对这地址操作就不对了。。。。
> > 请了解的同学给点分享下。。。谢谢。
> virt_to_phys应该只能用于线性地址。
> 你用ioremap本来就知道设备的物理地址,干嘛还要再转呢?
> >
> > _______________________________________________
> > Linux 内核开发中文邮件列表
> > Linux-...@zh-kernel.org (mailto:Linux-...@zh-kernel.org)
> > http://zh-kernel.org/mailman/listinfo/linux-kernel
> > Linux 内核开发中文社区: http://zh-kernel.org
> _______________________________________________
> Linux 内核开发中文邮件列表
> Linux-...@zh-kernel.org (mailto:Linux-...@zh-kernel.org)
在 2011年7月14日星期四,下午1:29,liyangth 写道:
> virt = ioremap(phys, 0x1000);
> printk("phys[%p], phys1[%p]\n", phys, virt_to_phys(virt));
> 自己看
> At 2011-07-14 11:20:57,jojo <rji...@gmail.com (mailto:rji...@gmail.com)> wrote:
> > hi all,
> > RT,我之前实验了下,我的硬件对这地址操作就不对了。。。。
> > 请了解的同学给点分享下。。。谢谢。
> >
> > _______________________________________________
> > Linux 内核开发中文邮件列表
> > Linux-...@zh-kernel.org (mailto:Linux-...@zh-kernel.org)
from arch/x86/include/asm/io.h:
/**
* ioremap - map bus memory into CPU space
* @offset: bus address of the memory
* @size: size of the resource to map
*
* ioremap performs a platform specific sequence of operations to
* make bus memory CPU accessible via the readb/readw/readl/writeb/
* writew/writel functions and the other mmio helpers. *The returned
* address is not guaranteed to be usable directly as a virtual
* address*.
*
* If the area you are trying to map is a PCI BAR you should have a
* look at pci_iomap().
*/