--- linux-2.4.16-9mdk/arch/i386/kernel/apm.c.combined Sun Dec 23 22:15:43 2001 +++ linux-2.4.16-9mdk/arch/i386/kernel/apm.c Fri Jan 4 22:26:09 2002 @@ -761,6 +761,7 @@ static void (*sys_idle)(void); static unsigned int last_jiffies = 0; static unsigned int last_stime = 0; +extern void default_idle(void); /** * apm_cpu_idle - cpu idling for APM capable Linux @@ -774,8 +775,8 @@ { static int use_apm_idle = 0; int apm_is_idle = 0; - unsigned int t1 = jiffies - last_jiffies; - unsigned int t2; + unsigned long t1 = jiffies - last_jiffies; + unsigned long t2; recalc: if(t1 > IDLE_CALC_LIMIT) goto reset; @@ -799,15 +800,8 @@ t1 = jiffies; switch (apm_do_idle()) { case 0: apm_is_idle = 1; - if (t1 != jiffies) { - if (t2) { - t2 = IDLE_LEAKY_MAX; - continue; - } - } else if (t2) { - t2--; + if (t1 != jiffies) continue; - } break; case 1: apm_is_idle = 1; break; @@ -816,6 +810,8 @@ if (sys_idle) sys_idle(); + else + default_idle(); t1 = jiffies - last_jiffies; if (t1 > HARD_IDLE_TIMEOUT) --- linux-2.4.16-9mdk/arch/i386/kernel/process.c.org Thu Dec 13 13:12:46 2001 +++ linux-2.4.16-9mdk/arch/i386/kernel/process.c Fri Jan 4 22:24:47 2002 @@ -77,8 +77,10 @@ /* * We use this if we don't have any better * idle routine.. + * It is also called from apm_cpu_idle if BIOS does not stop clock + * for us */ -static void default_idle(void) +void default_idle(void) { if (current_cpu_data.hlt_works_ok && !hlt_counter) { __cli();