summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlepton <ytht.net@gmail.com>2006-04-18 22:21:10 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-19 09:13:50 -0700
commit1bb858f27eadc54e24dfa351fcae724cff426de2 (patch)
tree2c0812570c3a063cf1a0d6f334218e3dc1cce115
parentab5703b34237da7034800ec2466ceebf88a7e685 (diff)
downloadop-kernel-dev-1bb858f27eadc54e24dfa351fcae724cff426de2.zip
op-kernel-dev-1bb858f27eadc54e24dfa351fcae724cff426de2.tar.gz
[PATCH] asm-i386/atomic.h: local_irq_save should be used instead of local_irq_disable
atomic_add_return() if CONFIG_M386 can accidentally enable local interrupts. Signed-off-by: Lepton Wu <ytht.net@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--include/asm-i386/atomic.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/asm-i386/atomic.h b/include/asm-i386/atomic.h
index 22d80ec..4ddce52 100644
--- a/include/asm-i386/atomic.h
+++ b/include/asm-i386/atomic.h
@@ -183,6 +183,7 @@ static __inline__ int atomic_add_return(int i, atomic_t *v)
{
int __i;
#ifdef CONFIG_M386
+ unsigned long flags;
if(unlikely(boot_cpu_data.x86==3))
goto no_xadd;
#endif
@@ -196,10 +197,10 @@ static __inline__ int atomic_add_return(int i, atomic_t *v)
#ifdef CONFIG_M386
no_xadd: /* Legacy 386 processor */
- local_irq_disable();
+ local_irq_save(flags);
__i = atomic_read(v);
atomic_set(v, i + __i);
- local_irq_enable();
+ local_irq_restore(flags);
return i + __i;
#endif
}
OpenPOWER on IntegriCloud