summaryrefslogtreecommitdiff
path: root/components/init
diff options
context:
space:
mode:
authorbernard <[email protected]>2013-07-24 07:33:48 +0800
committerbernard <[email protected]>2013-07-24 07:33:48 +0800
commita124e7bd22445ce90fc39419268d1b27e74ffd45 (patch)
tree6e10260ee04b990bf021b93b87aa2f7e04f1bb12 /components/init
parentb96b35613f2cdc8118f083a3e2795788915319d7 (diff)
add initialization debug code
Diffstat (limited to 'components/init')
-rw-r--r--components/init/components.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/components/init/components.c b/components/init/components.c
index 83e13f22cd..44ff11361a 100644
--- a/components/init/components.c
+++ b/components/init/components.c
@@ -52,6 +52,16 @@ INIT_EXPORT(rti_end,"7");
void rt_components_board_init(void)
{
#ifndef _MSC_VER
+#if RT_DEBUG_INIT
+ int result;
+ const struct rt_init_desc *desc;
+ for (desc = &__rt_init_desc_rti_start; desc < &__rt_init_desc_rti_board_end; desc ++)
+ {
+ rt_kprintf("initialize %s", desc->fn_name);
+ result = desc->fn();
+ rt_kprintf(":%d done\n", result);
+ }
+#else
const init_fn_t *fn_ptr;
for (fn_ptr = &__rt_init_rti_start; fn_ptr < &__rt_init_rti_board_end; fn_ptr++)
@@ -59,6 +69,7 @@ void rt_components_board_init(void)
(*fn_ptr)();
}
#endif
+#endif
}
/**
@@ -67,12 +78,25 @@ void rt_components_board_init(void)
void rt_components_init(void)
{
#ifndef _MSC_VER
+#if RT_DEBUG_INIT
+ int result;
+ const struct rt_init_desc *desc;
+
+ rt_kprintf("do components intialization.\n");
+ for (desc = &__rt_init_desc_rti_board_end; desc < &__rt_init_desc_rti_end; desc ++)
+ {
+ rt_kprintf("initialize %s", desc->fn_name);
+ result = desc->fn();
+ rt_kprintf(":%d done\n", result);
+ }
+#else
const init_fn_t *fn_ptr;
for (fn_ptr = &__rt_init_rti_board_end; fn_ptr < &__rt_init_rti_end; fn_ptr ++)
{
(*fn_ptr)();
}
+#endif
#else
#ifdef RT_USING_MODULE
rt_system_module_init();