diff -Nru linux/arch/mips/kernel/entry.S.orig linux/arch/mips/kernel/entry.S --- linux/arch/mips/kernel/entry.S.orig 2004-03-16 17:50:52.000000000 -0800 +++ linux/arch/mips/kernel/entry.S 2004-03-16 17:50:37.000000000 -0800 @@ -60,6 +60,7 @@ sw t0, TI_PRE_COUNT($28) local_irq_enable t0 jal schedule + sw zero, TI_PRE_COUNT($28) local_irq_disable t0 b need_resched #endif diff -Nru linux/include/asm-mips/hardirq.h.orig linux/include/asm-mips/hardirq.h --- linux/include/asm-mips/hardirq.h.orig 2004-03-16 11:04:04.000000000 -0800 +++ linux/include/asm-mips/hardirq.h 2004-03-16 17:32:31.000000000 -0800 @@ -81,7 +81,7 @@ #ifdef CONFIG_PREEMPT # include -# define in_atomic() (preempt_count() != kernel_locked()) +# define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked()) # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) #else # define in_atomic() (preempt_count() != 0) diff -Nru linux/include/asm-mips/stackframe.h.orig linux/include/asm-mips/stackframe.h --- linux/include/asm-mips/stackframe.h.orig 2003-10-02 14:38:06.000000000 -0700 +++ linux/include/asm-mips/stackframe.h 2004-03-16 17:24:03.000000000 -0800 @@ -102,17 +102,6 @@ .endm #endif -#ifdef CONFIG_PREEMPT - .macro bump_lock_count - lw t0, TI_PRE_COUNT($28) - addiu t0, t0, 1 - sw t0, TI_PRE_COUNT($28) - .endm -#else - .macro bump_lock_count - .endm -#endif - .macro SAVE_SOME .set push .set reorder @@ -149,7 +138,6 @@ LONG_S $31, PT_R31(sp) ori $28, sp, _THREAD_MASK xori $28, _THREAD_MASK - bump_lock_count .set pop .endm