aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetri Savolainen <petri.savolainen@nokia.com>2020-04-30 12:56:26 +0300
committerPetri Savolainen <petri.savolainen@nokia.com>2020-05-15 15:46:07 +0300
commit12878e98f37a5dbc5650f7cf85588f8a4a9604cc (patch)
tree1417699b372446658eb5597e4ed868f4a0a3d0de
parent053c262b19e9f4e128aa41b37e3513c7ec2c9906 (diff)
api: shm: add ODP_SHM_HW_ACCESS flag
This can be used to memory allocations where both CPUs and HW accelerators access the same memory area. These HW accelerators may be programmed outside of ODP APIs, but the memory is reserved and shared normally inside/between ODP applications. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Stanislaw Kardach <skardach@marvell.com>
-rw-r--r--include/odp/api/spec/shared_memory.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/odp/api/spec/shared_memory.h b/include/odp/api/spec/shared_memory.h
index 58ecaa920..6d4066f15 100644
--- a/include/odp/api/spec/shared_memory.h
+++ b/include/odp/api/spec/shared_memory.h
@@ -44,6 +44,14 @@ extern "C" {
/**
* Application SW only, no HW access
+ *
+ * @deprecated When set, application will not share the reserved memory with HW
+ * accelerators. However, leaving this flag to zero does not guarantee that
+ * the reserved memory can be accessed from HW, and thus usage of this flag is
+ * considered deprecated. If HW accessible memory is required, set
+ * ODP_SHM_HW_ACCESS instead.
+ *
+ * This flag must not be combined with ODP_SHM_HW_ACCESS.
*/
#define ODP_SHM_SW_ONLY 0x1
@@ -79,6 +87,17 @@ extern "C" {
#define ODP_SHM_HP 0x10
/**
+ * Share memory with HW accelerators
+ *
+ * When set, this flag guarantees that the reserved memory is accessible
+ * by both CPUs and HW accelerators of the device. This may require e.g. that
+ * the odp_shm_reserve() call configures the memory to be accessible through
+ * an Input-Output Memory Management Unit (IOMMU). The reserve call will return
+ * failure if such configuration is not supported.
+ */
+#define ODP_SHM_HW_ACCESS 0x20
+
+/**
* Shared memory block info
*/
typedef struct odp_shm_info_t {