From 589641258e3eb21ba7b5d6ce7f7da581468f5489 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Thu, 9 Nov 2023 07:52:18 -0500 Subject: [PATCH] [debug] rename RT_DEBUGING_INIT as RT_DEBUGING_AUTO_INIT --- components/drivers/core/dm.c | 4 ++-- documentation/basic/basic.md | 2 +- include/rtdef.h | 8 ++++---- libcpu/sim/win32/startup.c | 10 +++++----- src/Kconfig | 4 ++-- src/components.c | 8 ++++---- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/components/drivers/core/dm.c b/components/drivers/core/dm.c index c7e1d29696..c8a7792d64 100644 --- a/components/drivers/core/dm.c +++ b/components/drivers/core/dm.c @@ -27,7 +27,7 @@ INIT_EXPORT(rti_secondary_cpu_end, "7.end"); void rt_dm_secondary_cpu_init(void) { -#ifdef RT_DEBUGING_INIT +#ifdef RT_DEBUGING_AUTO_INIT int result; const struct rt_init_desc *desc; @@ -45,7 +45,7 @@ void rt_dm_secondary_cpu_init(void) { (*fn_ptr)(); } -#endif /* RT_DEBUGING_INIT */ +#endif /* RT_DEBUGING_AUTO_INIT */ } #endif /* RT_USING_SMP */ diff --git a/documentation/basic/basic.md b/documentation/basic/basic.md index 8b5e930c8a..d25846e125 100644 --- a/documentation/basic/basic.md +++ b/documentation/basic/basic.md @@ -579,7 +579,7 @@ Configuration is mainly done by modifying the file under project directory - rtc /* Define this macro to enable debug mode, if not defined, close. */ #define RT_USING_DEBUG /* When debug mode is enabled: Define this macro to enable the print component initialization information, if not defined, close. */ -#define RT_DEBUGING_INIT +#define RT_DEBUGING_AUTO_INIT /* Defining this macro means the use of the hook function is started, if not defined, close. */ #define RT_USING_HOOK diff --git a/include/rtdef.h b/include/rtdef.h index 2f55651262..670a0944cf 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -288,7 +288,7 @@ typedef __gnuc_va_list va_list; typedef int (*init_fn_t)(void); #ifdef _MSC_VER #pragma section("rti_fn$f",read) - #ifdef RT_DEBUGING_INIT + #ifdef RT_DEBUGING_AUTO_INIT struct rt_init_desc { const char* level; @@ -312,9 +312,9 @@ typedef int (*init_fn_t)(void); __declspec(allocate("rti_fn$f")) \ rt_used const struct rt_init_desc __rt_init_msc_##fn = \ {__rti_level_##fn, fn }; - #endif + #endif /* RT_DEBUGING_AUTO_INIT */ #else - #ifdef RT_DEBUGING_INIT + #ifdef RT_DEBUGING_AUTO_INIT struct rt_init_desc { const char* fn_name; @@ -327,7 +327,7 @@ typedef int (*init_fn_t)(void); #else #define INIT_EXPORT(fn, level) \ rt_used const init_fn_t __rt_init_##fn rt_section(".rti_fn." level) = fn - #endif + #endif /* RT_DEBUGING_AUTO_INIT */ #endif #else #define INIT_EXPORT(fn, level) diff --git a/libcpu/sim/win32/startup.c b/libcpu/sim/win32/startup.c index ba2871eae6..f0f2784a7a 100644 --- a/libcpu/sim/win32/startup.c +++ b/libcpu/sim/win32/startup.c @@ -81,7 +81,7 @@ struct rt_init_tag { const char *level; init_fn_t fn; -#ifdef RT_DEBUGING_INIT +#ifdef RT_DEBUGING_AUTO_INIT const char *fn_name; #endif }; @@ -114,7 +114,7 @@ static int rt_init_objects_sort(void) { table->level = ((struct rt_init_desc *)ptr_begin)->level; table->fn = ((struct rt_init_desc *)ptr_begin)->fn; -#ifdef RT_DEBUGING_INIT +#ifdef RT_DEBUGING_AUTO_INIT table->fn_name = ((struct rt_init_desc *)ptr_begin)->fn_name; #endif ptr_begin += sizeof(struct rt_init_desc) / sizeof(unsigned int); @@ -168,13 +168,13 @@ void rt_components_board_init(void) { break; } -#ifdef RT_DEBUGING_INIT +#ifdef RT_DEBUGING_AUTO_INIT rt_kprintf("initialize %s", rt_init_table[index_i].fn_name); result = rt_init_table[index_i].fn(); rt_kprintf(":%d done\n", result); #else result = rt_init_table[index_i].fn(); -#endif +#endif /* RT_DEBUGING_AUTO_INIT */ } } } @@ -203,7 +203,7 @@ void rt_components_init(void) { break; } -#ifdef RT_DEBUGING_INIT +#ifdef RT_DEBUGING_AUTO_INIT rt_kprintf("initialize %s", rt_init_table[index_i].fn_name); result = rt_init_table[index_i].fn(); rt_kprintf(":%d done\n", result); diff --git a/src/Kconfig b/src/Kconfig index 6ff7b75788..ee57ac1775 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -211,8 +211,8 @@ menuconfig RT_USING_DEBUG bool "Enable debugging of environment and context check" default y - config RT_DEBUGING_INIT - bool "Enable debugging of components initialization" + config RT_DEBUGING_AUTO_INIT + bool "Enable debugging of components automatic initialization" default n config RT_DEBUGING_PAGE_LEAK diff --git a/src/components.c b/src/components.c index 33d7ec38e6..8d434f073b 100644 --- a/src/components.c +++ b/src/components.c @@ -85,7 +85,7 @@ INIT_EXPORT(rti_end, "6.end"); */ void rt_components_board_init(void) { -#ifdef RT_DEBUGING_INIT +#ifdef RT_DEBUGING_AUTO_INIT int result; const struct rt_init_desc *desc; for (desc = &__rt_init_desc_rti_board_start; desc < &__rt_init_desc_rti_board_end; desc ++) @@ -101,7 +101,7 @@ void rt_components_board_init(void) { (*fn_ptr)(); } -#endif /* RT_DEBUGING_INIT */ +#endif /* RT_DEBUGING_AUTO_INIT */ } /** @@ -109,7 +109,7 @@ void rt_components_board_init(void) */ void rt_components_init(void) { -#ifdef RT_DEBUGING_INIT +#ifdef RT_DEBUGING_AUTO_INIT int result; const struct rt_init_desc *desc; @@ -127,7 +127,7 @@ void rt_components_init(void) { (*fn_ptr)(); } -#endif /* RT_DEBUGING_INIT */ +#endif /* RT_DEBUGING_AUTO_INIT */ } #endif /* RT_USING_COMPONENTS_INIT */