aboutsummaryrefslogtreecommitdiffstats
path: root/src/framework/init
diff options
context:
space:
mode:
authornanger <zhenyinan@huawei.com>2018-09-29 16:41:15 +0800
committernanger <zhenyinan@huawei.com>2018-09-29 16:45:14 +0800
commit74c9aed15303d388d7d0429128bc3af96f7eb45c (patch)
treeb4659364e410ef5b0f36b61bbf98c48e5763d8e5 /src/framework/init
parent31ea86798426cf236d70c9de1944c723a6cb1d95 (diff)
Refactor: change to dmm share memory
Change-Id: Iff87eb5c6610c1db9247a898dd4c8ffbe6eeabdf Signed-off-by: nanger <zhenyinan@huawei.com>
Diffstat (limited to 'src/framework/init')
-rw-r--r--src/framework/init/CMakeLists.txt6
-rw-r--r--src/framework/init/fw_init.c39
-rw-r--r--src/framework/init/fw_module.c6
3 files changed, 43 insertions, 8 deletions
diff --git a/src/framework/init/CMakeLists.txt b/src/framework/init/CMakeLists.txt
index ff8d4d2..134610c 100644
--- a/src/framework/init/CMakeLists.txt
+++ b/src/framework/init/CMakeLists.txt
@@ -14,11 +14,9 @@
# limitations under the License.
#########################################################################
-SET(LIBSBR_SRC fw_init.c fw_module.c)
+SET(LIBINIT_SRC fw_init.c fw_module.c)
-SET(COMM_CONFIG ${PROJECT_SOURCE_DIR}/src/framework/common/base/include/common_sys_config.h)
ADD_DEFINITIONS(-fPIC -mssse3)
-ADD_DEFINITIONS(-include ${COMM_CONFIG})
-ADD_LIBRARY(nStackfwinit static ${LIBSBR_SRC})
+ADD_LIBRARY(nStackfwinit static ${LIBINIT_SRC})
diff --git a/src/framework/init/fw_init.c b/src/framework/init/fw_init.c
index 2764479..c7f38a0 100644
--- a/src/framework/init/fw_init.c
+++ b/src/framework/init/fw_init.c
@@ -245,6 +245,43 @@ nstack_framework_printInitialResult ()
NSFW_LOGINF ("All modules are inited");
}
+static void
+nstack_framework_print_list ()
+{
+ nsfw_module_manager_t *manager = nsfw_module_getManager ();
+ nsfw_module_instance_t *inst;
+
+ for (inst = manager->inst; inst; inst = inst->next)
+ {
+ char deps[512];
+ nsfw_module_depends_t *depends;
+
+ if (inst->depends)
+ {
+ int depn = 0;
+
+ for (depends = inst->depends; depends; depends = depends->next)
+ {
+ int len = snprintf (&deps[depn], sizeof (deps) - depn,
+ "%s", depends->name);
+ if (len < 0)
+ {
+ break;
+ }
+ depn += len;
+ }
+ deps[sizeof (deps) - 1] = 0;
+ }
+ else
+ {
+ (void) snprintf (deps, sizeof (deps), "{null}");
+ }
+
+ NSFW_LOGDBG ("module: %s father: %s priority: %d depends: %s",
+ inst->name, inst->fatherName, inst->priority, deps);
+ }
+}
+
/**
* @Function nstack_framework_init
* @Description This function will do framework initial work, it will invoke all initial functions
@@ -271,6 +308,8 @@ nstack_framework_init (void)
goto done;
}
+ nstack_framework_print_list ();
+
ret = nstack_framework_initChild_unsafe (NULL);
if (0 == ret)
diff --git a/src/framework/init/fw_module.c b/src/framework/init/fw_module.c
index 1f22ecb..acf4fdb 100644
--- a/src/framework/init/fw_module.c
+++ b/src/framework/init/fw_module.c
@@ -225,10 +225,8 @@ nsfw_module_set_instance_depends (nsfw_module_instance_t * inst, char *name)
if (NULL == dep)
return;
- if (NULL == inst->depends)
- inst->depends = dep;
- else
- inst->depends->next = dep;
+ dep->next = inst->depends;
+ inst->depends = dep;
}
/* *INDENT-OFF* */