Skip to content

Commit

Permalink
[PATCH] asm-i386/atomic.h: local_irq_save should be used instead of l…
Browse files Browse the repository at this point in the history
…ocal_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>
  • Loading branch information
lepton authored and Linus Torvalds committed Apr 19, 2006
1 parent ab5703b commit 1bb858f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/asm-i386/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down

0 comments on commit 1bb858f

Please sign in to comment.