|
@@ -36,11 +36,8 @@ extern void ret_from_fork (void);
|
|
|
/* The idle loop. */
|
|
|
void default_idle (void)
|
|
|
{
|
|
|
- while (1) {
|
|
|
- while (! need_resched ())
|
|
|
- asm ("halt; nop; nop; nop; nop; nop" ::: "cc");
|
|
|
- schedule ();
|
|
|
- }
|
|
|
+ while (! need_resched ())
|
|
|
+ asm ("halt; nop; nop; nop; nop; nop" ::: "cc");
|
|
|
}
|
|
|
|
|
|
void (*idle)(void) = default_idle;
|
|
@@ -54,7 +51,14 @@ void (*idle)(void) = default_idle;
|
|
|
void cpu_idle (void)
|
|
|
{
|
|
|
/* endless idle loop with no priority at all */
|
|
|
- (*idle) ();
|
|
|
+ while (1) {
|
|
|
+ while (!need_resched())
|
|
|
+ (*idle) ();
|
|
|
+
|
|
|
+ preempt_enable_no_resched();
|
|
|
+ schedule();
|
|
|
+ preempt_disable();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/*
|