diff options
author | Mike Holmes <mike.holmes@linaro.org> | 2014-11-06 16:27:47 -0500 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2014-11-07 17:57:36 +0300 |
commit | 0c9e15cf6b26071f0110573b6d1fce079a55d4a5 (patch) | |
tree | e0f3acdedbdfde1a44208f00d21ef1a7533007a1 /platform | |
parent | eac4b478d9f46f60ed5e134a266d3143cdb29816 (diff) |
api/odp_shared_memory.h: add odp_shm_free
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform')
-rw-r--r-- | platform/linux-generic/include/api/odp_shared_memory.h | 13 | ||||
-rw-r--r-- | platform/linux-generic/odp_shared_memory.c | 6 |
2 files changed, 19 insertions, 0 deletions
diff --git a/platform/linux-generic/include/api/odp_shared_memory.h b/platform/linux-generic/include/api/odp_shared_memory.h index d8d40dd06..1a598240f 100644 --- a/platform/linux-generic/include/api/odp_shared_memory.h +++ b/platform/linux-generic/include/api/odp_shared_memory.h @@ -72,6 +72,19 @@ odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, uint32_t flags); /** + * Free a contiguous block of shared memory + * + * Frees a previously reserved block of shared memory. + * @note Freeing memory that is in use will result in UNDEFINED behaviour. + * + * @param[in] shm Block handle + * + * @retval 0 for success + * @retval 1 on failure + */ +int odp_shm_free(odp_shm_t shm); + +/** * Lookup for a block of shared memory * * @param name Name of the block diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c index 60a868b3f..24a5d6089 100644 --- a/platform/linux-generic/odp_shared_memory.c +++ b/platform/linux-generic/odp_shared_memory.c @@ -10,6 +10,7 @@ #include <odp_align.h> #include <odp_system_info.h> #include <odp_debug.h> +#include <odp_debug_internal.h> #include <unistd.h> #include <sys/mman.h> @@ -220,6 +221,11 @@ odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, return block->hdl; } +int odp_shm_free(odp_shm_t shm ODP_UNUSED) +{ + ODP_UNIMPLEMENTED(); + return 0; +} odp_shm_t odp_shm_lookup(const char *name) { |