diff mbox

[08/10] linux-generic: shm: add term_global

Message ID 1422586015-29874-9-git-send-email-mike.holmes@linaro.org
State New
Headers show

Commit Message

Mike Holmes Jan. 30, 2015, 2:46 a.m. UTC
From: Yan Sonming <yan.songming@linaro.org>

Signed-off-by: Yan Songming <yan.songming@linaro.org>
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 platform/linux-generic/include/odp_internal.h | 1 +
 platform/linux-generic/odp_init.c             | 5 +++++
 platform/linux-generic/odp_shared_memory.c    | 8 ++++++++
 3 files changed, 14 insertions(+)
diff mbox

Patch

diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h
index d6a89ff..5b81570 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -32,6 +32,7 @@  int odp_thread_term_local(void);
 int odp_thread_term_global(void);
 
 int odp_shm_init_global(void);
+int odp_shm_term_global(void);
 int odp_shm_init_local(void);
 
 int odp_buffer_pool_init_global(void);
diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c
index 6a27b42..8e61368 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -107,6 +107,11 @@  int odp_term_global(void)
 		return -1;
 	}
 
+	if (odp_shm_term_global()) {
+		ODP_ERR("ODP shm term failed.\n");
+		return -1;
+	}
+
 	return 0;
 }
 
diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c
index 96d10e8..01cfdb0 100644
--- a/platform/linux-generic/odp_shared_memory.c
+++ b/platform/linux-generic/odp_shared_memory.c
@@ -96,6 +96,14 @@  int odp_shm_init_global(void)
 	return 0;
 }
 
+int odp_shm_term_global(void)
+{
+	int ret = 0;
+
+	ret = munmap(odp_shm_tbl, sizeof(odp_shm_table_t));
+	return ret;
+}
+
 
 int odp_shm_init_local(void)
 {