Skip to content

Commit

Permalink
[debug] rename RT_DEBUGING_INIT as RT_DEBUGING_AUTO_INIT
Browse files Browse the repository at this point in the history
  • Loading branch information
mysterywolf committed Nov 10, 2023
1 parent 48f53e9 commit 5896412
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions components/drivers/core/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

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

Expand Down
2 changes: 1 addition & 1 deletion documentation/basic/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions include/rtdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions libcpu/sim/win32/startup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 */
}
}
}
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/components.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ++)
Expand All @@ -101,15 +101,15 @@ void rt_components_board_init(void)
{
(*fn_ptr)();
}
#endif /* RT_DEBUGING_INIT */
#endif /* RT_DEBUGING_AUTO_INIT */
}

/**
* @brief RT-Thread Components Initialization.
*/
void rt_components_init(void)
{
#ifdef RT_DEBUGING_INIT
#ifdef RT_DEBUGING_AUTO_INIT
int result;
const struct rt_init_desc *desc;

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

Expand Down

0 comments on commit 5896412

Please sign in to comment.