fix(src): Use interrupt nest accessor and export IRQ hook pointers

This commit is contained in:
wdfk-prog
2026-04-08 18:58:33 +08:00
committed by Rbb666
parent c6cfed353f
commit 2548bdb9c2
2 changed files with 4 additions and 5 deletions
+2 -2
View File
@@ -26,8 +26,8 @@
#if defined(RT_USING_HOOK) && defined(RT_HOOK_USING_FUNC_PTR)
static void (*rt_interrupt_enter_hook)(void);
static void (*rt_interrupt_leave_hook)(void);
void (*rt_interrupt_enter_hook)(void);
void (*rt_interrupt_leave_hook)(void);
/**
* @ingroup group_hook
+2 -3
View File
@@ -50,7 +50,6 @@ rt_uint32_t rt_thread_ready_priority_group;
rt_uint8_t rt_thread_ready_table[32];
#endif /* RT_THREAD_PRIORITY_MAX > 32 */
extern volatile rt_atomic_t rt_interrupt_nest;
static rt_atomic_t rt_scheduler_lock_nest;
rt_uint8_t rt_current_priority;
@@ -347,13 +346,13 @@ void rt_schedule(void)
LOG_D("[%d]switch to priority#%d "
"thread:%.*s(sp:0x%08x), "
"from thread:%.*s(sp: 0x%08x)",
rt_interrupt_nest, highest_ready_priority,
rt_interrupt_get_nest(), highest_ready_priority,
RT_NAME_MAX, to_thread->parent.name, to_thread->sp,
RT_NAME_MAX, from_thread->parent.name, from_thread->sp);
RT_SCHEDULER_STACK_CHECK(to_thread);
if (rt_interrupt_nest == 0)
if (rt_interrupt_get_nest() == 0)
{
extern void rt_thread_handle_sig(rt_bool_t clean_state);