diff mbox

[API-NEXT,RFC,04/31] api: shared_memory: getting DMA descriptor

Message ID 1452285014-60320-5-git-send-email-christophe.milard@linaro.org
State New
Headers show

Commit Message

Christophe Milard Jan. 8, 2016, 8:29 p.m. UTC
Adding a function to get a DMA descriptor (describing how to perform a DMA
mapping on the given shared memory block). Also added a flag (ODP_SHM_DMA)
to be given at block reservation time, when DMA reachable memory is
required.

Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
---
 include/odp/api/shared_memory.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff mbox

Patch

diff --git a/include/odp/api/shared_memory.h b/include/odp/api/shared_memory.h
index 5d851ce..01d6005 100644
--- a/include/odp/api/shared_memory.h
+++ b/include/odp/api/shared_memory.h
@@ -18,6 +18,7 @@ 
 extern "C" {
 #endif
 
+#include<odp/dma.h>
 
 /** @defgroup odp_shared_memory ODP SHARED MEMORY
  *  Operations on shared memory.
@@ -49,6 +50,7 @@  extern "C" {
 /* Share level */
 #define ODP_SHM_SW_ONLY 0x1 /**< Application SW only, no HW access */
 #define ODP_SHM_PROC    0x2 /**< Share with external processes */
+#define ODP_SHM_DMA     0x4 /**< DMA reachable mem */
 
 /**
  * Shared memory block info
@@ -125,6 +127,18 @@  void *odp_shm_addr(odp_shm_t shm);
  */
 int odp_shm_info(odp_shm_t shm, odp_shm_info_t *info);
 
+/**
+ * Shared memory block DMA descriptor
+ *
+ * @param[in]  shm   Block handle
+ *	             The memory block must have been created with the
+ *                   ODP_SHM_DMA flag.
+ *
+ * @retval a single DMA descriptor describing the required DMA mapping for
+ *         this memory area.
+ *	   Returns ODP_DMA_REGION_INVALID on error.
+ */
+odp_dma_map_t odp_shm_get_dma_map(odp_shm_t shm);
 
 /**
  * Print all shared memory blocks