From 12878e98f37a5dbc5650f7cf85588f8a4a9604cc Mon Sep 17 00:00:00 2001 From: Petri Savolainen Date: Thu, 30 Apr 2020 12:56:26 +0300 Subject: 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 Reviewed-by: Matias Elo Reviewed-by: Stanislaw Kardach --- include/odp/api/spec/shared_memory.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 @@ -78,6 +86,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 */ -- cgit v1.2.3