Make idle loop not miss a chance to schedule

Prevents the case where McKernel misses one chance to schedule a
task when an interrupt occurs just after enabling interrupt and
just before executing "halt" in the idle loop (in kernel/process.c).

refs #45
This commit is contained in:
Masamichi Takagi
2014-06-12 10:58:05 +09:00
parent bbb7f77706
commit a9bebf1e14
3 changed files with 12 additions and 6 deletions

View File

@ -510,6 +510,11 @@ void cpu_halt(void)
asm volatile("hlt");
}
void cpu_safe_halt(void)
{
asm volatile("sti; hlt");
}
void cpu_enable_interrupt(void)
{
asm volatile("sti");