From: Gerd Knorr <kraxel@bytesex.org>
To: linux-kernel@vger.kernel.org
Subject: Re: mmap
Date: 15 May 2001 07:33:12 GMT [thread overview]
Message-ID: <slrn9g1mto.74g.kraxel@bytesex.org> (raw)
In-Reply-To: <CA256A4D.00256728.00@d73mta05.au.ibm.com>
mdaljeet@in.ibm.com wrote:
> I am doing the following:
>
> malloc some memory is user space
> pass its pointer to some kernel module
> in the kernel module...do a pci_alloc_consistent so that i get a memory
> region for PCI DMA operations
Wrong approach, you can use kiobufs if you want DMA to the malloc()ed
userspace memory:
* lock down the user memory using map_user_kiobuf() + lock_kiovec()
(see linux/iobuf.h).
* translate the iobuf->maplist into a scatterlist [1]
* feed pci_map_sg() with the scatterlist to get DMA addresses.
you can pass to the hardware.
And the reverse to free everything when you are done of course.
Gerd
[1] IMHO it would be more useful if iobufs would use a scatterlist
instead of an struct page* array.
--
Gerd Knorr <kraxel@bytesex.org> -- SuSE Labs, Außenstelle Berlin
next prev parent reply other threads:[~2001-05-15 9:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-15 6:47 mmap mdaljeet
2001-05-15 7:33 ` Gerd Knorr [this message]
2001-05-15 9:42 ` mmap Alan Cox
-- strict thread matches above, loose matches on Subject: below --
2001-05-15 10:08 mmap mdaljeet
2001-07-02 14:00 mmap mdaljeet
2001-07-03 17:47 ` mmap Jens Axboe
2006-01-05 6:16 mmap Brett McNerney
2006-01-05 10:03 mmap Fillod Stephane
2006-10-26 0:48 mmap Sudharsan Rangarajan
2006-10-26 1:02 ` mmap Ian McDonald
2006-10-26 1:02 ` mmap Hagen Paul Pfeifer
2011-12-02 12:20 mmap Sébastien Paumier
2011-12-02 14:45 ` mmap Eric Dumazet
2012-08-23 13:06 mmap Christophe Hauser
2012-08-23 14:18 ` mmap Mulyadi Santosa
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=slrn9g1mto.74g.kraxel@bytesex.org \
--to=kraxel@bytesex.org \
--cc=linux-kernel@vger.kernel.org \
/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.