Skip to content

Commit

Permalink
i386: fix early usage of atomic_add_return and local_add_return on re…
Browse files Browse the repository at this point in the history
…al i386

The check (boot_cpu_data.x86 == 3) in atomic_add_return() and
local_add_return() fails, when those operations are used before
boot_cpu_data is filled in.

Change the check to (boot_cpu_data.x86 <= 3) to fix this.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Thomas Gleixner authored and Linus Torvalds committed May 24, 2007
1 parent 98d8256 commit 03491c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/asm-i386/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,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))
if(unlikely(boot_cpu_data.x86 <= 3))
goto no_xadd;
#endif
/* Modern 486+ processor */
Expand Down
2 changes: 1 addition & 1 deletion include/asm-i386/local.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static __inline__ long local_add_return(long i, local_t *l)
long __i;
#ifdef CONFIG_M386
unsigned long flags;
if(unlikely(boot_cpu_data.x86==3))
if(unlikely(boot_cpu_data.x86 <= 3))
goto no_xadd;
#endif
/* Modern 486+ processor */
Expand Down

0 comments on commit 03491c9

Please sign in to comment.