diff mbox

[v2] api/odp_shared_memory.h: add odp_shm_free

Message ID 1415309267-50564-1-git-send-email-mike.holmes@linaro.org
State Accepted
Commit 0c9e15cf6b26071f0110573b6d1fce079a55d4a5
Headers show

Commit Message

Mike Holmes Nov. 6, 2014, 9:27 p.m. UTC
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 platform/linux-generic/include/api/odp_shared_memory.h | 13 +++++++++++++
 platform/linux-generic/odp_shared_memory.c             |  6 ++++++
 2 files changed, 19 insertions(+)

Comments

Bill Fischofer Nov. 7, 2014, 2:49 p.m. UTC | #1
On Thu, Nov 6, 2014 at 3:27 PM, Mike Holmes <mike.holmes@linaro.org> wrote:

> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>

    Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>


> ---
>  platform/linux-generic/include/api/odp_shared_memory.h | 13 +++++++++++++
>  platform/linux-generic/odp_shared_memory.c             |  6 ++++++
>  2 files changed, 19 insertions(+)
>
> diff --git a/platform/linux-generic/include/api/odp_shared_memory.h
> b/platform/linux-generic/include/api/odp_shared_memory.h
> index d8d40dd..1a59824 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 c770a80..4e0f05e 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>
> @@ -219,6 +220,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)
>  {
> --
> 2.1.0
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Maxim Uvarov Nov. 7, 2014, 2:58 p.m. UTC | #2
Merged!

Thanks,
Maxim.

On 11/07/2014 12:27 AM, Mike Holmes wrote:
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> ---
>   platform/linux-generic/include/api/odp_shared_memory.h | 13 +++++++++++++
>   platform/linux-generic/odp_shared_memory.c             |  6 ++++++
>   2 files changed, 19 insertions(+)
>
> diff --git a/platform/linux-generic/include/api/odp_shared_memory.h b/platform/linux-generic/include/api/odp_shared_memory.h
> index d8d40dd..1a59824 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 c770a80..4e0f05e 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>
> @@ -219,6 +220,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)
>   {
diff mbox

Patch

diff --git a/platform/linux-generic/include/api/odp_shared_memory.h b/platform/linux-generic/include/api/odp_shared_memory.h
index d8d40dd..1a59824 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 c770a80..4e0f05e 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>
@@ -219,6 +220,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)
 {