From: Keir Fraser <keir@xensource.com>
To: Haw-Yuan Yang <hawyuan@gmail.com>, Keir Fraser <keir@xensource.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: Physical address mapping to user space in dom0 problem
Date: Sat, 17 Mar 2007 07:57:03 +0000 [thread overview]
Message-ID: <C2214FCF.481B%keir@xensource.com> (raw)
In-Reply-To: <63c711180703161736v49c25721kb06c648f316fb292@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 591 bytes --]
You want to mmap() the dma_handle, not the CPU pointer.
-- Keir
On 17/3/07 00:36, "Haw-Yuan Yang" <hawyuan@gmail.com> 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.
[-- Attachment #1.2: Type: text/html, Size: 1105 bytes --]
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2007-03-17 7:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-16 23:27 Physical address mapping to user space in dom0 problem Haw-Yuan Yang
2007-03-16 23:31 ` Keir Fraser
2007-03-17 0:36 ` Haw-Yuan Yang
2007-03-17 7:57 ` Keir Fraser [this message]
2007-03-17 21:52 ` Haw-Yuan Yang
2007-03-18 8:59 ` Keir Fraser
2007-03-18 20:11 ` Haw-Yuan Yang
2007-03-18 21:14 ` Keir Fraser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C2214FCF.481B%keir@xensource.com \
--to=keir@xensource.com \
--cc=hawyuan@gmail.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.