调整代码,以支持cpu usage

This commit is contained in:
fenghuijie
2021-07-05 18:33:22 +08:00
parent e933c1f610
commit 0015af02e4
7 changed files with 39 additions and 1 deletions
+14
View File
@@ -27,6 +27,20 @@ struct rt_irq_desc isr_table[MAX_HANDLERS];
rt_uint32_t rt_interrupt_from_thread = 0;
rt_uint32_t rt_interrupt_to_thread = 0;
rt_uint32_t rt_thread_switch_interrupt_flag = 0;
#ifdef RT_USING_HOOK
static void (*rt_interrupt_switch_hook)(void);
void rt_interrupt_switch_sethook(void (*hook)(void))
{
rt_interrupt_switch_hook = hook;
}
#endif
void rt_interrupt_hook(void)
{
RT_OBJECT_HOOK_CALL(rt_interrupt_switch_hook, ());
}
#endif
const unsigned int VECTOR_BASE = 0x00;
+2
View File
@@ -341,6 +341,8 @@ rt_hw_context_switch_interrupt_do:
ldr r6, [r6]
ldr sp, [r6] @ get new task's stack pointer
bl rt_interrupt_hook
#ifdef RT_USING_FPU
/* fpu context */
ldmfd sp!, {r6}