Fix: interrupt preemption
This commit is contained in:
@@ -73,16 +73,27 @@ void add_interrupt_task(uint64_t priority,
|
||||
|
||||
.priority = priority,
|
||||
.func = func,
|
||||
.param = param
|
||||
.param = param,
|
||||
|
||||
.is_start = false,
|
||||
};
|
||||
|
||||
global_interrupt_pool = _merge(global_interrupt_pool, newint);
|
||||
|
||||
while (global_interrupt_pool) {
|
||||
// LOG("check interrupt"); DEBUG_EXCEP(global_interrupt_pool->priority);
|
||||
if (global_interrupt_pool->is_start)
|
||||
return;
|
||||
global_interrupt_pool->is_start = true;
|
||||
global_interrupt_pool->func(global_interrupt_pool->param);
|
||||
global_interrupt_pool = _pop(global_interrupt_pool);
|
||||
}
|
||||
}
|
||||
|
||||
void init_interrupt(void)
|
||||
{
|
||||
W_SYSREG(cntp_ctl_el0, 1);
|
||||
_enable_interrupt();
|
||||
_enable_timer_irq(true);
|
||||
}
|
||||
|
||||
void irq_handler(void)
|
||||
@@ -99,6 +110,8 @@ void irq_handler(void)
|
||||
|
||||
void wfe(void)
|
||||
{
|
||||
return; // do nothing for now
|
||||
|
||||
if (!global_interrupt_pool) {
|
||||
// asm volatile("wfe");
|
||||
asm volatile("nop");
|
||||
|
||||
Reference in New Issue
Block a user