|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] Physical address mapping to user space in dom0 problem
Thanks, It works.
Here is what I have in the mmap handler:
if the physical address is MMIO
io_remap_pfn_range(MMIO_address)
else
remap_pfn_range(virt_to_phys(cpu-ptr-returned-by-pci-alloc-consistent)
hyang
On 3/18/07, Keir Fraser <keir@xxxxxxxxxxxxx> wrote:
On 17/3/07 21:52, "Haw-Yuan Yang" <
hawyuan@xxxxxxxxx> wrote:
I knew that pci_alloc_consistent() will return both kernel virtual address and physical address. If I pass the physical address (dma_handler) to mmap, it return -1. However if I pass the kernel virtual address to mmap, I got a pointer point to the worng memory.
Oh, I see the problem. You can only mmap() MMIO regions using /dev/mem when running on Xen. Could your device (which you already implement ioctl() for) also implement mmap() itself? Then you can simply remap_pfn_range(virt_to_phys(cpu-ptr-returned-by-pci-alloc-consistent)). This would be a neater interface to userspace for your device anyway, imo.
-- Keir
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|