|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] Physical address mapping to user space in dom0 problem
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.
hyang
On 3/17/07, Keir Fraser <keir@xxxxxxxxxxxxx> wrote:
You want to mmap() the dma_handle, not the CPU pointer.
-- Keir
On 17/3/07 00:36, "Haw-Yuan Yang" <
hawyuan@xxxxxxxxx> wrote:
In driver I have an IOCTL option IO_DMA_ALLOC to allocate the DMA buffer by using pci_alloc_consistent() and return the allocated physical address to user space.
In user space testing program: 1. Call IOCTL IO_DMA_ALLOC to allocate a 64Kbyte DMA buffer. The physical address of the allocated buffer is 0x03bb0000. 2. Open /dev/mem and call mmap(0,64*1024,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0x03bb0000) ;
the return of mmap is -1.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|