@@ -125,7 +125,7 @@ extern "C" {
*
* Limits how many blocks are available for calls to odp_shm_reserve()
*/
-#define ODP_SHM_NUM_BLOCKS 64
+#define ODP_CONFIG_SHM_NUM_BLOCKS 64
/**
* @}
@@ -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_NUM_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_NUM_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_NUM_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_NUM_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_NUM_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_NUM_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_NUM_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_NUM_BLOCKS; i++) {
odp_shm_block_t *block;
block = &odp_shm_tbl->block[i];
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(-)