Merge branch 'master' of postpeta.pccluster.org:mckernel
This commit is contained in:
@ -510,6 +510,11 @@ void cpu_halt(void)
|
|||||||
asm volatile("hlt");
|
asm volatile("hlt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cpu_safe_halt(void)
|
||||||
|
{
|
||||||
|
asm volatile("sti; hlt");
|
||||||
|
}
|
||||||
|
|
||||||
void cpu_enable_interrupt(void)
|
void cpu_enable_interrupt(void)
|
||||||
{
|
{
|
||||||
asm volatile("sti");
|
asm volatile("sti");
|
||||||
|
|||||||
@ -1554,16 +1554,16 @@ void release_process(struct process *proc)
|
|||||||
|
|
||||||
static void idle(void)
|
static void idle(void)
|
||||||
{
|
{
|
||||||
//unsigned int flags;
|
|
||||||
//flags = ihk_mc_spinlock_lock(&cpu_status_lock);
|
|
||||||
//ihk_mc_spinlock_unlock(&cpu_status_lock, flags);
|
|
||||||
cpu_local_var(status) = CPU_STATUS_IDLE;
|
cpu_local_var(status) = CPU_STATUS_IDLE;
|
||||||
|
cpu_enable_interrupt();
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
cpu_enable_interrupt();
|
|
||||||
schedule();
|
schedule();
|
||||||
//cpu_local_var(status) = CPU_STATUS_IDLE;
|
cpu_disable_interrupt();
|
||||||
cpu_halt();
|
if (cpu_local_var(status) == CPU_STATUS_IDLE)
|
||||||
|
cpu_safe_halt();
|
||||||
|
else
|
||||||
|
cpu_enable_interrupt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
void cpu_enable_interrupt(void);
|
void cpu_enable_interrupt(void);
|
||||||
void cpu_disable_interrupt(void);
|
void cpu_disable_interrupt(void);
|
||||||
void cpu_halt(void);
|
void cpu_halt(void);
|
||||||
|
void cpu_safe_halt(void);
|
||||||
void cpu_restore_interrupt(unsigned long);
|
void cpu_restore_interrupt(unsigned long);
|
||||||
void cpu_pause(void);
|
void cpu_pause(void);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user