Adrian> Jes Sorensen wrote:
>> I would probably go for using virt_to_bus(ioremap(base_address[]))
>> here.
Adrian> I don't think that's going to work (except maybe on alpha).
Adrian> On x86 and ppc ioremap() will allocate virtual address space
Adrian> somewhere, using get_vm_area(). virt_to_bus(address) on PPC
Adrian> just does return (unsigned long)address - KERNELBASE +
Adrian> PCI_DRAM_OFFSET; and on x86 does (with a bit of macro
Adrian> expansion) return ((unsigned long)(address) & ~PAGE_OFFSET)
Adrian> It looks like virt_to_bus() and virt_to_phys() can only be
Adrian> safely used on kernel virtual addresses corresponding to
Adrian> RAM. Which is not a surprising design decision, as working
Adrian> through page tables is much slower.
Hmmmm you might be right there, I forgot that what you get back from
ioremap() is more a cookie and what you hand virt_to_bus() is actual
memory .... guess there might be something which needs to be cleared
up.
That reply was definately sent out too early in the morning by me.
Jes
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/