Messages in this thread | | | Date | Fri, 13 Nov 1998 12:51:39 +0000 | From | Jamie Lokier <> | Subject | Re: Accessing MMIO PCI space - crossplatform |
| |
On Fri, Nov 13, 1998 at 01:41:31PM +0100, Rogier Wolff wrote: > Jamie Lokier wrote: > > Remove phys_to_virt: it does not make sense. > > Some PCI controllers are able to create linked lists in memory. You > give them some memory to work with, and they manage the memory in that > area. If you walk that list and have found a pointer to a data-area, > you will need to dereference that physical address.
Yes, but you always dereference it as a *kernel virtual* address. I.e., "virt" not "phys".
If the pointer was created by the controller, then it's a "bus" address. If the pointer was created by the kernel (e.g. address of a preallocated data area), then it's a "virt" address.
So you either need bus_to_virt(ptr) or just ptr.
"phys" type addresses are only used for page tables. And even when hand-translating a page table, pte_page(x) returns a "virt" address.
-- Jamie
- 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/
| |