Module: xenomai-head
Branch: master
Commit: bebaf3a512c835287d930c04ac6a04cadcd29d83
URL:    
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=bebaf3a512c835287d930c04ac6a04cadcd29d83

Author: Daniel Jacques <jacques.dan...@thomson-networks.com>
Date:   Fri Oct 15 00:21:56 2010 +0200

native: add an H_DMA32 flag to allow rt_heaps to use the DMA32 memory

---

 include/native/heap.h    |    1 +
 ksrc/skins/native/heap.c |   10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/include/native/heap.h b/include/native/heap.h
index 963f21c..4ce659d 100644
--- a/include/native/heap.h
+++ b/include/native/heap.h
@@ -34,6 +34,7 @@
 #define H_SINGLE   0x400       /* Manage as single-block area. */
 #define H_SHARED   (H_MAPPABLE|H_SINGLE) /* I.e. shared memory segment. */
 #define H_NONCACHED 0x800
+#define H_DMA32     0x1000      /* Use memory suitable for DMA32. */
 
 /** Structure containing heap-information useful to users.
  *
diff --git a/ksrc/skins/native/heap.c b/ksrc/skins/native/heap.c
index 3eb7bfc..2fd1d4e 100644
--- a/ksrc/skins/native/heap.c
+++ b/ksrc/skins/native/heap.c
@@ -2,7 +2,7 @@
  * @file
  * This file is part of the Xenomai project.
  *
- * @note Copyright (C) 2004 Philippe Gerum <r...@xenomai.org> 
+ * @note Copyright (C) 2004 Philippe Gerum <r...@xenomai.org>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -164,7 +164,7 @@ static void __heap_flush_private(xnheap_t *heap,
        xnarch_free_host_mem(heapmem, heapsize);
 }
 
-/*! 
+/*!
  * \fn int rt_heap_create(RT_HEAP *heap,const char *name,size_t heapsize,int 
mode);
  * \brief Create a memory heap or a shared memory segment.
  *
@@ -241,6 +241,11 @@ static void __heap_flush_private(xnheap_t *heap,
  * operations with I/O devices. The physical address of the
  * heap can be obtained by a call to rt_heap_inquire().
  *
+ * - H_DMA32 causes the block pool associated to the heap to be
+ * allocated in physically contiguous memory, suitable for DMA32
+ * operations with I/O devices. The physical address of the
+ * heap can be obtained by a call to rt_heap_inquire().
+ *
  * - H_NONCACHED causes the heap not to be cached. This is necessary on
  * platforms such as ARM to share a heap between kernel and user-space.
  * Note that this flag is not compatible with the H_DMA flag.
@@ -301,6 +306,7 @@ int rt_heap_create(RT_HEAP *heap, const char *name, size_t 
heapsize, int mode)
                err = xnheap_init_mapped(&heap->heap_base,
                                         heapsize,
                                         ((mode & H_DMA) ? GFP_DMA : 0)
+                                        | ((mode & H_DMA32) ? GFP_DMA32 : 0)
                                         | ((mode & H_NONCACHED) ?
                                            XNHEAP_GFP_NONCACHED : 0));
                if (err)


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to