diff mbox

[v3,3/4] api: config: rename ODP_SHM_NUM_BLOCKS to ODP_CONFIG_SHM_BLOCKS

Message ID 1424806074-26864-3-git-send-email-mike.holmes@linaro.org
State Superseded
Headers show

Commit Message

Mike Holmes Feb. 24, 2015, 7:27 p.m. UTC
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 include/odp/api/config.h                   |  2 +-
 platform/linux-generic/odp_shared_memory.c | 16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)
diff mbox

Patch

diff --git a/include/odp/api/config.h b/include/odp/api/config.h
index b3e8438..b6a8d7c 100644
--- a/include/odp/api/config.h
+++ b/include/odp/api/config.h
@@ -125,7 +125,7 @@  extern "C" {
  *
  * This the the number of separate SHM areas that can be reserved concurrently
  */
-#define ODP_SHM_NUM_BLOCKS (ODP_CONFIG_POOLS * 4)
+#define ODP_CONFIG_SHM_BLOCKS (ODP_CONFIG_POOLS * 4)
 
 /**
  * @}
diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c
index 9b6e92b..1eb288e 100644
--- a/platform/linux-generic/odp_shared_memory.c
+++ b/platform/linux-generic/odp_shared_memory.c
@@ -44,7 +44,7 @@  typedef struct {
 
 
 typedef struct {
-	odp_shm_block_t block[ODP_SHM_NUM_BLOCKS];
+	odp_shm_block_t block[ODP_CONFIG_SHM_BLOCKS];
 	odp_spinlock_t  lock;
 
 } odp_shm_table_t;
@@ -104,7 +104,7 @@  static int find_block(const char *name, uint32_t *index)
 {
 	uint32_t i;
 
-	for (i = 0; i < ODP_SHM_NUM_BLOCKS; i++) {
+	for (i = 0; i < ODP_CONFIG_SHM_BLOCKS; i++) {
 		if (strcmp(name, odp_shm_tbl->block[i].name) == 0) {
 			/* found it */
 			if (index != NULL)
@@ -130,7 +130,7 @@  int odp_shm_free(odp_shm_t shm)
 
 	i = from_handle(shm);
 
-	if (i >= ODP_SHM_NUM_BLOCKS) {
+	if (i >= ODP_CONFIG_SHM_BLOCKS) {
 		ODP_DBG("odp_shm_free: Bad handle\n");
 		return -1;
 	}
@@ -214,14 +214,14 @@  odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align,
 		return ODP_SHM_INVALID;
 	}
 
-	for (i = 0; i < ODP_SHM_NUM_BLOCKS; i++) {
+	for (i = 0; i < ODP_CONFIG_SHM_BLOCKS; i++) {
 		if (odp_shm_tbl->block[i].addr == NULL) {
 			/* Found free block */
 			break;
 		}
 	}
 
-	if (i > ODP_SHM_NUM_BLOCKS - 1) {
+	if (i > ODP_CONFIG_SHM_BLOCKS - 1) {
 		/* Table full */
 		odp_spinlock_unlock(&odp_shm_tbl->lock);
 		ODP_DBG("odp_shm_reserve: no more blocks\n");
@@ -319,7 +319,7 @@  void *odp_shm_addr(odp_shm_t shm)
 
 	i = from_handle(shm);
 
-	if (i > (ODP_SHM_NUM_BLOCKS - 1))
+	if (i > (ODP_CONFIG_SHM_BLOCKS - 1))
 		return NULL;
 
 	return odp_shm_tbl->block[i].addr;
@@ -333,7 +333,7 @@  int odp_shm_info(odp_shm_t shm, odp_shm_info_t *info)
 
 	i = from_handle(shm);
 
-	if (i > (ODP_SHM_NUM_BLOCKS - 1))
+	if (i > (ODP_CONFIG_SHM_BLOCKS - 1))
 		return -1;
 
 	block = &odp_shm_tbl->block[i];
@@ -362,7 +362,7 @@  void odp_shm_print_all(void)
 
 	ODP_PRINT("  id name                       kB align huge addr\n");
 
-	for (i = 0; i < ODP_SHM_NUM_BLOCKS; i++) {
+	for (i = 0; i < ODP_CONFIG_SHM_BLOCKS; i++) {
 		odp_shm_block_t *block;
 
 		block = &odp_shm_tbl->block[i];