mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: sej <trash@aie-etudes.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: DMA transfer with kiobuf, kernel 2.4.21
Date: Tue, 15 Nov 2005 18:49:45 +0100	[thread overview]
Message-ID: <1132076986.2822.34.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <437A1D6E.4060302@aie-etudes.com>

On Tue, 2005-11-15 at 18:39 +0100, sej wrote:
> Hi,
> I allocate a big chunck of memory from user space with :
> 
> #define MEM_SIZE_DMA (128*1024*1024)
> // allocate 128MB of memory
> void *_pVirtualMem = memalign(sysconf(_SC_PAGESIZE), MEM_SIZE_DMA);
> 
> // Reserve memory
> memset(_pVirtualMem, 0, MEM_SIZE_DMA);
> 
> // Lock memory
> if (!mlock(_pVirtualMem, MEM_SIZE_DMA ))
> {
> free(_pVirtualMem);
> return false;
> }
> 
> Then I call an IOCTL from my driver (DmaMapDescrpImg) to create a DMA
> scatter gather list.

that sounds the wrong approach.. why don't you make your device driver
export an mmap function.. and let the userspace app use that ?


> 
> transfer->Descript[i].size        = PAGE_SIZE;
> transfer->Descript[i].pciaddr    = (ULONG)
> virt_to_phys(page_address(iobuf->maplist[idxIobuf]));

you really need to use the PCI DMA mapping api!




  reply	other threads:[~2005-11-15 17:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-15 17:39 sej
2005-11-15 17:49 ` Arjan van de Ven [this message]
2005-11-15 17:53   ` sej
2005-11-15 18:01     ` Arjan van de Ven
2005-11-16  8:35       ` sej

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=1132076986.2822.34.camel@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trash@aie-etudes.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®