All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Fillod Stephane <stephane.fillod@domain.hid>
Cc: xenomai-help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] RTDM mmap and DMA
Date: Sun, 23 Dec 2007 14:09:44 +0100	[thread overview]
Message-ID: <18286.24088.191796.349268@domain.hid> (raw)
In-Reply-To: <0B45E93C5FF65740AEAE690BF3848B7A4AB2DF@rennsmail04.eu.thmulti.com>

Fillod Stephane wrote:
 > Perrine Martignoni wrote:
 > >Currently, I write an RTDM module and I would like to do DMA and mmap
 > to perform transfers who have hard constraints.
 > >I would like to know if there is an example in a driver who would help
 > me to do this.
 > 
 > I'm looking for the same need, except I'm not using RTDM, and everything
 > is in userland. Using the attached patch against Xenomai 2.4.0, I hope
 > to make it to work with something like this:
 > 
 >         RT_HEAP_INFO info;
 >         RT_HEAP heap;
 >         void *user_addr;	/* DMA buffer, user access */
 >         unsigned long dma_addr;	/* for use with the DMA controller */
 > 
 >         /* Allocate memory, suitable for DMA. This occurs before
 > entering RT land. */
 >         err = rt_heap_create (&heap,
 >                         name,
 >                         heapsz,
 >                         H_SHARED|H_DMA);
 >         if (err) { /* ... */ }
 > 
 >         err = rt_heap_alloc (&heap, 0, TM_INFINITE, &user_addr);
 >         if (err) { /* ... */ }
 > 
 >         err = rt_heap_inquire (&heap, &info);
 >         if (err) { /* ... */ }
 > 
 >         dma_addr = info.phys_addr;
 > 
 > Any comments?

You patch looks OK. However, a small detail: can not we use the constant
KMALLOC_MAX_SIZE defined in linux/slab.h instead of defining our own
constant ?

-- 


					    Gilles Chanteperdrix.


  parent reply	other threads:[~2007-12-23 13:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-14 13:59 [Xenomai-help] RTDM mmap and DMA Fillod Stephane
2007-12-14 15:50 ` Perrine Martignoni
2007-12-23 13:09 ` Gilles Chanteperdrix [this message]
2007-12-26 23:37 ` Gilles Chanteperdrix
  -- strict thread matches above, loose matches on Subject: below --
2008-01-03 18:40 Fillod Stephane
2007-12-27 15:39 Fillod Stephane
2007-12-27 15:43 ` Gilles Chanteperdrix
2007-12-28 21:59 ` Gilles Chanteperdrix
2007-12-18 17:40 Fillod Stephane
2007-12-18 17:55 ` Gilles Chanteperdrix
2007-12-17 14:40 Fillod Stephane
2007-12-14 11:24 Perrine Martignoni
2007-12-18  9:21 ` Stéphane ANCELOT
2007-12-18  9:29 ` Jan Kiszka
2007-12-18 10:10   ` Gilles Chanteperdrix
2007-12-18 10:16     ` Perrine Martignoni
2007-12-18 10:18       ` Gilles Chanteperdrix
2007-12-18 10:12   ` Perrine Martignoni
2007-12-18 12:47     ` Jan Kiszka
2007-12-18 13:20       ` Gilles Chanteperdrix
2007-12-18 14:11       ` Perrine Martignoni
2007-12-18 14:22         ` Jan Kiszka
2007-12-18 14:41           ` Perrine Martignoni

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=18286.24088.191796.349268@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=stephane.fillod@domain.hid \
    --cc=xenomai@xenomai.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.