diff options
author | wangyalei <wylandrea@gmail.com> | 2018-07-24 02:37:52 +0800 |
---|---|---|
committer | Yalei Wang <william.wangyalei@huawei.com> | 2018-08-14 16:48:34 +0800 |
commit | 1c5d7496f4c7f5d0358d8b57781fd471882b1ece (patch) | |
tree | 695a843e8d885746be1416955a4f4e82b90cc91a /src/nSocket/nstack | |
parent | c080b73a936e0fcdb2d90b32a38135edde2d8fa7 (diff) |
Feat: Add a new type 4 for simple stack integration
When simple stack integration(type=4), only alloc necessary memory(32M),
and add prefix to differentiate the apps in primary mode.
Change-Id: Ide8b3a276e999827b7ad3321cbd62cff127c2d44
Signed-off-by: Yalei Wang <william.wangyalei@huawei.com>
Diffstat (limited to 'src/nSocket/nstack')
-rw-r--r-- | src/nSocket/nstack/nstack.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/nSocket/nstack/nstack.c b/src/nSocket/nstack/nstack.c index 66281af..8718091 100644 --- a/src/nSocket/nstack/nstack.c +++ b/src/nSocket/nstack/nstack.c @@ -57,6 +57,10 @@ nStack_info_t g_nStackInfo = { /*if this flag was set, maybe all socket interface called during initializing*/ __thread int g_tloadflag = 0; +/* app_mode 1: simple stack with APP*/ +u8 app_mode=0; + + /*check init stack*/ #define NSTACK_INIT_STATE_CHECK_RET(state) do {\ if ((state) == NSTACK_MODULE_SUCCESS) \ @@ -411,7 +415,7 @@ nstack_init_shmem () int deploytype = nstack_get_deploy_type (); - if (deploytype > NSTACK_MODEL_TYPE1) + if (deploytype != NSTACK_MODEL_TYPE1 && deploytype != NSTACK_MODEL_TYPE_SIMPLE_STACK ) { if (-1 == nsep_attach_memory ()) { @@ -449,7 +453,7 @@ nstack_init_mem (void) int deploytype = nstack_get_deploy_type (); /* record unmatched app version*/ /* check lib version match - Begin */ - if (deploytype > NSTACK_MODEL_TYPE1) + if (deploytype != NSTACK_MODEL_TYPE1 && deploytype != NSTACK_MODEL_TYPE_SIMPLE_STACK ) { check_main_version (); initflag = 1; @@ -772,7 +776,7 @@ nstack_fw_init () if (0 != nstack_stack_module_load()) { - NSSOC_LOGERR("nstack stack module load fail"); + NSSOC_LOGERR("nstack stack module load fail"); g_nStackInfo.fwInited = NSTACK_MODULE_FAIL; return -1; } @@ -787,6 +791,10 @@ nstack_fw_init () if (deploytype == NSTACK_MODEL_TYPE1) { proc_type = NSFW_PROC_MAIN; + }else if (deploytype == NSTACK_MODEL_TYPE_SIMPLE_STACK) + { + proc_type = NSFW_PROC_MAIN; + app_mode=1; } stinfo.iargsnum = 0; |