diff options
Diffstat (limited to 'src/framework/common/mem_mgr/nsfw_nshmem')
4 files changed, 22 insertions, 22 deletions
diff --git a/src/framework/common/mem_mgr/nsfw_nshmem/nsfw_nshmem_mdesc.c b/src/framework/common/mem_mgr/nsfw_nshmem/nsfw_nshmem_mdesc.c index c78c27e..fdb2079 100644 --- a/src/framework/common/mem_mgr/nsfw_nshmem/nsfw_nshmem_mdesc.c +++ b/src/framework/common/mem_mgr/nsfw_nshmem/nsfw_nshmem_mdesc.c @@ -40,7 +40,7 @@ nsfw_mem_ops g_nshmem_ops = { nsfw_nshmem_ringcreate, NULL, nsfw_nshmem_ringrelease, - nsfw_nshmem_stactic, + nsfw_nshmem_static, NULL, NULL, /*mem_ops_sp_iterator */ NULL, /*mem_ops_mbuf_iterator */ diff --git a/src/framework/common/mem_mgr/nsfw_nshmem/nsfw_nshmem_mng.c b/src/framework/common/mem_mgr/nsfw_nshmem/nsfw_nshmem_mng.c index d5661fd..49e3769 100644 --- a/src/framework/common/mem_mgr/nsfw_nshmem/nsfw_nshmem_mng.c +++ b/src/framework/common/mem_mgr/nsfw_nshmem/nsfw_nshmem_mng.c @@ -181,7 +181,7 @@ nsfw_nshmem_destory (void) * Prototype : nsfw_nshmem_reserv_safe * Description : malloc a memory and save to memzone * Input : const char* name -* size_t lenth +* size_t length * Output : None * Return Value : mzone_handle * Calls : @@ -189,20 +189,20 @@ nsfw_nshmem_destory (void) * *****************************************************************************/ mzone_handle -nsfw_nshmem_reserv_safe (const char *name, size_t lenth) +nsfw_nshmem_reserv_safe (const char *name, size_t length) { void *addr = NULL; i32 iret = NSFW_MEM_OK; nsfw_nshmem_mzone *pmemzone = NULL; - if (lenth <= 0) + if (length <= 0) { return NULL; } nsfw_write_lock (nsfw_get_glb_lock ()); - addr = malloc (lenth); + addr = malloc (length); if (!addr) { NSCOMM_LOGERR ("nshmem malloc addr fail] addr=%p", addr); @@ -210,7 +210,7 @@ nsfw_nshmem_reserv_safe (const char *name, size_t lenth) return NULL; } - iret = MEMSET_S (addr, lenth, 0, lenth); + iret = MEMSET_S (addr, length, 0, length); if (EOK != iret) { NSCOMM_LOGERR ("nshmem malloc addr MEMSET_S fail] addr=%p", addr); @@ -230,8 +230,8 @@ nsfw_nshmem_reserv_safe (const char *name, size_t lenth) } pmemzone->addr = addr; - pmemzone->lenth = lenth; - /*name must be less than NSFW_MEM_APPNAME_LENTH */ + pmemzone->length = length; + /*name must be less than NSFW_MEM_APPNAME_LENGTH */ if (EOK != STRCPY_S ((char *) pmemzone->aname, sizeof (pmemzone->aname), name)) { @@ -256,7 +256,7 @@ nsfw_nshmem_create (nsfw_mem_zone * pinfo) NSFW_NAME_LENCHECK_RET_NULL (pinfo->stname.aname, "nshmem create"); NSFW_NSHMEM_INIT_CHK_RET_NULL (); - return nsfw_nshmem_reserv_safe (pinfo->stname.aname, pinfo->lenth); + return nsfw_nshmem_reserv_safe (pinfo->stname.aname, pinfo->length); } /***************************************************************************** @@ -284,7 +284,7 @@ nsfw_nshmem_lookup (nsfw_mem_name * pname) mz = &g_nshmem_internal_cfg->amemzone[icnt]; if (mz->addr != NULL - && !strncmp (pname->aname, mz->aname, NSFW_MEM_NAME_LENTH)) + && !strncmp (pname->aname, mz->aname, NSFW_MEM_NAME_LENGTH)) { nsfw_read_unlock (nsfw_get_glb_lock ()); return mz->addr; @@ -320,7 +320,7 @@ nsfw_nshmem_release (nsfw_mem_name * pname) mz = &g_nshmem_internal_cfg->amemzone[icnt]; if (mz->addr != NULL - && !strncmp (pname->aname, mz->aname, NSFW_MEM_NAME_LENTH)) + && !strncmp (pname->aname, mz->aname, NSFW_MEM_NAME_LENGTH)) { nsfw_nshmem_free_zone (mz); nsfw_read_unlock (nsfw_get_glb_lock ()); @@ -380,7 +380,7 @@ nsfw_nshmem_spcreate (nsfw_mem_sppool * pmpinfo) ringflag].ring_ops_enqueue (pringhead, (void *) pmz)) { - NSCOMM_LOGERR ("nsfw_nshmem_ringenqueue enque fail] uscnt=%u", + NSCOMM_LOGERR ("nsfw_nshmem_ringenqueue enqueue fail] uscnt=%u", uscnt); } @@ -516,7 +516,7 @@ nsfw_nshmem_ring_statics (mring_handle handle) } /***************************************************************************** -* Prototype : nsfw_nshmem_stactic +* Prototype : nsfw_nshmem_static * Description : static the memory size according to mem type * Input : void* handle * nsfw_mem_struct_type type @@ -527,7 +527,7 @@ nsfw_nshmem_ring_statics (mring_handle handle) * *****************************************************************************/ ssize_t -nsfw_nshmem_stactic (void *handle, nsfw_mem_struct_type type) +nsfw_nshmem_static (void *handle, nsfw_mem_struct_type type) { switch (type) { diff --git a/src/framework/common/mem_mgr/nsfw_nshmem/nsfw_nshmem_mng.h b/src/framework/common/mem_mgr/nsfw_nshmem/nsfw_nshmem_mng.h index 3f5b1b9..06ab562 100644 --- a/src/framework/common/mem_mgr/nsfw_nshmem/nsfw_nshmem_mng.h +++ b/src/framework/common/mem_mgr/nsfw_nshmem/nsfw_nshmem_mng.h @@ -25,9 +25,9 @@ typedef struct { - i8 aname[NSFW_MEM_NAME_LENTH]; + i8 aname[NSFW_MEM_NAME_LENGTH]; void *addr; - int lenth; + int length; } nsfw_nshmem_mzone; typedef struct @@ -42,7 +42,7 @@ typedef struct i32 nsfw_nshmem_init (nsfw_mem_para * para); /* - * no share memory moudle destory + * no share memory module destory */ void nsfw_nshmem_destory (void); @@ -65,6 +65,6 @@ mring_handle nsfw_nshmem_ringcreate (nsfw_mem_mring * pringinfo); i32 nsfw_nshmem_ringrelease (nsfw_mem_name * pname); -ssize_t nsfw_nshmem_stactic (void *handle, nsfw_mem_struct_type type); +ssize_t nsfw_nshmem_static (void *handle, nsfw_mem_struct_type type); #endif diff --git a/src/framework/common/mem_mgr/nsfw_nshmem/nsfw_nshmem_ring.c b/src/framework/common/mem_mgr/nsfw_nshmem/nsfw_nshmem_ring.c index 780596c..7e56f3c 100644 --- a/src/framework/common/mem_mgr/nsfw_nshmem/nsfw_nshmem_ring.c +++ b/src/framework/common/mem_mgr/nsfw_nshmem/nsfw_nshmem_ring.c @@ -186,7 +186,7 @@ nsfw_nshmem_ring_mp_enqueue (struct nsfw_mem_ring *mem_ring, void *obj_table) common_mem_pause (); /* Set COMMON_RING_PAUSE_REP_COUNT to avoid spin too long waiting - * for other thread finish. It gives pre-empted thread a chance + * for other thread finish. It gives pre-emptied thread a chance * to proceed and finish with ring dequeue operation. */ /* check the queue can be operate */ if (++rep == 5) @@ -311,7 +311,7 @@ nsfw_nshmem_ring_mc_dequeuev (struct nsfw_mem_ring *r, void **obj_table, common_mem_pause (); /* Set COMMON_RING_PAUSE_REP_COUNT to avoid spin too long waiting - * for other thread finish. It gives pre-empted thread a chance + * for other thread finish. It gives pre-emptied thread a chance * to proceed and finish with ring dequeue operation. */ /* check the queue can be operate */ if (++rep == 5) @@ -327,7 +327,7 @@ nsfw_nshmem_ring_mc_dequeuev (struct nsfw_mem_ring *r, void **obj_table, } /*this is a multi thread/process dequeue function, please pay attention to the bellow point -1. while dequeue corrupt, the tail no one added, may multy the try times. +1. while dequeue corrupt, the tail no one added, may multi the try times. */ int nsfw_nshmem_ring_mc_dequeue (struct nsfw_mem_ring *ring, void **box) @@ -422,7 +422,7 @@ nsfw_nshmem_ring_singlethread_dequeuev (struct nsfw_mem_ring *ring, { tail = ring->cons.tail; - /* if all entries are dequed return 0 */ + /* if all entries are dequeued return 0 */ if (unlikely (ring->prod.head == ring->cons.tail)) { return num; |