From 82b5e45ebf316afd7daa97d9f9b7b75636fb4e64 Mon Sep 17 00:00:00 2001 From: Rahul Gupta Date: Tue, 26 Jun 2018 11:19:13 +0530 Subject: Spell correction Change-Id: Icc062e358398ecf0fc46b7a55ce1c37a71aee650 Signed-off-by: Rahul Gupta --- .../common/base/include/common/common_mem_buf.h | 2 +- .../base/include/common_pal_bitwide_adjust.h | 4 +- .../common/base/liblinuxapi/nsfw_base_linux_api.c | 14 ++--- src/framework/common/data_struct/eprb_tree.c | 10 +-- src/framework/common/data_struct/sha256.c | 2 +- .../common/mem_mgr/include/nsfw_mem_desc.h | 10 +-- .../common/mem_mgr/include/nsfw_ring_data.h | 6 +- .../common/mem_mgr/include/nsfw_ring_fun.h | 2 +- src/framework/common/mem_mgr/nsfw_mem_api.c | 48 +++++++-------- .../common/mem_mgr/nsfw_nshmem/nsfw_nshmem_mdesc.c | 2 +- .../common/mem_mgr/nsfw_nshmem/nsfw_nshmem_mng.c | 26 ++++---- .../common/mem_mgr/nsfw_nshmem/nsfw_nshmem_mng.h | 8 +-- .../common/mem_mgr/nsfw_nshmem/nsfw_nshmem_ring.c | 8 +-- .../common/mem_mgr/nsfw_shmem/nsfw_rshmem_mng.c | 38 ++++++------ .../common/mem_mgr/nsfw_shmem/nsfw_shmem_mdesc.c | 2 +- .../common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.c | 44 ++++++------- .../common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.h | 8 +-- .../common/mem_mgr/nsfw_shmem/nsfw_shmem_ring.c | 22 +++---- src/framework/include/nsfw_init.h | 8 +-- src/framework/include/nsfw_maintain_api.h | 6 +- src/framework/include/nsfw_mem_api.h | 72 +++++++++++----------- src/framework/include/nsfw_mgr_com_api.h | 6 +- src/framework/include/nsfw_recycle_api.h | 2 +- src/framework/include/nsfw_snapshot.h | 10 +-- src/framework/include/nsfw_upgrade.h | 4 +- src/framework/init/fw_init.c | 4 +- src/framework/init/fw_module.c | 8 +-- src/framework/init/fw_module.h | 8 +-- src/framework/ipc/mgr_com/mgr_com.c | 72 +++++++++++----------- src/framework/ipc/mgr_com/mgr_com.h | 4 +- src/framework/ipc/ps/nsfw_fd_timer.c | 4 +- src/framework/ipc/ps/nsfw_ps_mem_module.c | 22 +++---- src/framework/ipc/ps/nsfw_ps_module.c | 14 ++--- src/framework/ipc/ps/nsfw_recycle_module.c | 20 +++--- src/framework/lib_common_mem/common_buf.c | 6 +- src/framework/log/nsfw_set_log.c | 4 +- src/framework/log/nstack_log.c | 12 ++-- src/framework/snapshot/fw_snapshot.c | 8 +-- 38 files changed, 275 insertions(+), 275 deletions(-) (limited to 'src/framework') diff --git a/src/framework/common/base/include/common/common_mem_buf.h b/src/framework/common/base/include/common/common_mem_buf.h index d0d3588..441da6a 100644 --- a/src/framework/common/base/include/common/common_mem_buf.h +++ b/src/framework/common/base/include/common/common_mem_buf.h @@ -26,7 +26,7 @@ typedef enum __DMM_PROC_TYPE { DMM_PROC_T_AUTO = 0, /*auto detect */ DMM_PROC_T_PRIMARY = 1, /* set to primary */ - DMM_PROC_T_SECONDARY = 2, /* set to seconday */ + DMM_PROC_T_SECONDARY = 2, /* set to secondary */ DMM_PROC_T_INVALID } DMM_PROC_TYPE; diff --git a/src/framework/common/base/include/common_pal_bitwide_adjust.h b/src/framework/common/base/include/common_pal_bitwide_adjust.h index 96ae54e..0e68533 100644 --- a/src/framework/common/base/include/common_pal_bitwide_adjust.h +++ b/src/framework/common/base/include/common_pal_bitwide_adjust.h @@ -34,11 +34,11 @@ extern void **g_LMegAddrArry; /*get Local Seg addr by segIdx*/ #define HMEM_SEG_LVADDR(segid) (g_LMegAddrArry[segid]) -/*get SegIDX by PrimSegAddr, just get the arry Idx of g_PMemSegArry*/ +/*get SegIDX by PrimSegAddr, just get the array Idx of g_PMemSegArry*/ #define HMEM_SEGID(segaddr) ((struct common_mem_memseg*)segaddr - &(g_PMemSegArry[0])) /***************************************************************** -Parameters : LMegAddrArry[] Loacol common_mem_memseg addr Arry +Parameters : LMegAddrArry[] Local common_mem_memseg addr Array SegNum common_mem_memseg Num. Return : Description : init g_PrimAddr2LocalMap g_LocalAddr2PrimMap while the process start diff --git a/src/framework/common/base/liblinuxapi/nsfw_base_linux_api.c b/src/framework/common/base/liblinuxapi/nsfw_base_linux_api.c index de98877..4e59d68 100644 --- a/src/framework/common/base/liblinuxapi/nsfw_base_linux_api.c +++ b/src/framework/common/base/liblinuxapi/nsfw_base_linux_api.c @@ -50,7 +50,7 @@ typedef struct __base_linux_api #include "base_linux_api_declare.h" } base_linux_api; -nsfw_base_state g_nsfw_mudule_state = BASE_STATE_INIT; +nsfw_base_state g_nsfw_module_state = BASE_STATE_INIT; pthread_mutex_t g_nsfw_init_mutex = PTHREAD_MUTEX_INITIALIZER; base_linux_api g_nsfw_posix_api = { 0 }; @@ -84,30 +84,30 @@ nsfw_posix_api_init () int iret = NSFW_BASE_OK; /*if init already, just return success, if init fail before, just return err */ - if (BASE_STATE_INIT != g_nsfw_mudule_state) + if (BASE_STATE_INIT != g_nsfw_module_state) { return (BASE_STATE_SUCCESS == - g_nsfw_mudule_state ? NSFW_BASE_OK : NSFW_BASE_FAIL); + g_nsfw_module_state ? NSFW_BASE_OK : NSFW_BASE_FAIL); } (void) pthread_mutex_lock (&g_nsfw_init_mutex); /*if init already, just return success, if init fail before, just return err */ - if (BASE_STATE_INIT != g_nsfw_mudule_state) + if (BASE_STATE_INIT != g_nsfw_module_state) { (void) pthread_mutex_unlock (&g_nsfw_init_mutex); return (BASE_STATE_SUCCESS == - g_nsfw_mudule_state ? NSFW_BASE_OK : NSFW_BASE_FAIL); + g_nsfw_module_state ? NSFW_BASE_OK : NSFW_BASE_FAIL); } iret = nsfw_posix_symbol_load (); if (NSFW_BASE_OK == iret) { - g_nsfw_mudule_state = BASE_STATE_SUCCESS; + g_nsfw_module_state = BASE_STATE_SUCCESS; } else { - g_nsfw_mudule_state = BASE_STATE_FAIL; + g_nsfw_module_state = BASE_STATE_FAIL; } (void) pthread_mutex_unlock (&g_nsfw_init_mutex); diff --git a/src/framework/common/data_struct/eprb_tree.c b/src/framework/common/data_struct/eprb_tree.c index c8af17c..c8e616d 100644 --- a/src/framework/common/data_struct/eprb_tree.c +++ b/src/framework/common/data_struct/eprb_tree.c @@ -55,7 +55,7 @@ __ep_rb_rotate_left (struct ep_rb_node *X, struct ep_rb_root *root) **************************/ struct ep_rb_node *Y = (struct ep_rb_node *) ADDR_SHTOL (X->rb_right); - /* estblish X->Right link */ + /* establish X->Right link */ X->rb_right = Y->rb_left; if (Y->rb_left != NULL) @@ -64,7 +64,7 @@ __ep_rb_rotate_left (struct ep_rb_node *X, struct ep_rb_root *root) (struct ep_rb_node *) ADDR_LTOSH_EXT (X); } - /* estblish Y->Parent link */ + /* establish Y->Parent link */ Y->rb_parent = X->rb_parent; if (X->rb_parent) @@ -101,7 +101,7 @@ __ep_rb_rotate_right (struct ep_rb_node *X, struct ep_rb_root *root) ****************************/ struct ep_rb_node *Y = (struct ep_rb_node *) ADDR_SHTOL (X->rb_left); - /* estblish X->Left link */ + /* establish X->Left link */ X->rb_left = Y->rb_right; if (Y->rb_right != NULL) @@ -110,7 +110,7 @@ __ep_rb_rotate_right (struct ep_rb_node *X, struct ep_rb_root *root) (struct ep_rb_node *) ADDR_LTOSH_EXT (X); } - /* estblish Y->Parent link */ + /* establish Y->Parent link */ Y->rb_parent = X->rb_parent; if (X->rb_parent) @@ -190,7 +190,7 @@ ep_rb_insert_color (struct ep_rb_node *X, struct ep_rb_root *root) } else { - /* miror image of above code */ + /* mirror image of above code */ struct ep_rb_node *Y = (struct ep_rb_node *) ADDR_SHTOL (EP_RBTREE_GRANDF (X)->rb_left); diff --git a/src/framework/common/data_struct/sha256.c b/src/framework/common/data_struct/sha256.c index 213eb4e..f0773cf 100644 --- a/src/framework/common/data_struct/sha256.c +++ b/src/framework/common/data_struct/sha256.c @@ -270,7 +270,7 @@ SHA_fin1 (u8 hval[], SHA256_CTX ctx[1], const unsigned int hlen) { u32 i = (u32) (ctx->count[0] & SHA256_MASK); - /* Not unusal shift operation. Checked with purify. */ + /* Not unusual shift operation. Checked with purify. */ /*put bytes in the buffer in an order in which references to */ /*32-bit words will put bytes with lower addresses into the */ diff --git a/src/framework/common/mem_mgr/include/nsfw_mem_desc.h b/src/framework/common/mem_mgr/include/nsfw_mem_desc.h index 1e959d9..9a14c8d 100644 --- a/src/framework/common/mem_mgr/include/nsfw_mem_desc.h +++ b/src/framework/common/mem_mgr/include/nsfw_mem_desc.h @@ -30,10 +30,10 @@ #define NSFW_NAME_LENCHECK_RET(name, desc) \ { \ i32 inamelen = strlen(name); \ - if (inamelen >= NSFW_MEM_APPNAME_LENTH) \ + if (inamelen >= NSFW_MEM_APPNAME_LENGTH) \ { \ NSCOMM_LOGERR("name length check fail] desc=%s, name len=%d, expected max=%d", \ - #desc, inamelen, NSFW_MEM_APPNAME_LENTH); \ + #desc, inamelen, NSFW_MEM_APPNAME_LENGTH); \ return NSFW_MEM_ERR; \ } \ } @@ -41,10 +41,10 @@ #define NSFW_NAME_LENCHECK_RET_NULL(name, desc) \ { \ i32 inamelen = strlen(name); \ - if (inamelen >= NSFW_MEM_APPNAME_LENTH) \ + if (inamelen >= NSFW_MEM_APPNAME_LENGTH) \ { \ NSCOMM_LOGERR("name length check fail] desc=%s, name len=%d, expected max=%d", \ - #desc, inamelen, NSFW_MEM_APPNAME_LENTH); \ + #desc, inamelen, NSFW_MEM_APPNAME_LENGTH); \ return NULL; \ } \ } @@ -123,7 +123,7 @@ typedef struct { i32 (*mem_ops_init) (nsfw_mem_para * para); void (*mem_ops_destroy) (void); - mzone_handle (*mem_ops_zone_creae) (nsfw_mem_zone * pinfo); + mzone_handle (*mem_ops_zone_create) (nsfw_mem_zone * pinfo); i32 (*mem_ops_zone_createv) (nsfw_mem_zone * pmeminfo, i32 inum, mzone_handle * paddr_array, i32 iarray_num); mzone_handle (*mem_ops_zone_lookup) (nsfw_mem_name * pname); diff --git a/src/framework/common/mem_mgr/include/nsfw_ring_data.h b/src/framework/common/mem_mgr/include/nsfw_ring_data.h index 99ec0ed..e6007ab 100644 --- a/src/framework/common/mem_mgr/include/nsfw_ring_data.h +++ b/src/framework/common/mem_mgr/include/nsfw_ring_data.h @@ -65,7 +65,7 @@ struct nsfw_mem_ring u8 ringflag; //scmp, scsp, mcsp,mcmp u16 reserv; //reserv data u32 size; //size of the Ring, must 2^n - u32 eltsize; //for sppool, it is the size of per buf, if is ring, eltsize is zero. + u32 eltsize; //for s-pool, it is the size of per buf, if is ring, eltsize is zero. u32 mask; //mask of the Ring, used mask mod Head/Tail to get real pos, must 2^n-1 void *Addrbase; /*Cause the Addr we support just 40b(1024G), we using a basAddr+offset to get the real addr; ring[x].data_s.val just store offset; * not used when no shared mode @@ -78,13 +78,13 @@ struct nsfw_mem_ring struct { - volatile u32 head; //Head of the Ring, used to indicat pos where to pull a val + volatile u32 head; //Head of the Ring, used to indicate pos where to pull a val volatile u32 tail; //for nshmem, shmem not used. } prod; struct { volatile u32 head; //for nshmem, shmem not used. - volatile u32 tail; //Tail of the Ring, used to indicat pos where to push a val + volatile u32 tail; //Tail of the Ring, used to indicate pos where to push a val } cons; u32 uireserv[4]; //reserved for update union RingData_U ring[0]; //Value of Ring diff --git a/src/framework/common/mem_mgr/include/nsfw_ring_fun.h b/src/framework/common/mem_mgr/include/nsfw_ring_fun.h index 57a7bf3..d74cc4b 100644 --- a/src/framework/common/mem_mgr/include/nsfw_ring_fun.h +++ b/src/framework/common/mem_mgr/include/nsfw_ring_fun.h @@ -71,7 +71,7 @@ nsfw_mem_ring_init (struct nsfw_mem_ring *ring, unsigned int size, /* another way to init Pool while no continuous space -1. init a empt rte_perf_ring +1. init a empty rte_perf_ring 2. add element to PerRing. */ static inline void diff --git a/src/framework/common/mem_mgr/nsfw_mem_api.c b/src/framework/common/mem_mgr/nsfw_mem_api.c index b795921..c89ada1 100644 --- a/src/framework/common/mem_mgr/nsfw_mem_api.c +++ b/src/framework/common/mem_mgr/nsfw_mem_api.c @@ -34,7 +34,7 @@ /***************************************************************************** * Prototype : nsfw_mem_init * Description : memory mgr module init -* Input : point to nstak_fwmem_para +* Input : point to nstack_fwmem_para * Output : None * Return Value : i32 * Calls : @@ -88,7 +88,7 @@ nsfw_mem_init (void *para) } } - /*if some module init fail, destory the moudles that success */ + /*if some module init fail, destory the modules that success */ if (icount < g_mem_type_num) { for (iindex = 0; iindex < icount; iindex++) @@ -111,7 +111,7 @@ nsfw_mem_init (void *para) * Description : create a block memory with name * nsfw_mem_zone::stname * nsfw_mem_zone::isize -* note : 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. +* note : 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. * Input : nsfw_mem_zone* pinfo * Output : None * Return Value : mzone_handle @@ -130,16 +130,16 @@ nsfw_mem_zone_create (nsfw_mem_zone * pinfo) return NULL; } - MEM_OP_CALL_OK_RET (pinfo->stname.entype, mem_ops_zone_creae, (pinfo)); + MEM_OP_CALL_OK_RET (pinfo->stname.entype, mem_ops_zone_create, (pinfo)); NSCOMM_LOGINF ("mem create fail] memtype=%d, name=%s, size=%zu", - pinfo->stname.entype, pinfo->stname.aname, pinfo->lenth); + pinfo->stname.entype, pinfo->stname.aname, pinfo->length); return NULL; } /***************************************************************************** * Prototype : nsfw_mem_zone_createv * Description : create some memory blocks -* note : 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. +* note : 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. * Input : nsfw_mem_zone* pmeminfo * i32 inum * mzone_handle* paddr_array @@ -174,7 +174,7 @@ nsfw_mem_zone_createv (nsfw_mem_zone * pmeminfo, i32 inum, /***************************************************************************** * Prototype : nsfw_mem_zone_lookup * Description : look up a memory -* 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. +* 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. * 2. if the memory is shared, pname->enowner indicate that who create this memory. * note : 1. when calling any shared memory create inferface, the name of memory end with _0 created by nStackMain, * end with none created by nStackMaster, and end with _ created by other. @@ -252,7 +252,7 @@ nsfw_mem_mbfmp_create (nsfw_mem_mbfpool * pbufinfo) /***************************************************************************** * Prototype : nsfw_mem_mbfmp_createv * Description : create some mbuf pools -* 1. the name of lenth must be less than NSFW_MEM_APPNAME_LENTH. +* 1. the name of length must be less than NSFW_MEM_APPNAME_LENGTH. * Input : nsfw_mem_mbfpool* pmbfname * i32 inum * mpool_handle* phandle_array @@ -328,7 +328,7 @@ nsfw_mem_mbf_free (mbuf_handle mhandle, nsfw_mem_type entype) /***************************************************************************** * Prototype : nsfw_mem_mbfmp_lookup * Description : look up mbuf mpool -* 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. +* 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. * 2. if the memory is shared, pname->enowner indicate that who create this memory. * note : 1. when calling any shared memory create inferface, the name of memory end with _0 created by nStackMain, * end with none created by nStackMaster, and end with _ created by other. @@ -358,7 +358,7 @@ nsfw_mem_mbfmp_lookup (nsfw_mem_name * pmbfname) /***************************************************************************** * Prototype : nsfw_mem_mbfmp_release * Description : release mbuf pool -* note : 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. +* note : 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. * Input : nsfw_mem_name* pname * Output : None * Return Value : i32 @@ -379,7 +379,7 @@ nsfw_mem_mbfmp_release (nsfw_mem_name * pname) /***************************************************************************** * Prototype : nsfw_mem_sp_create * Description : create a simple pool -* note : 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. +* note : 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. * Input : nsfw_mem_sppool* pmpinfo * Output : None * Return Value : mring_handle @@ -407,7 +407,7 @@ nsfw_mem_sp_create (nsfw_mem_sppool * pmpinfo) /***************************************************************************** * Prototype : nsfw_mem_sp_createv * Description : create some simple pools one time -* note : 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. +* note : 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. * Input : nsfw_mem_sppool* pmpinfo * i32 inum * mring_handle* pringhandle_array @@ -433,7 +433,7 @@ nsfw_mem_sp_createv (nsfw_mem_sppool * pmpinfo, i32 inum, /***************************************************************************** * Prototype : nsfw_mem_sp_ring_create * Description : create a simple pool with many rings -* note : 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. +* note : 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. * Input : nsfw_mem_mring* pringinfo * mring_handle* pringhandle_array * i32 iringnum @@ -459,7 +459,7 @@ nsfw_mem_sp_ring_create (nsfw_mem_mring * pringinfo, /***************************************************************************** * Prototype : nsfw_mem_sp_release * Description : release a simple mempool -* note : 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. +* note : 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. * Input : nsfw_mem_name* pname * Output : None * Return Value : i32 @@ -479,7 +479,7 @@ nsfw_mem_sp_release (nsfw_mem_name * pname) /***************************************************************************** * Prototype : nsfw_mem_sp_lookup * Description : look up a simpile ring -* 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. +* 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. * 2. if the memory is shared, pname->enowner indicate that who create this memory. * note : 1. when calling any shared memory create inferface, the name of memory end with _0 created by nStackMain, * end with none created by nStackMaster, and end with _ created by other. @@ -510,8 +510,8 @@ nsfw_mem_sp_lookup (nsfw_mem_name * pname) /***************************************************************************** * Prototype : nsfw_mem_ring_create * Description : create a ring -* note : 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. -* 2. shared memory ring (NSFW_SHMEM) just can put a pointor into the queue, the queue also point to a shared block memory. +* note : 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. +* 2. shared memory ring (NSFW_SHMEM) just can put a pointer into the queue, the queue also point to a shared block memory. * no shared memory ring(NSFW_NSHMEM) is other wise. * Input : nsfw_mem_mring* pringinfo * Output : None @@ -541,7 +541,7 @@ nsfw_mem_ring_create (nsfw_mem_mring * pringinfo) /***************************************************************************** * Prototype : nsfw_mem_ring_lookup * Description : look up a ring by name -* 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. +* 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. * 2. if the memory is shared, pname->enowner indicate that who create this memory. * note: * 1. when calling any shared memory create inferface, the name of memory end with _0 created by nStackMain, @@ -730,7 +730,7 @@ nsfw_mem_mbfpool_free_count (mpool_handle mhandle) /***************************************************************************** * Prototype : nsfw_mem_ring_release * Description : release a ring memory -* notes : the lenth of name must be less than NSFW_MEM_APPNAME_LENTH +* notes : the length of name must be less than NSFW_MEM_APPNAME_LENGTH * Input : nsfw_mem_name* pname * Output : None * Return Value : i32 @@ -752,7 +752,7 @@ nsfw_mem_ring_release (nsfw_mem_name * pname) * Prototype : nsfw_mem_get_len * Description : statics mbufpool, sppool, ring mem size. * return: <=0, err happen, >0 mem size -* NSFW_MEM_MZONE: not surport because you already know the lenth when create +* NSFW_MEM_MZONE: not surport because you already know the length when create * Input : void * handle * nsfw_mem_struct_type type * Output : None @@ -853,25 +853,25 @@ nsfw_mem_mbuf_iterator (mpool_handle handle, u32 start, u32 end, * Description : print ring info * Input : mring_handle mhandle * Output : None -* Return Value : if no err happen, return the lenth of string print, 0 or -1 maybe err happen +* Return Value : if no err happen, return the length of string print, 0 or -1 maybe err happen * Calls : * Called By : *****************************************************************************/ i32 -nsfw_mem_dfx_ring_print (mring_handle mhandle, char *pbuf, int lenth) +nsfw_mem_dfx_ring_print (mring_handle mhandle, char *pbuf, int length) { struct nsfw_mem_ring *temp = (struct nsfw_mem_ring *) mhandle; u32 head = 0; u32 tail = 0; int ret = 0; - if ((!temp) || (!pbuf) || (lenth <= 0)) + if ((!temp) || (!pbuf) || (length <= 0)) { return 0; } head = temp->prod.head; tail = temp->cons.tail; ret = - SPRINTF_S (pbuf, lenth, + SPRINTF_S (pbuf, length, "[.Head=%u,\n .Tail=%u,\n .(|Tail-Head|)=%u,\n .size=%u,\n .mask=%u]\n", head, tail, (tail >= head) ? (tail - head) : (head - tail), temp->size, temp->mask); 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; diff --git a/src/framework/common/mem_mgr/nsfw_shmem/nsfw_rshmem_mng.c b/src/framework/common/mem_mgr/nsfw_shmem/nsfw_rshmem_mng.c index dc3400d..c29b108 100644 --- a/src/framework/common/mem_mgr/nsfw_shmem/nsfw_rshmem_mng.c +++ b/src/framework/common/mem_mgr/nsfw_shmem/nsfw_rshmem_mng.c @@ -53,16 +53,16 @@ } /*init the msg head*/ -#define NSFW_SHMEM_MSG_HEAD_INIT(pmsg, type, lenth) { \ +#define NSFW_SHMEM_MSG_HEAD_INIT(pmsg, type, length) { \ (pmsg)->usmsg_type = (type); \ - (pmsg)->uslenth = (lenth); \ + (pmsg)->uslength = (length); \ } /*rsp msg head check, and if err goto*/ -#define NSFW_SHMEM_MSGHEAD_CHK_GOTO(pmsg, type, lenth, gotoflag) { \ - if (((type) != pmsg->usmsg_type) && ((lenth) != pmsg->uslenth)) \ +#define NSFW_SHMEM_MSGHEAD_CHK_GOTO(pmsg, type, length, gotoflag) { \ + if (((type) != pmsg->usmsg_type) && ((length) != pmsg->uslength)) \ { \ - NSCOMM_LOGERR("check fail] msgtype=%d, type_para=%d, len=%d", (pmsg->usmsg_type), (type), (lenth)); \ + NSCOMM_LOGERR("check fail] msgtype=%d, type_para=%d, len=%d", (pmsg->usmsg_type), (type), (length)); \ goto gotoflag; \ } \ } @@ -77,9 +77,9 @@ } /*mzone msg init*/ -#define NSFW_SHMEM_MZONE_DATA_INIT(pdata, slenth, seg, socketid) { \ +#define NSFW_SHMEM_MZONE_DATA_INIT(pdata, slength, seg, socketid) { \ (pdata)->isocket_id = (socketid); \ - (pdata)->lenth = (slenth); \ + (pdata)->length = (slength); \ (pdata)->usseq = (seg); \ (pdata)->ireserv = 0; \ } @@ -201,7 +201,7 @@ release: } /* - *create some memorys by send a msg + *create some memories by send a msg */ i32 nsfw_memzone_remote_reserv_v (nsfw_mem_zone * pmeminfo, @@ -255,9 +255,9 @@ nsfw_memzone_remote_reserv_v (nsfw_mem_zone * pmeminfo, pmeminfo[itindex].stname.aname, pid); if (-1 == retVal) { - NSCOMM_LOGERR ("SPRINTF_S faild]ret=%d", retVal); + NSCOMM_LOGERR ("SPRINTF_S failed]ret=%d", retVal); } - NSFW_SHMEM_MZONE_DATA_INIT (ptempdata, pmeminfo[itindex].lenth, + NSFW_SHMEM_MZONE_DATA_INIT (ptempdata, pmeminfo[itindex].length, (u16) itindex, pmeminfo[itindex].isocket_id); @@ -302,9 +302,9 @@ nsfw_memzone_remote_reserv_v (nsfw_mem_zone * pmeminfo, pmeminfo[itindex].stname.aname, pid); if (-1 == retVal) { - NSCOMM_LOGERR ("SPRINTF_S faild]ret=%d", retVal); + NSCOMM_LOGERR ("SPRINTF_S failed]ret=%d", retVal); } - NSFW_SHMEM_MZONE_DATA_INIT (ptempdata, pmeminfo[itindex].lenth, + NSFW_SHMEM_MZONE_DATA_INIT (ptempdata, pmeminfo[itindex].length, (u16) itindex, pmeminfo[itindex].isocket_id); ptempdata++; @@ -526,7 +526,7 @@ nsfw_remote_shmem_mbf_createv (nsfw_mem_mbfpool * pmbfname, goto lerr; } - /*interrup msg head */ + /*interrupt msg head */ pack_head = GET_USER_MSG (nsfw_shmem_msg_head, prsp_msg); NSFW_SHMEM_MSGHEAD_CHK_GOTO (pack_head, NSFW_MBUF_ACK_MSG, ieltnum * sizeof (nsfw_shmem_ack), @@ -737,7 +737,7 @@ nsfw_remote_shmem_mpcreatev (nsfw_mem_sppool * pmpinfo, goto mperr; } - /*interrup mgs head */ + /*interrupt mgs head */ pack_head = GET_USER_MSG (nsfw_shmem_msg_head, prsp_msg); NSFW_SHMEM_MSGHEAD_CHK_GOTO (pack_head, NSFW_SPPOOL_ACK_MSG, ieltnum * sizeof (nsfw_shmem_ack), @@ -851,7 +851,7 @@ nsfw_remote_shmem_ringcreate (const char *name, unsigned int n, i32 socket_id, goto release; } - /*interrup mgs head */ + /*interrupt mgs head */ pack_head = GET_USER_MSG (nsfw_shmem_msg_head, prsp_msg); NSFW_SHMEM_MSGHEAD_CHK_GOTO (pack_head, NSFW_RING_ACK_MSG, sizeof (nsfw_shmem_ack), release); @@ -871,8 +871,8 @@ release: /* *create a mem pool that the members are rings by send a msg *ieltnum:the num of ring member - *iringnum:the num of ring in simple mem pook - *entype:the defualt the of ring + *iringnum:the num of ring in simple mem pool + *entype:the default the of ring */ i32 nsfw_remote_shmem_ringcreatev (const char *name, i32 ieltnum, @@ -951,7 +951,7 @@ nsfw_remote_shmem_lookup (const i8 * name, nsfw_mem_struct_type entype) pdata = NSFW_SHMEM_GET_DATA (pdata_head, nsfw_shmem_lookup_req); if (EOK != STRCPY_S (pdata->aname, sizeof (pdata->aname), name)) { - NSCOMM_LOGERR ("STRCPY_S faild]name=%s", name); + NSCOMM_LOGERR ("STRCPY_S failed]name=%s", name); } pdata->usseq = 0; pdata->ustype = entype; @@ -965,7 +965,7 @@ nsfw_remote_shmem_lookup (const i8 * name, nsfw_mem_struct_type entype) goto release; } - /*interrup mgs head */ + /*interrupt mgs head */ pack_head = GET_USER_MSG (nsfw_shmem_msg_head, prsp_msg); NSFW_SHMEM_MSGHEAD_CHK_GOTO (pack_head, NSFW_MEM_LOOKUP_ACK_MSG, sizeof (nsfw_shmem_ack), perr); diff --git a/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mdesc.c b/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mdesc.c index e7a11ad..2e9c969 100644 --- a/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mdesc.c +++ b/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mdesc.c @@ -40,7 +40,7 @@ nsfw_mem_ops g_shmem_ops = { nsfw_shmem_ringcreate, nsfw_shmem_ring_lookup, nsfw_shmem_ringrelease, - nsfw_shmem_stactic, + nsfw_shmem_static, nsfw_shmem_mbuf_recycle, nsfw_shmem_sp_iterator, nsfw_shmem_mbuf_iterator diff --git a/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.c b/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.c index f85e70d..270e0f8 100644 --- a/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.c +++ b/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.c @@ -155,23 +155,23 @@ nsfw_shmem_create (nsfw_mem_zone * pinfo) NSFW_INIT_CHK_RET_NULL ()if (NSFW_PROC_MAIN == NSFW_SHMEM_FLAG) { return common_memzone_data_reserve_name (pinfo->stname.aname, - pinfo->lenth, + pinfo->length, pinfo->isocket_id); } else { - /*app must less than NSFW_MEM_APPNAME_LENTH */ + /*app must less than NSFW_MEM_APPNAME_LENGTH */ NSFW_NAME_LENCHECK_RET_NULL (pinfo->stname.aname, "shmem create") if (-1 == SPRINTF_S (aname, COMMON_MEM_MEMPOOL_NAMESIZE, "%s_%x", pinfo->stname.aname, NSFW_SHMEM_PID)) { - NSCOMM_LOGERR ("SPRINTF_S faild]"); + NSCOMM_LOGERR ("SPRINTF_S failed]"); return NULL; } } - return nsfw_memzone_remote_reserv ((char *) &aname[0], pinfo->lenth, + return nsfw_memzone_remote_reserv ((char *) &aname[0], pinfo->length, SOCKET_ID_ANY); } @@ -220,20 +220,20 @@ nsfw_shmem_lookup (nsfw_mem_name * pname) SPRINTF_S (aname, COMMON_MEM_MEMPOOL_NAMESIZE, "%s", pname->aname); if (-1 == retVal) { - NSCOMM_LOGERR ("SPRINTF_S faild"); + NSCOMM_LOGERR ("SPRINTF_S failed"); return NULL; } } else { - /*app must less than NSFW_MEM_APPNAME_LENTH */ + /*app must less than NSFW_MEM_APPNAME_LENGTH */ NSFW_NAME_LENCHECK_RET_NULL (pname->aname, "shmem lookup") int retVal = SPRINTF_S (aname, COMMON_MEM_MEMPOOL_NAMESIZE, "%s_%x", pname->aname, NSFW_SHMEM_PID); if (-1 == retVal) { - NSCOMM_LOGERR ("SPRINTF_S faild"); + NSCOMM_LOGERR ("SPRINTF_S failed"); return NULL; } } @@ -265,7 +265,7 @@ nsfw_shmem_release (nsfw_mem_name * pname) SPRINTF_S (aname, COMMON_MEM_MEMPOOL_NAMESIZE, "%s_%x", pname->aname, NSFW_SHMEM_PID)) { - NSCOMM_LOGERR ("SPRINTF_S faild"); + NSCOMM_LOGERR ("SPRINTF_S failed"); return NSFW_MEM_ERR; } } @@ -291,13 +291,13 @@ nsfw_shmem_mbfmpcreate (nsfw_mem_mbfpool * pbufinfo) } else { - /*app must less than NSFW_MEM_APPNAME_LENTH */ + /*app must less than NSFW_MEM_APPNAME_LENGTH */ NSFW_NAME_LENCHECK_RET_NULL (pbufinfo->stname.aname, "mbufpool create") if (-1 == SPRINTF_S (aname, COMMON_MEM_MEMPOOL_NAMESIZE, "%s_%x", pbufinfo->stname.aname, NSFW_SHMEM_PID)) { - NSCOMM_LOGERR ("SPRINTF_S faild]"); + NSCOMM_LOGERR ("SPRINTF_S failed]"); } } @@ -374,18 +374,18 @@ nsfw_shmem_mbfmplookup (nsfw_mem_name * pmbfname) SPRINTF_S (aname, COMMON_MEM_MEMPOOL_NAMESIZE, "%s", pmbfname->aname)) { - NSCOMM_LOGERR ("SPRINTF_S faild]"); + NSCOMM_LOGERR ("SPRINTF_S failed]"); } } else { - /*app must less than NSFW_MEM_APPNAME_LENTH */ + /*app must less than NSFW_MEM_APPNAME_LENGTH */ NSFW_NAME_LENCHECK_RET_NULL (pmbfname->aname, "shmem lookup") if (-1 == SPRINTF_S (aname, COMMON_MEM_MEMPOOL_NAMESIZE, "%s_%x", pmbfname->aname, NSFW_SHMEM_PID)) { - NSCOMM_LOGERR ("SPRINTF_S faild]"); + NSCOMM_LOGERR ("SPRINTF_S failed]"); } } @@ -412,7 +412,7 @@ nsfw_shmem_spcreate (nsfw_mem_sppool * pmpinfo) SPRINTF_S (aname, COMMON_MEM_MEMPOOL_NAMESIZE, "%s_%x", pmpinfo->stname.aname, NSFW_SHMEM_PID)) { - NSCOMM_LOGERR ("SPRINTF_S faild]"); + NSCOMM_LOGERR ("SPRINTF_S failed]"); } } @@ -512,7 +512,7 @@ nswf_shmem_sp_ringcreate (nsfw_mem_mring * prpoolinfo, prpoolinfo->stname.aname, NSFW_SHMEM_PID); if (-1 == retVal) { - NSCOMM_LOGERR ("SPRINTF_S faild]"); + NSCOMM_LOGERR ("SPRINTF_S failed]"); } } @@ -549,7 +549,7 @@ nsfw_shmem_sprelease (nsfw_mem_name * pname) SPRINTF_S (aname, COMMON_MEM_MEMPOOL_NAMESIZE, "%s_%x", pname->aname, NSFW_SHMEM_PID)) { - NSCOMM_LOGERR ("SPRINTF_S faild]"); + NSCOMM_LOGERR ("SPRINTF_S failed]"); } } @@ -584,18 +584,18 @@ nsfw_shmem_sp_lookup (nsfw_mem_name * pname) if (-1 == SPRINTF_S (aname, COMMON_MEM_MEMPOOL_NAMESIZE, "%s", pname->aname)) { - NSCOMM_LOGERR ("SPRINTF_S faild]"); + NSCOMM_LOGERR ("SPRINTF_S fails]"); } } else { - /*app's name can not over NSFW_MEM_APPNAME_LENTH */ + /*app's name can not over NSFW_MEM_APPNAME_LENGTH */ NSFW_NAME_LENCHECK_RET_NULL (pname->aname, "shmem lookup") if (-1 == SPRINTF_S (aname, COMMON_MEM_MEMPOOL_NAMESIZE, "%s_%x", pname->aname, NSFW_SHMEM_PID)) { - NSCOMM_LOGERR ("SPRINTF_S faild]"); + NSCOMM_LOGERR ("SPRINTF_S failed]"); } } @@ -622,7 +622,7 @@ nsfw_shmem_ringcreate (nsfw_mem_mring * pringinfo) SPRINTF_S (aname, COMMON_MEM_MEMPOOL_NAMESIZE, "%s_%x", pringinfo->stname.aname, NSFW_SHMEM_PID)) { - NSCOMM_LOGERR ("SPRINTF_S faild]"); + NSCOMM_LOGERR ("SPRINTF_S failed]"); } } @@ -680,7 +680,7 @@ nsfw_shmem_ring_statics (mring_handle handle) } ssize_t -nsfw_shmem_stactic (void *handle, nsfw_mem_struct_type type) +nsfw_shmem_static (void *handle, nsfw_mem_struct_type type) { switch (type) { @@ -737,7 +737,7 @@ nsfw_shmem_mbuf_recycle (mpool_handle handle) 1.if proc.head != proc.tail set proc.head to proc.tail [may lost some buf,but the queue still can use] App May not putIn Data , just done head++, we can't set proc.tail to proc.head. 2.if cons.head != cons.tail set cons.tail to cons.head [may lost some buf,but the queue still can use] - App May alread finish deque,just not tail++, we can't set cons.head to cons.tail. + App May already finish deque,just not tail++, we can't set cons.head to cons.tail. */ if ((rteRing->prod.head != rteRing->prod.tail) || (rteRing->cons.head != rteRing->cons.tail)) diff --git a/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.h b/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.h index f81b34a..d489525 100644 --- a/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.h +++ b/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_mng.h @@ -19,7 +19,7 @@ /* * mem mgr module init - * para:point to nstak_fwmem_para + * para:point to nstack_fwmem_para */ i32 nsfw_shmem_init (nsfw_mem_para * para); @@ -37,7 +37,7 @@ void nsfw_shmem_destroy (void); mzone_handle nsfw_shmem_create (nsfw_mem_zone * pinfo); /* - *create some blocks memeory + *create some blocks memory */ i32 nsfw_shmem_createv (nsfw_mem_zone * pmeminfo, i32 inum, mzone_handle * paddr_array, i32 iarray_num); @@ -72,7 +72,7 @@ mbuf_handle nsfw_shmem_mbfalloc (mpool_handle mhandle); i32 nsfw_shmem_mbffree (mbuf_handle mhandle); /* - *put mbuf backto mbuf pool + *put mbuf back to mbuf pool */ i32 nsfw_shmem_mbfmprelease (nsfw_mem_name * pname); @@ -121,7 +121,7 @@ mring_handle nsfw_shmem_ring_lookup (nsfw_mem_name * pname); */ i32 nsfw_shmem_ringrelease (nsfw_mem_name * pname); -ssize_t nsfw_shmem_stactic (void *handle, nsfw_mem_struct_type type); +ssize_t nsfw_shmem_static (void *handle, nsfw_mem_struct_type type); i32 nsfw_shmem_mbuf_recycle (mpool_handle handle); diff --git a/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_ring.c b/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_ring.c index af46e18..c42c840 100644 --- a/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_ring.c +++ b/src/framework/common/mem_mgr/nsfw_shmem/nsfw_shmem_ring.c @@ -119,7 +119,7 @@ nsfw_shmem_pool_create (const char *name, unsigned int n, unsigned int num = common_mem_align32pow2 (n + 1); struct nsfw_shmem_ring_head *pcur = NULL; - /*calculat the empty rte_perf_ring Size */ + /*calculate the empty rte_perf_ring Size */ size_t len = sizeof (struct nsfw_shmem_ring_head) + sizeof (struct nsfw_mem_ring) + (size_t) num * sizeof (union RingData_U) + (size_t) num * elt_size; @@ -258,7 +258,7 @@ nsfw_shmem_pool_create (const char *name, unsigned int n, break; } - // second time allocate should not containd all ring head + // second time allocate should not contained all ring head alloc_len = (size_t) (num - alloc_index) * elt_size + sizeof (struct nsfw_shmem_ring_head); @@ -341,7 +341,7 @@ nsfw_shmem_ring_mp_enqueue (struct nsfw_mem_ring *ring, void *box) if (tmpTail + size - CurHead == 0) { /* - here we give enque a chance to recorrect the Tail, if tail not has Data let tail++ + here we give enqueue a chance to recorrect the Tail, if tail not has Data let tail++ */ if (ring->ring[tmpTail & mask].data_s.val == 0) { @@ -374,10 +374,10 @@ nsfw_shmem_ring_mp_enqueue (struct nsfw_mem_ring *ring, void *box) { /* enqueue success, add Head Value now - here we using CAS set instead __sync_fetch_and_add(&ring->Head, 1) to assume that, if one process enque sucess && been killed before + here we using CAS set instead __sync_fetch_and_add(&ring->Head, 1) to assume that, if one process enqueue success && been killed before add Head, other process can recorrect the Head Value; one more thing the direction of Tail must been add-direction, so we using the condition (ring->Head - CurHead >0x80000000); - while many thread do enque at same time, Head may not correct,exp: + while many thread do enqueue at same time, Head may not correct,exp: thread A get old head 10, thread A want set head to 11 thread B get old head 10, thread B want set head to 12 thread A do CAS && thread B do CAS at same time, thread A do CAS success; @@ -385,7 +385,7 @@ nsfw_shmem_ring_mp_enqueue (struct nsfw_mem_ring *ring, void *box) then thread C get old head 11, thread C will set head to 13[cause pos 12 already has value, thread C will skill 12], the head will be recorrect by thread C. - if no thread C, thread A& B are the last enque thread; the head must recorrect by the deque function. + if no thread C, thread A& B are the last enqueue thread; the head must recorrect by the deque function. */ tmpHead = ring->prod.head; @@ -441,7 +441,7 @@ nsfw_shmem_ring_sp_enqueue (struct nsfw_mem_ring *ring, void *box) if (tmpTail + uisize - CurHead == 0) { /* - *here we give enque a chance to recorrect the Tail, if tail not has Data let tail++ + *here we give enqueue a chance to recorrect the Tail, if tail not has Data let tail++ */ if (ring->ring[tmpTail & mask].data_s.val == 0) { @@ -523,7 +523,7 @@ nsfw_shmem_ring_mc_dequeue (struct nsfw_mem_ring *ring, void **box) /* enqueue success, add Tail Value now - here we using CAS set instead __sync_fetch_and_add(&ring->Tail, 1) to assume that, if one process dequeue sucess && been killed before + here we using CAS set instead __sync_fetch_and_add(&ring->Tail, 1) to assume that, if one process dequeue success && been killed before add Tail, other process can recorrect the Tail Value; one more thing the direction of Tail must been add-direction, so we using the condition (rlTail - CurTail >0x80000000); while multi CAS done the result value of CurTail may not correct, but we don't care, it will be recorrect while next deque done. @@ -611,7 +611,7 @@ nsfw_shmem_ring_mc_dequeuev (struct nsfw_mem_ring *ring, void **box, /* enqueue success, add Tail Value now - here we using CAS set instead __sync_fetch_and_add(&ring->Tail, 1) to assume that, if one process dequeue sucess && been killed before + here we using CAS set instead __sync_fetch_and_add(&ring->Tail, 1) to assume that, if one process dequeue success && been killed before add Tail, other process can recorrect the Tail Value; one more thing the direction of Tail must been add-direction, so we using the condition (rlTail - CurTail >0x80000000); @@ -790,7 +790,7 @@ nsfw_shmem_ring_singlethread_dequeue (struct nsfw_mem_ring *ring, void **box) { u32 tail = 0; - /* if all entries are dequed return 0 */ + /* if all entries are dequeued return 0 */ if (unlikely (ring->prod.head == ring->cons.tail)) { return 0; @@ -818,7 +818,7 @@ nsfw_shmem_ring_singlethread_dequeuev (struct nsfw_mem_ring *ring, void **box, { 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; diff --git a/src/framework/include/nsfw_init.h b/src/framework/include/nsfw_init.h index def97b2..0237060 100644 --- a/src/framework/include/nsfw_init.h +++ b/src/framework/include/nsfw_init.h @@ -33,7 +33,7 @@ extern "C"{ #define NSFW_SET_INSTANCE_VALUE(_attr, _inst, _value) \ nsfw_module_set_instance_##_attr(_inst, _value) -#define NSFW_INIT_CRAETE_LOCAL_INSTANCE() \ +#define NSFW_INIT_CREATE_LOCAL_INSTANCE() \ if (!nsfwLocalInitInst) {\ nsfwLocalInitInst = nsfw_module_create_instance(); \ nsfw_module_add_instance(nsfwLocalInitInst);\ @@ -41,7 +41,7 @@ extern "C"{ #define _NSFW_MODULE_ATTRIBUTE_DEFINE_SURFIX(_attr, _value, _priority, _surfix) \ static __attribute__((__constructor__(_priority))) void nsfw_module_attribute_##_attr##_surfix(void){\ - NSFW_INIT_CRAETE_LOCAL_INSTANCE(); \ + NSFW_INIT_CREATE_LOCAL_INSTANCE(); \ NSFW_SET_INSTANCE_VALUE(_attr, nsfwLocalInitInst, _value);\ } \ @@ -123,8 +123,8 @@ extern void nsfw_module_set_instance_depends (nsfw_module_instance_t * inst, /** * @Function nstack_framework_init - * @Description This function will do framework initial work, it will involk all initial functions - * registed using macro NSFW_MODULE_INIT before + * @Description This function will do framework initial work, it will invoke all initial functions + * registered using macro NSFW_MODULE_INIT before * @param none * @return 0 on success, -1 on error */ diff --git a/src/framework/include/nsfw_maintain_api.h b/src/framework/include/nsfw_maintain_api.h index 74cedf6..bf0d45e 100644 --- a/src/framework/include/nsfw_maintain_api.h +++ b/src/framework/include/nsfw_maintain_api.h @@ -72,8 +72,8 @@ typedef int (*nsfw_res_free_fun) (void *pdata); typedef struct _nsfw_res_scn_cfg { u8 type; /*nsfw_res_scan_type */ - u8 force_free_percent; /*if the resource free percent below this vlaue, begin to force free the element */ - u16 force_free_chk_num; /*if the check count beyone this vlaue, call free fun release this element */ + u8 force_free_percent; /*if the resource free percent below this value, begin to force free the element */ + u16 force_free_chk_num; /*if the check count beyone this value, call free fun release this element */ u16 alloc_speed_factor; /*alloc fast with higher value */ u32 num_per_cyc; /*define the element number in one scan cycle process and increase chk_count of every element */ @@ -174,7 +174,7 @@ typedef struct _nsfw_set_log_msg #define SPL_DFX_RES_CONN "conn" #define SPL_DFX_RES_L2TO4 "l2to4" #define SPL_DFX_RES_UNMATCH "version" -#define SPL_DFX_RES_SOCKT_CB "socketcb" +#define SPL_DFX_RES_SOCKET_CB "socketcb" #define SPL_DFX_RES_COMM_MEMPOOL "mbufpool" #define SPL_DFX_RES_PCBLIST "pcblist" #define SPL_DFX_RES_ARPLIST "arplist" diff --git a/src/framework/include/nsfw_mem_api.h b/src/framework/include/nsfw_mem_api.h index ec78692..68adbe1 100644 --- a/src/framework/include/nsfw_mem_api.h +++ b/src/framework/include/nsfw_mem_api.h @@ -28,8 +28,8 @@ /* *the max len of memory name is 32bytes, but app just can use max 22bytes, left 10bytes to memory manager module */ -#define NSFW_MEM_NAME_LENTH (32) -#define NSFW_MEM_APPNAME_LENTH (22) +#define NSFW_MEM_NAME_LENGTH (32) +#define NSFW_MEM_APPNAME_LENGTH (22) #define NSFW_SOCKET_ANY (-1) #define NSFW_MEM_OK (0) @@ -50,9 +50,9 @@ typedef enum /*type of ring operation*/ typedef enum { - NSFW_MRING_SPSC, /*sigle producer sigle consumer ring */ - NSFW_MRING_MPSC, /*multi producer sigle consumer ring */ - NSFW_MRING_SPMC, /*sigle producer multi consumer ring */ + NSFW_MRING_SPSC, /*single producer single consumer ring */ + NSFW_MRING_MPSC, /*multi producer single consumer ring */ + NSFW_MRING_SPMC, /*single producer multi consumer ring */ NSFW_MRING_MPMC, /*multi producer multi consumer ring */ NSFW_MRING_SPSC_ST, /*single producer single consumer and belong to one thread ring */ NSFW_MPOOL_TYPEMAX, @@ -83,13 +83,13 @@ typedef struct * must add '_0' at the end of name, if the memory was created by app and the role of process is NSFW_PROC_MASTER, must add * _(pid) at the end of name, nstack_123. */ - i8 aname[NSFW_MEM_NAME_LENTH]; /*the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. */ + i8 aname[NSFW_MEM_NAME_LENGTH]; /*the length of name must be less than NSFW_MEM_APPNAME_LENGTH. */ } nsfw_mem_name; typedef struct { nsfw_mem_name stname; - size_t lenth; + size_t length; i32 isocket_id; i32 ireserv; } nsfw_mem_zone; @@ -156,7 +156,7 @@ typedef enum typedef struct __nsfw_shmem_msg_head { unsigned usmsg_type; - unsigned uslenth; + unsigned uslength; i32 aidata[0]; } nsfw_shmem_msg_head; @@ -171,17 +171,17 @@ typedef struct __nsfw_shmem_ack typedef struct __nsfw_shmem_reserv_req { - i8 aname[NSFW_MEM_NAME_LENTH]; + i8 aname[NSFW_MEM_NAME_LENGTH]; u16 usseq; u16 usreserv; i32 isocket_id; - size_t lenth; + size_t length; i32 ireserv; } nsfw_shmem_reserv_req; typedef struct __nsfw_shmem_mbuf_req { - i8 aname[NSFW_MEM_NAME_LENTH]; + i8 aname[NSFW_MEM_NAME_LENGTH]; u16 usseq; u16 enmptype; unsigned usnum; @@ -194,7 +194,7 @@ typedef struct __nsfw_shmem_mbuf_req typedef struct __nsfw_shmem_sppool_req { - i8 aname[NSFW_MEM_NAME_LENTH]; + i8 aname[NSFW_MEM_NAME_LENGTH]; u16 usseq; u16 enmptype; u32 usnum; @@ -205,7 +205,7 @@ typedef struct __nsfw_shmem_sppool_req typedef struct __nsfw_shmem_ring_req { - i8 aname[NSFW_MEM_NAME_LENTH]; + i8 aname[NSFW_MEM_NAME_LENGTH]; u16 usseq; u16 enmptype; u32 usnum; @@ -215,7 +215,7 @@ typedef struct __nsfw_shmem_ring_req typedef struct __nsfw_shmem_free_req { - i8 aname[NSFW_MEM_NAME_LENTH]; + i8 aname[NSFW_MEM_NAME_LENGTH]; u16 usseq; u16 ustype; /*structure of memory(memzone,mbuf,mpool,ring) */ i32 ireserv; @@ -223,7 +223,7 @@ typedef struct __nsfw_shmem_free_req typedef struct __nsfw_shmem_lookup_req { - i8 aname[NSFW_MEM_NAME_LENTH]; + i8 aname[NSFW_MEM_NAME_LENGTH]; u16 usseq; u16 ustype; /*structure of memory(memzone,mbuf,mpool,ring) */ i32 ireserv; @@ -243,7 +243,7 @@ typedef struct /* * memory module init - * para:point to nstak_fwmem_para + * para:point to nstack_fwmem_para */ i32 nsfw_mem_init (void *para); @@ -251,20 +251,20 @@ i32 nsfw_mem_init (void *para); * create a block memory with name * nsfw_mem_zone::stname * nsfw_mem_zone::isize - * note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. + * note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. */ mzone_handle nsfw_mem_zone_create (nsfw_mem_zone * pinfo); /* *create some memory blocks - * note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. + * note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. */ i32 nsfw_mem_zone_createv (nsfw_mem_zone * pmeminfo, i32 inum, mzone_handle * paddr_array, i32 iarray_num); /* *look up a memory - * note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. + * note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. * 2. if the memory is shared, pname->enowner indicate that who create this memory, * note: * 1. when calling any shared memory create inferface, the name of memory end with _0 created by nStackMain, @@ -288,7 +288,7 @@ mpool_handle nsfw_mem_mbfmp_create (nsfw_mem_mbfpool * pbufinfo); /* *create some mbuf pools - * note: 1. the name of lenth must be less than NSFW_MEM_APPNAME_LENTH. + * note: 1. the name of length must be less than NSFW_MEM_APPNAME_LENGTH. */ i32 nsfw_mem_mbfmp_createv (nsfw_mem_mbfpool * pmbfname, i32 inum, mpool_handle * phandle_array, i32 iarray_num); @@ -305,7 +305,7 @@ i32 nsfw_mem_mbf_free (mbuf_handle mhandle, nsfw_mem_type entype); /* *look up mbuf mpool - * note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. + * note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. * 2. if the memory is shared, pname->enowner indicate that who create this memory. * note: * 1. when calling any shared memory create inferface, the name of memory end with _0 created by nStackMain, @@ -321,39 +321,39 @@ mpool_handle nsfw_mem_mbfmp_lookup (nsfw_mem_name * pmbfname); /* *release mbuf pool - * note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. + * note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. */ i32 nsfw_mem_mbfmp_release (nsfw_mem_name * pname); /* *create a simple pool - *note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. + *note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. */ mring_handle nsfw_mem_sp_create (nsfw_mem_sppool * pmpinfo); /* *create some simple pools one time - *note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. + *note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. */ i32 nsfw_mem_sp_createv (nsfw_mem_sppool * pmpinfo, i32 inum, mring_handle * pringhandle_array, i32 iarray_num); /* *create a simple pool with many rings - *note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. + *note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. */ i32 nsfw_mem_sp_ring_create (nsfw_mem_mring * prpoolinfo, mring_handle * pringhandle_array, i32 iringnum); /* *release a simple mempool - *note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. + *note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. */ i32 nsfw_mem_sp_release (nsfw_mem_name * pname); /* *look up a simpile ring - * note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. + * note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. * 2. if the memory is shared, pname->enowner indicate that who create this memory, * note: * 1. when calling any shared memory create inferface, the name of memory end with _0 created by nStackMain, @@ -369,15 +369,15 @@ mring_handle nsfw_mem_sp_lookup (nsfw_mem_name * pname); /* *create a ring - *note: 1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. - * 2. shared memory ring (NSFW_SHMEM) just can put a pointor into the queue, the queue also point to a shared block memory. + *note: 1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. + * 2. shared memory ring (NSFW_SHMEM) just can put a pointer into the queue, the queue also point to a shared block memory. * no shared memory ring(NSFW_NSHMEM) is other wise. */ mring_handle nsfw_mem_ring_create (nsfw_mem_mring * pringinfo); /* *look up a ring by name - * note:1. the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. + * note:1. the length of name must be less than NSFW_MEM_APPNAME_LENGTH. * 2. if the memory is shared, pname->enowner indicate that who create this memory, * note: * 1. when calling any shared memory create inferface, the name of memory end with _0 created by nStackMain, @@ -402,7 +402,7 @@ extern nsfw_ring_ops g_ring_ops_arry[NSFW_MEM_TYPEMAX][NSFW_MPOOL_TYPEMAX]; /***************************************************************************** * Prototype : nsfw_mem_ring_dequeue * Description : get a member from a ring -* note : if NSFW_SHMEM ring, pdata returned alread a local address +* note : if NSFW_SHMEM ring, pdata returned already a local address * Input : mring_handle mhandle * void** pdata * Output : None @@ -429,7 +429,7 @@ nsfw_mem_ring_dequeue (mring_handle mhandle, void **pdata) /***************************************************************************** * Prototype : nsfw_mem_ring_dequeuev * Description : get some members from a ring -* note : if NSFW_SHMEM ring, pdata returned alread a local address +* note : if NSFW_SHMEM ring, pdata returned already a local address * Input : mring_handle mhandle * void** pdata * unsigned inum @@ -501,14 +501,14 @@ u32 nsfw_mem_ring_size (mring_handle mhandle); /* *release a ring memory - *note: the lenth of name must be less than NSFW_MEM_APPNAME_LENTH. + *note: the length of name must be less than NSFW_MEM_APPNAME_LENGTH. */ i32 nsfw_mem_ring_release (nsfw_mem_name * pname); /* *statics mbufpool, sppool, ring mem size *return: <=0, err happen, >0 mem size - * NSFW_MEM_MZONE: not surport because you already know the lenth when create + * NSFW_MEM_MZONE: not surport because you already know the length when create */ ssize_t nsfw_mem_get_len (void *handle, nsfw_mem_struct_type type); @@ -530,14 +530,14 @@ i32 nsfw_mem_mbuf_iterator (mpool_handle handle, u32 start, u32 end, * Description : print ring info * Input : mring_handle mhandle * char *pbuf -* int lenth +* int length * Output : None * Return Value : i32 * Calls : * Called By : * *****************************************************************************/ -i32 nsfw_mem_dfx_ring_print (mring_handle mhandle, char *pbuf, int lenth); +i32 nsfw_mem_dfx_ring_print (mring_handle mhandle, char *pbuf, int length); #ifdef SYS_MEM_RES_STAT u32 nsfw_mem_mbfpool_free_count (mpool_handle mhandle); diff --git a/src/framework/include/nsfw_mgr_com_api.h b/src/framework/include/nsfw_mgr_com_api.h index 099cdbc..094043e 100644 --- a/src/framework/include/nsfw_mgr_com_api.h +++ b/src/framework/include/nsfw_mgr_com_api.h @@ -46,7 +46,7 @@ typedef enum _mgr_msg_type MGR_MSG_MEM_ALLOC_REQ = 64, /* memory msg type */ /*############################################# */ - MGR_MSG_DFX_QRY_REQ = 96, /* nStackCtrl maitain msg */ + MGR_MSG_DFX_QRY_REQ = 96, /* nStackCtrl maintain msg */ MGR_MSG_SET_LOG_REQ, /*############################################# */ @@ -59,7 +59,7 @@ typedef enum _mgr_msg_type /*###query message with large rsp message begin## */ MGR_MSG_LARGE_QRY_REQ_BEGIN = 384, MGR_MSG_LARGE_STA_QRY_REQ = MGR_MSG_LARGE_QRY_REQ_BEGIN, - MGR_MSG_LARGE_MT_QRY_REQ, /* nStackCtrl maitain msg */ + MGR_MSG_LARGE_MT_QRY_REQ, /* nStackCtrl maintain msg */ /*############################################# */ MGR_MSG_LARGE_ALARM_REQ = 500, /* alarm msg type */ @@ -112,7 +112,7 @@ typedef enum _fw_poc_type typedef enum _nsfw_mgr_msg_rsp_code { - NSFW_MGR_SUCESS, + NSFW_MGR_SUCCESS, NSFW_MGR_MSG_TYPE_ERROR, } mgr_msg_rsp_code; diff --git a/src/framework/include/nsfw_recycle_api.h b/src/framework/include/nsfw_recycle_api.h index fd2bd8f..9d7f3bb 100644 --- a/src/framework/include/nsfw_recycle_api.h +++ b/src/framework/include/nsfw_recycle_api.h @@ -41,7 +41,7 @@ typedef enum _nsfw_recycle_priority { NSFW_REC_PRO_HIGHTEST = 0, NSFW_REC_PRO_NORMAL = 1, - NSFW_REC_PRO_DEFALUT = 2, + NSFW_REC_PRO_DEFAULT = 2, NSFW_REC_PRO_LOWEST = 3, NSFW_REC_PRO_MAX = 4 } nsfw_recycle_priority; diff --git a/src/framework/include/nsfw_snapshot.h b/src/framework/include/nsfw_snapshot.h index 8958c64..5ce64aa 100644 --- a/src/framework/include/nsfw_snapshot.h +++ b/src/framework/include/nsfw_snapshot.h @@ -63,7 +63,7 @@ typedef struct _nsfw_ss_objDesc u16 objType; /* Type number of object */ u8 memNum; /* Nubmer of object members */ u32 objSize; - nsfw_ss_objMemDesc_t *memDesc; /* Member descripe */ + nsfw_ss_objMemDesc_t *memDesc; /* Member descript */ } nsfw_ss_objDesc_t; #define NSFW_SS_MAX_OBJDESC_NUM 256 @@ -81,8 +81,8 @@ extern nsfw_ss_objDescManager_t g_nsfw_ss_objDescManager; #define nsfw_ss_getObjDescManagerInst() (&g_nsfw_ss_objDescManager) /** - * @Function nsfw_ss_registe_ObjDesc - * @Description Registe object description to snapshot + * @Function nsfw_ss_register_ObjDesc + * @Description Register object description to snapshot * @param objDesc - description of object * @return void */ @@ -92,7 +92,7 @@ extern void nsfw_ss_register_ObjDesc (nsfw_ss_objDesc_t * objDesc); * @Function nsfw_ss_store * @Description store object to memory * @param (in) objType - type of object - * @param (in) obj - adderss of object memory + * @param (in) obj - address of object memory * @param (in) storeMem - address of memory to store object data * @param (in) storeMemLen - maximal length of storage memory * @return positive integer means length of memory cost on success. return -1 if error @@ -130,7 +130,7 @@ extern int nsfw_ss_getObjStoreMemLen (int objType); NSFW_SNAPSHOT_OBJDESC_REGISTER_SURFIX(_value, __LINE__) /** - * Using this marcro to register object description + * Using this macro to register object description */ #define NSFW_SS_REGSITER_OBJDESC(_value) \ NSFW_SNAPSHOT_OBJDESC_REGISTER_UNIQUE(_value) diff --git a/src/framework/include/nsfw_upgrade.h b/src/framework/include/nsfw_upgrade.h index a4e809c..d5cb5aa 100644 --- a/src/framework/include/nsfw_upgrade.h +++ b/src/framework/include/nsfw_upgrade.h @@ -32,9 +32,9 @@ extern "C" { #define USE_MEM_BIT(mem_bit, struct, mem) (mem_bit |= ((i64)1 << struct ## _ ## mem)) -#define UPGRADE_MEM_VAL(mem_bit, struct, mem, obj, defalut) { \ +#define UPGRADE_MEM_VAL(mem_bit, struct, mem, obj, default) { \ if (!GET_MEM_BIT(mem_bit, struct, mem)){ \ - obj->mem = defalut; \ + obj->mem = default; \ } \ } diff --git a/src/framework/init/fw_init.c b/src/framework/init/fw_init.c index 6337b67..2764479 100644 --- a/src/framework/init/fw_init.c +++ b/src/framework/init/fw_init.c @@ -247,8 +247,8 @@ nstack_framework_printInitialResult () /** * @Function nstack_framework_init - * @Description This function will do framework initial work, it will involk all initial functions - * registed using macro NSFW_MODULE_INIT before + * @Description This function will do framework initial work, it will invoke all initial functions + * registered using macro NSFW_MODULE_INIT before * @param none * @return 0 on success, -1 on error */ diff --git a/src/framework/init/fw_module.c b/src/framework/init/fw_module.c index 65bbb0a..1f22ecb 100644 --- a/src/framework/init/fw_module.c +++ b/src/framework/init/fw_module.c @@ -27,8 +27,8 @@ extern "C"{ /* *INDENT-ON* */ #endif /* __cplusplus */ -COMPAT_PROTECT (NSFW_MOUDLE_INSTANCE_POOL_SIZE, 64); -COMPAT_PROTECT (NSFW_MOUDLE_DEPENDS_POOL_SIZE, 128); +COMPAT_PROTECT (NSFW_MODULE_INSTANCE_POOL_SIZE, 64); +COMPAT_PROTECT (NSFW_MODULE_DEPENDS_POOL_SIZE, 128); nsfw_module_instance_pool_t g_nsfw_module_inst_pool; nsfw_module_depends_pool_t g_nsfw_module_deps_pool; @@ -40,7 +40,7 @@ nsfw_module_depends_pool_t g_nsfw_module_deps_pool; NSTACK_STATIC nsfw_module_instance_t * nsfw_module_malloc_instance () { - if (g_nsfw_module_inst_pool.last_idx >= NSFW_MOUDLE_INSTANCE_POOL_SIZE) + if (g_nsfw_module_inst_pool.last_idx >= NSFW_MODULE_INSTANCE_POOL_SIZE) { return NULL; } @@ -56,7 +56,7 @@ nsfw_module_malloc_instance () NSTACK_STATIC nsfw_module_depends_t * nsfw_module_malloc_depends () { - if (g_nsfw_module_deps_pool.last_idx >= NSFW_MOUDLE_DEPENDS_POOL_SIZE) + if (g_nsfw_module_deps_pool.last_idx >= NSFW_MODULE_DEPENDS_POOL_SIZE) { return NULL; } diff --git a/src/framework/init/fw_module.h b/src/framework/init/fw_module.h index 1cfc95f..0818aed 100644 --- a/src/framework/init/fw_module.h +++ b/src/framework/init/fw_module.h @@ -60,20 +60,20 @@ extern int nsfw_module_addDoneNode (nsfw_module_instance_t * inst); extern nsfw_module_manager_t g_nsfw_module_manager; #define nsfw_module_getManager() (&g_nsfw_module_manager) -#define NSFW_MOUDLE_INSTANCE_POOL_SIZE 64 -#define NSFW_MOUDLE_DEPENDS_POOL_SIZE 128 +#define NSFW_MODULE_INSTANCE_POOL_SIZE 64 +#define NSFW_MODULE_DEPENDS_POOL_SIZE 128 typedef struct _nsfw_module_instance_pool { int last_idx; nsfw_module_instance_t - module_instance_pool[NSFW_MOUDLE_INSTANCE_POOL_SIZE]; + module_instance_pool[NSFW_MODULE_INSTANCE_POOL_SIZE]; } nsfw_module_instance_pool_t; typedef struct _nsfw_module_depends_pool { int last_idx; - nsfw_module_depends_t module_depends_pool[NSFW_MOUDLE_DEPENDS_POOL_SIZE]; + nsfw_module_depends_t module_depends_pool[NSFW_MODULE_DEPENDS_POOL_SIZE]; } nsfw_module_depends_pool_t; #ifdef __cplusplus diff --git a/src/framework/ipc/mgr_com/mgr_com.c b/src/framework/ipc/mgr_com/mgr_com.c index 5cdb044..2b35e2c 100644 --- a/src/framework/ipc/mgr_com/mgr_com.c +++ b/src/framework/ipc/mgr_com/mgr_com.c @@ -50,7 +50,7 @@ extern "C"{ /* *INDENT-OFF* */ nsfw_mgr_msg_fun g_mgr_fun[MGR_MSG_MAX][NSFW_MGRCOM_MAX_PROC_FUN]; nsfw_mgr_init_cfg g_mgr_com_cfg; -nsfw_mgr_sock_map g_mgr_sockt_map = {{0}, NULL}; +nsfw_mgr_sock_map g_mgr_socket_map = {{0}, NULL}; nsfw_mgrcom_stat g_mgr_stat; nsfw_mgrcom_proc g_ep_proc = { 0 }; /* *INDENT-ON* */ @@ -87,7 +87,7 @@ nsfw_get_proc_name (u8 proc_type) /***************************************************************************** * Prototype : nsfw_mgr_reg_msg_fun -* Description : reg the callback funciton when receive new message +* Description : reg the callback function when receive new message * Input : u16 msg_type * nsfw_mgr_msg_fun fun * Output : None @@ -519,13 +519,13 @@ NSTACK_STATIC inline u8 nsfw_mgr_new_socket (i32 fd, u8 proc_type, u32 host_pid) { nsfw_mgr_sock_info *sock_info = NULL; - if (((i32) NSFW_MGR_FD_MAX <= fd) || (fd < 0) || (!g_mgr_sockt_map.sock)) + if (((i32) NSFW_MGR_FD_MAX <= fd) || (fd < 0) || (!g_mgr_socket_map.sock)) { - NSFW_LOGERR ("fd err]mgr_fd=%d, sock=%p", fd, g_mgr_sockt_map.sock); + NSFW_LOGERR ("fd err]mgr_fd=%d, sock=%p", fd, g_mgr_socket_map.sock); return FALSE; } - sock_info = &g_mgr_sockt_map.sock[fd]; + sock_info = &g_mgr_socket_map.sock[fd]; if (host_pid != sock_info->host_pid) { NSFW_LOGDBG @@ -538,7 +538,7 @@ nsfw_mgr_new_socket (i32 fd, u8 proc_type, u32 host_pid) if (proc_type < NSFW_PROC_MAX) { - g_mgr_sockt_map.proc_cache[proc_type] = fd; + g_mgr_socket_map.proc_cache[proc_type] = fd; } return TRUE; @@ -557,18 +557,18 @@ NSTACK_STATIC inline u8 nsfw_mgr_del_socket (u32 fd) { nsfw_mgr_sock_info *sock_info = NULL; - if ((NSFW_MGR_FD_MAX <= fd) || (!g_mgr_sockt_map.sock)) + if ((NSFW_MGR_FD_MAX <= fd) || (!g_mgr_socket_map.sock)) { - NSFW_LOGERR ("fd err]mgr_fd=%u, sock=%p", fd, g_mgr_sockt_map.sock); + NSFW_LOGERR ("fd err]mgr_fd=%u, sock=%p", fd, g_mgr_socket_map.sock); return FALSE; } - sock_info = &g_mgr_sockt_map.sock[fd]; + sock_info = &g_mgr_socket_map.sock[fd]; if (sock_info->proc_type < NSFW_PROC_MAX - && fd == g_mgr_sockt_map.proc_cache[sock_info->proc_type]) + && fd == g_mgr_socket_map.proc_cache[sock_info->proc_type]) { - g_mgr_sockt_map.proc_cache[sock_info->proc_type] = 0; + g_mgr_socket_map.proc_cache[sock_info->proc_type] = 0; } NSFW_LOGDBG ("del sock]mgr_fd=%u,type=%u,pid=%u", fd, @@ -597,17 +597,17 @@ nsfw_mgr_get_dst_socket (u8 proc_type, u32 dst_pid) if (proc_type < NSFW_PROC_MAX) { - fd = g_mgr_sockt_map.proc_cache[proc_type]; + fd = g_mgr_socket_map.proc_cache[proc_type]; } - if (!g_mgr_sockt_map.sock) + if (!g_mgr_socket_map.sock) { return -1; } if (fd > 0 && fd < (i32) NSFW_MGR_FD_MAX) { - sock_info = &g_mgr_sockt_map.sock[fd]; + sock_info = &g_mgr_socket_map.sock[fd]; if (sock_info->host_pid != 0) { if (0 == dst_pid || dst_pid == sock_info->host_pid) @@ -624,7 +624,7 @@ nsfw_mgr_get_dst_socket (u8 proc_type, u32 dst_pid) i32 i; for (i = 0; i < (i32) NSFW_MGR_FD_MAX; i++) { - sock_info = &g_mgr_sockt_map.sock[i]; + sock_info = &g_mgr_socket_map.sock[i]; if (sock_info->host_pid != 0 && proc_type == sock_info->proc_type) { if (0 == dst_pid || dst_pid == sock_info->host_pid) @@ -673,14 +673,14 @@ u8 nsfw_mgr_clr_fd_lock () { i32 i; - if (!g_mgr_sockt_map.sock) + if (!g_mgr_socket_map.sock) { NSFW_LOGERR ("clr fd lock fail, sock is null"); return FALSE; } for (i = 0; i < (i32) NSFW_MGR_FD_MAX; i++) { - common_mem_spinlock_init (&(g_mgr_sockt_map.sock[i].opr_lock)); + common_mem_spinlock_init (&(g_mgr_socket_map.sock[i].opr_lock)); } return TRUE; } @@ -1063,7 +1063,7 @@ nsfw_mgr_msg_in (i32 fd) } NSFW_LOGERR ("drop msg]" MSGINFO, PRTMSG (msg)); - /* fix "Out-of-bounds write" type codedex issue */ + /* fix "Out-of-bounds write" type codex issue */ if (msg->msg_type < MGR_MSG_MAX) { g_mgr_stat.recv_drop[msg->msg_type]++; @@ -1075,7 +1075,7 @@ nsfw_mgr_msg_in (i32 fd) /***************************************************************************** * Prototype : nsfw_mgr_new_msg -* Description : when new mgr message recive from socket, this funciton +* Description : when new mgr message receive from socket, this function will call back * Input : i32 epfd * i32 fd @@ -1142,7 +1142,7 @@ nsfw_mgr_com_socket_error (i32 fd, nsfw_mgr_sock_fun fun, i32 timer) /***************************************************************************** * Prototype : nsfw_mgr_new_connection -* Description : when new mgr connection in, this funciton will call back +* Description : when new mgr connection in, this function will call back * Input : i32 epfd * i32 fd * u32 events @@ -1164,7 +1164,7 @@ nsfw_mgr_new_connection (i32 epfd, i32 fd, u32 events) if (listen_fd < 0) { NSFW_LOGERR - ("get listen_fd faied!]epfd=%d,listen_fd=%d,event=0x%x", epfd, + ("get listen_fd failed!]epfd=%d,listen_fd=%d,event=0x%x", epfd, fd, events); return FALSE; } @@ -1225,7 +1225,7 @@ nsfw_mgr_new_connection (i32 epfd, i32 fd, u32 events) /***************************************************************************** * Prototype : nsfw_set_sock_block -* Description : set fd blok or not for epoll thread +* Description : set fd block or not for epoll thread * Input : i32 sock * u8 flag * Output : None @@ -1507,15 +1507,15 @@ nsfw_sock_add_to_ep (i32 epfd) u8 nsfw_mgr_com_start () { - i32 listern_fd = nsfw_mgr_get_listen_socket (); - if (listern_fd < 0) + i32 listen_fd = nsfw_mgr_get_listen_socket (); + if (listen_fd < 0) { - NSFW_LOGERR ("get listern_fd failed!"); + NSFW_LOGERR ("get listen_fd failed!"); return FALSE; } - NSFW_LOGINF ("start mgr_com module!] listern_fd=%d", listern_fd); - (void) nsfw_mgr_reg_sock_fun (listern_fd, nsfw_mgr_new_connection); + NSFW_LOGINF ("start mgr_com module!] listen_fd=%d", listen_fd); + (void) nsfw_mgr_reg_sock_fun (listen_fd, nsfw_mgr_new_connection); return TRUE; } @@ -1714,7 +1714,7 @@ nsfw_mgr_com_chk_hbt (int v_add) /***************************************************************************** * Prototype : nsfw_mgr_comm_fd_destroy -* Description : free the memeory +* Description : free the memory * Input : * Output : None * Return Value : int @@ -1729,10 +1729,10 @@ nsfw_mgr_comm_fd_destroy () free (g_ep_proc.ep_fun); g_ep_proc.ep_fun = NULL; } - if (g_mgr_sockt_map.sock) + if (g_mgr_socket_map.sock) { - free (g_mgr_sockt_map.sock); - g_mgr_sockt_map.sock = NULL; + free (g_mgr_socket_map.sock); + g_mgr_socket_map.sock = NULL; } return; } @@ -1750,7 +1750,7 @@ int nsfw_mgr_comm_fd_init (u32 proc_type) { /*only app need to do this */ - if ((g_mgr_sockt_map.sock) && (g_ep_proc.ep_fun)) + if ((g_mgr_socket_map.sock) && (g_ep_proc.ep_fun)) { return 0; } @@ -1773,18 +1773,18 @@ nsfw_mgr_comm_fd_init (u32 proc_type) } } NSFW_LOGINF ("] final max fd=%d", NSFW_MGR_FD_MAX); - if (!g_mgr_sockt_map.sock) + if (!g_mgr_socket_map.sock) { - g_mgr_sockt_map.sock = + g_mgr_socket_map.sock = (nsfw_mgr_sock_info *) malloc (sizeof (nsfw_mgr_sock_info) * NSFW_MGR_FD_MAX); - if (NULL == g_mgr_sockt_map.sock) + if (NULL == g_mgr_socket_map.sock) { NSFW_LOGERR ("malloc fail] length=%d", sizeof (nsfw_mgr_sock_info) * NSFW_MGR_FD_MAX); return -1; } - (void) MEMSET_S (g_mgr_sockt_map.sock, + (void) MEMSET_S (g_mgr_socket_map.sock, sizeof (nsfw_mgr_sock_info) * NSFW_MGR_FD_MAX, 0, sizeof (nsfw_mgr_sock_info) * NSFW_MGR_FD_MAX); } diff --git a/src/framework/ipc/mgr_com/mgr_com.h b/src/framework/ipc/mgr_com/mgr_com.h index c4333a1..a5cdfcf 100644 --- a/src/framework/ipc/mgr_com/mgr_com.h +++ b/src/framework/ipc/mgr_com/mgr_com.h @@ -123,14 +123,14 @@ u8 nsfw_mgr_stop (); #define LOCK_MGR_FD(_fd){\ if ((i32)NSFW_MGR_FD_MAX > _fd)\ {\ - common_mem_spinlock_lock(&g_mgr_sockt_map.sock[_fd].opr_lock);\ + common_mem_spinlock_lock(&g_mgr_socket_map.sock[_fd].opr_lock);\ }\ } #define UNLOCK_MGR_FD(_fd){\ if ((i32)NSFW_MGR_FD_MAX > _fd)\ {\ - common_mem_spinlock_unlock(&g_mgr_sockt_map.sock[_fd].opr_lock);\ + common_mem_spinlock_unlock(&g_mgr_socket_map.sock[_fd].opr_lock);\ }\ } diff --git a/src/framework/ipc/ps/nsfw_fd_timer.c b/src/framework/ipc/ps/nsfw_fd_timer.c index 57535a3..8c73ec0 100644 --- a/src/framework/ipc/ps/nsfw_fd_timer.c +++ b/src/framework/ipc/ps/nsfw_fd_timer.c @@ -243,7 +243,7 @@ nsfw_timer_notify_fun (i32 epfd, i32 fd, u32 events) i32 timer_fd = nsfw_get_timer_socket (); if (timer_fd < 0) { - NSFW_LOGERR ("get timer_fd faied!]epfd=%d,timer_fd=%d,event=0x%x", + NSFW_LOGERR ("get timer_fd failed!]epfd=%d,timer_fd=%d,event=0x%x", epfd, fd, events); return FALSE; } @@ -340,7 +340,7 @@ nsfw_timer_module_init (void *param) pmpinfo.isocket_id = NSFW_SOCKET_ANY; pmpinfo.stname.entype = NSFW_NSHMEM; if (-1 == - SPRINTF_S (pmpinfo.stname.aname, NSFW_MEM_NAME_LENTH, "%s", + SPRINTF_S (pmpinfo.stname.aname, NSFW_MEM_NAME_LENGTH, "%s", "MS_TM_INFOPOOL")) { NSFW_LOGERR ("SPRINTF_S failed"); diff --git a/src/framework/ipc/ps/nsfw_ps_mem_module.c b/src/framework/ipc/ps/nsfw_ps_mem_module.c index 9cda6b3..55af158 100644 --- a/src/framework/ipc/ps/nsfw_ps_mem_module.c +++ b/src/framework/ipc/ps/nsfw_ps_mem_module.c @@ -132,7 +132,7 @@ mem_alloc_ps_info (u32 pid, u8 proc_type) pps_info = nsfw_ps_info_alloc (pid, proc_type); if (NULL == pps_info) { - NSFW_LOGERR ("alloc ps_info falied!]pid=%u,proc_type=%u", pid, + NSFW_LOGERR ("alloc ps_info failed!]pid=%u,proc_type=%u", pid, proc_type); return FALSE; } @@ -240,7 +240,7 @@ mem_item_get_cfg_from_msg (u16 msg_type) /***************************************************************************** * Prototype : mem_item_get_callargv -* Description : change the message value to structur value +* Description : change the message value to structure value * Input : u16 msg_type * char* msg_body * char *memstr_buf @@ -257,7 +257,7 @@ mem_item_get_callargv (u16 msg_type, char *msg_body, char *memstr_buf, switch (msg_type) { case NSFW_RESERV_REQ_MSG: - MEM_GET_CALLARGV (lenth, lenth, nsfw_mem_zone, nsfw_shmem_reserv_req, + MEM_GET_CALLARGV (length, length, nsfw_mem_zone, nsfw_shmem_reserv_req, memstr_buf, msg_body); MEM_GET_CALLARGV (isocket_id, isocket_id, nsfw_mem_zone, nsfw_shmem_reserv_req, memstr_buf, msg_body); @@ -308,7 +308,7 @@ mem_item_get_callargv (u16 msg_type, char *msg_body, char *memstr_buf, } if (EOK != STRCPY_S (((nsfw_mem_zone *) memstr_buf)->stname.aname, - NSFW_MEM_NAME_LENTH, + NSFW_MEM_NAME_LENGTH, ((nsfw_shmem_reserv_req *) msg_body)->aname)) { NSFW_LOGERR ("STRCPY_S failed]msg_type=%u", msg_type); @@ -467,10 +467,10 @@ mem_init_rsp_msg (nsfw_shmem_msg_head * msg, nsfw_shmem_msg_head * rsp) } int idx; - int mem_count = msg->uslenth / item_cfg->item_size; + int mem_count = msg->uslength / item_cfg->item_size; rsp->usmsg_type = msg->usmsg_type + 1; - rsp->uslenth = mem_count * sizeof (nsfw_shmem_ack); + rsp->uslength = mem_count * sizeof (nsfw_shmem_ack); nsfw_shmem_ack *pack = (nsfw_shmem_ack *) & (rsp->aidata[0]); char *pdata = NULL; for (idx = 0; idx < mem_count; idx++) @@ -511,7 +511,7 @@ mem_rel_mem_by_msg (nsfw_shmem_msg_head * req_msg, return FALSE; } - unsigned int mem_count = req_msg->uslenth / item_cfg->item_size; + unsigned int mem_count = req_msg->uslength / item_cfg->item_size; char *pdata = NULL; nsfw_shmem_ack *pack = (nsfw_shmem_ack *) & (rsp->aidata[0]); for (i = 0; i < mem_count; i++) @@ -552,7 +552,7 @@ mem_lookup_mem_by_msg (nsfw_shmem_msg_head * mgr_msg, return FALSE; } - int mem_count = mgr_msg->uslenth / item_cfg->item_size; + int mem_count = mgr_msg->uslength / item_cfg->item_size; char *pdata = NULL; void *paddr = NULL; nsfw_shmem_ack *pack = (nsfw_shmem_ack *) & (rsp->aidata[0]); @@ -600,7 +600,7 @@ mem_alloc_mem_by_msg (nsfw_shmem_msg_head * mem_msg, char *pdata = NULL; void *p_addr = NULL; - int mem_count = mem_msg->uslenth / item_cfg->item_size; + int mem_count = mem_msg->uslength / item_cfg->item_size; nsfw_shmem_ack *pack = (nsfw_shmem_ack *) & (rsp->aidata[0]); for (i = 0; i < mem_count; i++) { @@ -630,7 +630,7 @@ fail_free_mem: { pdata = (char *) mem_msg->aidata + j * item_cfg->item_size; if (EOK != - STRCPY_S (mem_free.stname.aname, NSFW_MEM_NAME_LENTH, + STRCPY_S (mem_free.stname.aname, NSFW_MEM_NAME_LENGTH, ((nsfw_shmem_reserv_req *) pdata)->aname)) { NSFW_LOGERR ("STRCPY_S failed]j=%d", j); @@ -835,7 +835,7 @@ mem_srv_ctrl_proc (nsfw_mgr_msg * msg) nsfw_srv_ctrl_msg *ctrl_rsp_msg = GET_USER_MSG (nsfw_srv_ctrl_msg, rsp_msg); NSFW_LOGINF ("get srv ctrl state] state=%d", ctrl_msg->srv_state); - ctrl_rsp_msg->rsp_code = NSFW_MGR_SUCESS; + ctrl_rsp_msg->rsp_code = NSFW_MGR_SUCCESS; (void) nsfw_mgr_send_msg (rsp_msg); nsfw_mgr_msg_free (rsp_msg); diff --git a/src/framework/ipc/ps/nsfw_ps_module.c b/src/framework/ipc/ps/nsfw_ps_module.c index e532c31..0a02e6c 100644 --- a/src/framework/ipc/ps/nsfw_ps_module.c +++ b/src/framework/ipc/ps/nsfw_ps_module.c @@ -260,7 +260,7 @@ nsfw_ps_info_alloc (u32 pid, u8 proc_type) nsfw_ps_info *pps_info = NULL; if (0 == nsfw_mem_ring_dequeue (g_ps_cfg.ps_info_pool, (void *) &pps_info)) { - NSFW_LOGERR ("alloc ps_info falied]pid=%u,type=%u", pid, proc_type); + NSFW_LOGERR ("alloc ps_info failed]pid=%u,type=%u", pid, proc_type); return NULL; } @@ -967,7 +967,7 @@ nsfw_ps_check_dst_init (u8 dst_proc_type) /***************************************************************************** * Prototype : nsfw_ps_send_hbt -* Description : seng heart beat message to peer +* Description : send heart beat message to peer * Input : nsfw_ps_info* pps_info * Output : None * Return Value : u8 @@ -1475,7 +1475,7 @@ nsfw_ps_chk_timeout (u32 timer_type, void *data) /***************************************************************************** * Prototype : nsfw_ps_rechk_pid_exit -* Description : rechck pid exit +* Description : recheck pid exit * Input : nsfw_ps_proc_fun fun * void* argv * Output : None @@ -1578,9 +1578,9 @@ nsfw_ps_module_init (void *param) nsfw_mem_zone pzoneinfo; pzoneinfo.isocket_id = NSFW_SOCKET_ANY; pzoneinfo.stname.entype = NSFW_SHMEM; - pzoneinfo.lenth = sizeof (nsfw_pid_item) * NSFW_MAX_PID; + pzoneinfo.length = sizeof (nsfw_pid_item) * NSFW_MAX_PID; if (-1 == - SPRINTF_S (pzoneinfo.stname.aname, NSFW_MEM_NAME_LENTH, "%s", + SPRINTF_S (pzoneinfo.stname.aname, NSFW_MEM_NAME_LENGTH, "%s", "MAS_PS_INFO")) { NSFW_LOGERR ("SPRINTF_S failed]"); @@ -1621,7 +1621,7 @@ nsfw_ps_module_init (void *param) } MEM_STAT (NSFW_PS_MODULE, pzoneinfo.stname.aname, NSFW_SHMEM, - pzoneinfo.lenth); + pzoneinfo.length); g_ps_info = pid_info; break; } @@ -1674,7 +1674,7 @@ nsfw_ps_module_init (void *param) pmpinfo.isocket_id = NSFW_SOCKET_ANY; pmpinfo.stname.entype = NSFW_NSHMEM; if (-1 == - SPRINTF_S (pmpinfo.stname.aname, NSFW_MEM_NAME_LENTH, "%s", + SPRINTF_S (pmpinfo.stname.aname, NSFW_MEM_NAME_LENGTH, "%s", "MAS_PS_INFOPOOL")) { NSFW_LOGERR ("SPRINTF_S failed]"); diff --git a/src/framework/ipc/ps/nsfw_recycle_module.c b/src/framework/ipc/ps/nsfw_recycle_module.c index bb3844f..541581f 100644 --- a/src/framework/ipc/ps/nsfw_recycle_module.c +++ b/src/framework/ipc/ps/nsfw_recycle_module.c @@ -44,7 +44,7 @@ nsfw_rec_fun_info g_rec_lock_fun[NSFW_REC_LOCK_REL_MAX_FUN]; /***************************************************************************** * Prototype : nsfw_recycle_reg_fun -* Description : reg one recycle type recycle funciton +* Description : reg one recycle type recycle function * Input : u16 rec_type * nsfw_recycle_fun fun * Output : None @@ -191,7 +191,7 @@ nsfw_recycle_callback_all_obj (u32 pid, nsfw_recycle_pool * rec_pool) pps_info = nsfw_ps_info_get (pid); if (NULL == pps_info) { - NSFW_LOGERR ("get ps_info falied!]pid=%d", pid); + NSFW_LOGERR ("get ps_info failed!]pid=%d", pid); return NSFW_RCC_CONTINUE; } @@ -259,7 +259,7 @@ nsfw_recycle_pid_obj (u32 pid) pps_info = nsfw_ps_info_get (pid); if (NULL == pps_info) { - NSFW_LOGERR ("get ps_info falied!]pid=%d", pid); + NSFW_LOGERR ("get ps_info failed!]pid=%d", pid); return FALSE; } @@ -313,7 +313,7 @@ nsfw_recycle_all_obj (u32 pid) pps_info = nsfw_ps_info_alloc (pid, NSFW_PROC_APP); if (NULL == pps_info) { - NSFW_LOGERR ("alloc ps_info falied!]pid=%u", pid); + NSFW_LOGERR ("alloc ps_info failed!]pid=%u", pid); return FALSE; } } @@ -441,7 +441,7 @@ mem_rec_zone_init () for (i = 0; i < NSFW_REC_PRO_MAX; i++) { if (-1 == - SPRINTF_S (pringinfo.stname.aname, NSFW_MEM_NAME_LENTH, "%s%d", + SPRINTF_S (pringinfo.stname.aname, NSFW_MEM_NAME_LENGTH, "%s%d", MEM_REC_QUEUE_NAME, i)) { NSFW_LOGERR ("SPRINTF_S failed]"); @@ -462,11 +462,11 @@ mem_rec_zone_init () nsfw_mem_zone pzoneinfo; pzoneinfo.isocket_id = NSFW_SOCKET_ANY; pzoneinfo.stname.entype = NSFW_NSHMEM; - pzoneinfo.lenth = + pzoneinfo.length = MEM_RECYCLE_OBJ_MAX_NUM * sizeof (nsfw_recycle_obj) + sizeof (nsfw_recycle_pool); if (-1 == - SPRINTF_S (pzoneinfo.stname.aname, NSFW_MEM_NAME_LENTH, "%s", + SPRINTF_S (pzoneinfo.stname.aname, NSFW_MEM_NAME_LENGTH, "%s", MEM_REC_POOL_NAME)) { NSFW_LOGERR ("SPRINTF_S failed]"); @@ -481,12 +481,12 @@ mem_rec_zone_init () } MEM_STAT (NSFW_RECYCLE_MODULE, MEM_REC_POOL_NAME, NSFW_NSHMEM, - pzoneinfo.lenth); + pzoneinfo.length); int retval; retval = - MEMSET_S (g_rec_cfg.mem_rec_obj_pool, pzoneinfo.lenth, 0, - pzoneinfo.lenth); + MEMSET_S (g_rec_cfg.mem_rec_obj_pool, pzoneinfo.length, 0, + pzoneinfo.length); if (EOK != retval) { NSFW_LOGERR ("mem set init failed!"); diff --git a/src/framework/lib_common_mem/common_buf.c b/src/framework/lib_common_mem/common_buf.c index 523ce54..654bd46 100644 --- a/src/framework/lib_common_mem/common_buf.c +++ b/src/framework/lib_common_mem/common_buf.c @@ -47,8 +47,8 @@ #define LOG_DEBUG 3 #define LOG_MAX 4 -#define COMMON_LOG_PRINT(leve, fmt, args...) \ - if (leve <= log_levl) NSCOMM_LOGERR("===>[COMMON]"fmt, ##args); \ +#define COMMON_LOG_PRINT(level, fmt, args...) \ + if (level <= log_level) NSCOMM_LOGERR("===>[COMMON]"fmt, ##args); \ #define COMMON_PANIC(fmt) \ NSCOMM_LOGERR("==>[COMMON_PANIC]"fmt); \ @@ -85,7 +85,7 @@ #define PATA_STRLENT 64 #define PATA_NUM_MAX 12 -int log_levl = LOG_INFO; +int log_level = LOG_INFO; int nscomm_pal_module_init (common_mem_pal_module_info * pinfo) diff --git a/src/framework/log/nsfw_set_log.c b/src/framework/log/nsfw_set_log.c index a4b3b92..7ef6f37 100644 --- a/src/framework/log/nsfw_set_log.c +++ b/src/framework/log/nsfw_set_log.c @@ -87,7 +87,7 @@ nsfw_set_log_path (const char *param, const char *value) NSFW_LOGINF ("renew log path]%s", g_log_cfg.master_log_path); nstack_modify_log_dir (g_log_cfg.master_log_path); - NSFW_LOGINF ("set log sucess]newpath=%s!", g_log_cfg.master_log_path); + NSFW_LOGINF ("set log success]newpath=%s!", g_log_cfg.master_log_path); return TRUE; } return FALSE; @@ -112,7 +112,7 @@ nsfw_flush_log_info (const char *param, u8 proc_type) return FALSE; } glogFlushLogFiles (GLOG_LEVEL_DEBUG); - NSFW_LOGINF ("flush log sucess]proc_type=%u", proc_type); + NSFW_LOGINF ("flush log success]proc_type=%u", proc_type); return TRUE; } diff --git a/src/framework/log/nstack_log.c b/src/framework/log/nstack_log.c index 50279ba..5e62ad7 100644 --- a/src/framework/log/nstack_log.c +++ b/src/framework/log/nstack_log.c @@ -321,11 +321,11 @@ int nstack_log_init() } if (log_level <= NSLOG_WAR) { - /*MONITR log level must set to larger than warning */ + /*MONITOR log level must set to larger than warning */ nstack_setlog_level (MASTER, NSLOG_WAR); } - /* monitr and nstack write the same file, it will cause synchronize problem */ + /* monitor and nstack write the same file, it will cause synchronize problem */ switch (g_my_pro_type) { case LOG_PRO_NSTACK: @@ -517,13 +517,13 @@ get_app_env_log_path (char *app_file_path, unsigned int app_file_size) pst_app_log_path_flag = getenv ("NSTACK_LOG_FILE_FLAG"); if (pst_app_log_path_flag && strcmp (pst_app_log_path_flag, "1") == 0) { - /* if set enviroment variable to 1,then output to file*/ + /* if set environment variable to 1,then output to file*/ log_to_file = 1; } else { - /* if enviroment variable is not equal 1 or - don't set this enviroment variable ,output to STDOUT */ + /* if environment variable is not equal 1 or + don't set this environment variable ,output to STDOUT */ return 0; } @@ -593,7 +593,7 @@ nstack_log_init_app () int file_flag = 0; char app_log_path[FILE_NAME_LEN] = { 0 }; - /* log alread initialized, just return */ + /* log already initialized, just return */ if (LOG_PRO_INVALID != g_my_pro_type) { return; diff --git a/src/framework/snapshot/fw_snapshot.c b/src/framework/snapshot/fw_snapshot.c index 790ecbf..c68d3e0 100644 --- a/src/framework/snapshot/fw_snapshot.c +++ b/src/framework/snapshot/fw_snapshot.c @@ -75,7 +75,7 @@ nsfw_ss_getMemDescFromType (u16 objType, nsfw_ss_objDesc_t * objDesc) * @Function nsfw_ss_store * @Description store object to memory * @param (in) objType - type of object with member description - * @param (in) obj - adderss of object memory + * @param (in) obj - address of object memory * @param (in) storeMem - address of memory to store object data * @param (in) storeMemLen - maximal length of storage memory * @return positive integer means length of memory cost on success. return -1 if error @@ -228,7 +228,7 @@ nsfw_ss_storeObjMem (u16 objMemType, void *obj, void *storeMem, * @Function nsfw_ss_store * @Description store object to memory * @param (in) objType - type of object - * @param (in) obj - adderss of object memory + * @param (in) obj - address of object memory * @param (in) storeMem - address of memory to store object data * @param (in) storeMemLen - maximal length of storage memory * @return positive integer means length of memory cost on success. return -1 if error @@ -246,8 +246,8 @@ nsfw_ss_store (u16 objType, void *obj, void *storeMem, u32 storeMemLen) * @param (in) objType - type of object * @param (in) objMem - object memory to restore * @param (in) mem - memory of storage - * @param (in) storeMemLength - maximal length of storage memroy - * @return 0 on succss , -1 on error + * @param (in) storeMemLength - maximal length of storage memory + * @return 0 on success , -1 on error */ NSTACK_STATIC int nsfw_ss_restoreObjArray (int objType, void *objMem, void *mem, -- cgit 1.2.3-korg