[debug] rename RT_DEBUGING_INIT as RT_DEBUGING_AUTO_INIT

This commit is contained in:
Meco Man 2023-11-09 07:52:18 -05:00
parent 48f53e9150
commit 589641258e
6 changed files with 18 additions and 18 deletions

View File

@ -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 */

View File

@ -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

View File

@ -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)

View File

@ -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);

View File

@ -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

View File

@ -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 */