summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShell <[email protected]>2024-04-19 13:13:31 +0800
committerMeco Man <[email protected]>2024-04-19 21:30:12 -0400
commitd1bb01621beec12a03fbe1489419cabde5461919 (patch)
tree98dfd4409d81bc6c72bc62031d7dbc6bf2eb0662 /src
parent8c4db32d041153abab4484ac4118b147cf40fe32 (diff)
fixup: add Kconfig option
Diffstat (limited to 'src')
-rw-r--r--src/Kconfig6
-rw-r--r--src/scheduler_mp.c6
-rw-r--r--src/scheduler_up.c6
3 files changed, 12 insertions, 6 deletions
diff --git a/src/Kconfig b/src/Kconfig
index 1fd1b4b0bc..fc5b59938f 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -239,6 +239,12 @@ menuconfig RT_USING_DEBUG
bool "Enable spinlock debugging"
depends on RT_USING_SMP
default n
+
+ config RT_DEBUGING_CRITICAL
+ bool "Enable critical level tracing"
+ depends on RT_USING_SMP
+ default y if RT_USING_SMART
+ default n
endif
menu "Inter-Thread communication"
diff --git a/src/scheduler_mp.c b/src/scheduler_mp.c
index efec82f303..ef5a3ee935 100644
--- a/src/scheduler_mp.c
+++ b/src/scheduler_mp.c
@@ -1056,7 +1056,7 @@ void rt_sched_post_ctx_switch(struct rt_thread *thread)
pcpu->current_thread = thread;
}
-#ifdef RT_USING_DEBUG
+#ifdef RT_DEBUGING_CRITICAL
static volatile int _critical_error_occurred = 0;
@@ -1083,14 +1083,14 @@ void rt_exit_critical_safe(rt_base_t critical_level)
rt_exit_critical();
}
-#else
+#else /* !RT_DEBUGING_CRITICAL */
void rt_exit_critical_safe(rt_base_t critical_level)
{
return rt_exit_critical();
}
-#endif
+#endif /* RT_DEBUGING_CRITICAL */
RTM_EXPORT(rt_exit_critical_safe);
/**
diff --git a/src/scheduler_up.c b/src/scheduler_up.c
index 289a30a58f..822d4a8046 100644
--- a/src/scheduler_up.c
+++ b/src/scheduler_up.c
@@ -451,7 +451,7 @@ void rt_sched_remove_thread(struct rt_thread *thread)
rt_hw_interrupt_enable(level);
}
-#ifdef RT_USING_DEBUG
+#ifdef RT_DEBUGING_CRITICAL
static volatile int _critical_error_occurred = 0;
@@ -482,14 +482,14 @@ void rt_exit_critical_safe(rt_base_t critical_level)
rt_exit_critical();
}
-#else
+#else /* !RT_DEBUGING_CRITICAL */
void rt_exit_critical_safe(rt_base_t critical_level)
{
rt_exit_critical();
}
-#endif
+#endif/* RT_DEBUGING_CRITICAL */
RTM_EXPORT(rt_exit_critical_safe);
/**