diff options
author | 2018-10-18 08:22:51 +0000 | |
---|---|---|
committer | 2018-10-18 08:22:51 +0000 | |
commit | 0e8e4b657d5d388a6ac988b9da97f1f81740a0b0 (patch) | |
tree | d1674ac3cf8c0b1a2f0cf864f804e579862f6734 /src/framework/lib_common_mem | |
parent | c69fae6d17d4cb3df857aa2f7e2af7049b77b687 (diff) | |
parent | f46e5e9becd2bc76e8335f5e8247ba21713b9510 (diff) |
Merge "Fix: nStackMain parameters should not be fixed"
Diffstat (limited to 'src/framework/lib_common_mem')
-rw-r--r-- | src/framework/lib_common_mem/common_buf.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/framework/lib_common_mem/common_buf.c b/src/framework/lib_common_mem/common_buf.c index 9d9a127..d31ca83 100644 --- a/src/framework/lib_common_mem/common_buf.c +++ b/src/framework/lib_common_mem/common_buf.c @@ -88,7 +88,8 @@ int log_level = LOG_INFO; int -nscomm_pal_module_init (common_mem_pal_module_info * pinfo, u8 app_mode) +nscomm_pal_module_init (nsfw_mem_para * para, + common_mem_pal_module_info * pinfo, u8 app_mode) { char tempargv[PATA_NUM_MAX][PATA_STRLENT]; char *argv[PATA_NUM_MAX]; @@ -100,6 +101,12 @@ nscomm_pal_module_init (common_mem_pal_module_info * pinfo, u8 app_mode) int retVal; char name[10] = { '\0' }; + if (para == NULL) + { + NSCOMM_LOGERR ("para is null"); + return DMM_MBUF_RET_ERR; + } + retVal = MEMSET_S (tempargv, sizeof (tempargv), '\0', sizeof (tempargv)); if (EOK != retVal) { @@ -112,8 +119,21 @@ nscomm_pal_module_init (common_mem_pal_module_info * pinfo, u8 app_mode) NSCOMM_LOGERR ("MEMSET_S failed]ret=%d", retVal); return DMM_MBUF_RET_ERR; } - if (NULL == pinfo) + if (NSFW_PROC_MAIN == para->enflag) { + if (para->iargsnum != 0) + { + if (common_mem_pal_init (para->iargsnum, para->pargs) < 0) + { + COMMON_LOG_PRINT (LOG_ERR, "Cannot init pal\r\n"); + return DMM_MBUF_RET_ERR; + } + else + { + return DMM_MBUF_RET_OK; + } + } + PARA1_SET (argv, tempargv, agindex, "nStackMain"); PARA2_SET (argv, tempargv, agindex, "-c", "0x1"); PARA2_SET (argv, tempargv, agindex, "-n", "4"); |