aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2012-11-28 14:50:25 -0500
committerH. Peter Anvin <hpa@linux.intel.com>2012-11-29 16:23:02 -0500
commit7ac468b1300f35143a9b5b100e3970ca7ae1d9b8 (patch)
tree1c928b80c897acc8bf7f47de8ef3793c5ba30c2c
parentd55c5a93db2d5fa95f233ab153f594365d95b777 (diff)
x86, 386 removal: Remove CONFIG_XADD
All 486+ CPUs support XADD, so remove the fallback 386 support code. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> Link: http://lkml.kernel.org/r/1354132230-21854-4-git-send-email-hpa@linux.intel.com
-rw-r--r--arch/x86/Kconfig5
-rw-r--r--arch/x86/Kconfig.cpu3
-rw-r--r--arch/x86/include/asm/atomic.h16
-rw-r--r--arch/x86/include/asm/local.h18
-rw-r--r--arch/x86/um/Kconfig2
5 files changed, 2 insertions, 42 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index a1a662721f80..631b298ac5b3 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -171,13 +171,8 @@ config ARCH_MAY_HAVE_PC_FDC
171 def_bool y 171 def_bool y
172 depends on ISA_DMA_API 172 depends on ISA_DMA_API
173 173
174config RWSEM_GENERIC_SPINLOCK
175 def_bool y
176 depends on !X86_XADD
177
178config RWSEM_XCHGADD_ALGORITHM 174config RWSEM_XCHGADD_ALGORITHM
179 def_bool y 175 def_bool y
180 depends on X86_XADD
181 176
182config GENERIC_CALIBRATE_DELAY 177config GENERIC_CALIBRATE_DELAY
183 def_bool y 178 def_bool y
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index 1290a696349e..52955eeeb1ef 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -304,9 +304,6 @@ config X86_L1_CACHE_SHIFT
304 default "4" if MELAN || M486 || MGEODEGX1 304 default "4" if MELAN || M486 || MGEODEGX1
305 default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX 305 default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX
306 306
307config X86_XADD
308 def_bool y
309
310config X86_PPRO_FENCE 307config X86_PPRO_FENCE
311 bool "PentiumPro memory ordering errata workaround" 308 bool "PentiumPro memory ordering errata workaround"
312 depends on M686 || M586MMX || M586TSC || M586 || M486 || MGEODEGX1 309 depends on M686 || M586MMX || M586TSC || M586 || M486 || MGEODEGX1
diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h
index b6c3b821acf6..722aa3b04624 100644
--- a/arch/x86/include/asm/atomic.h
+++ b/arch/x86/include/asm/atomic.h
@@ -172,23 +172,7 @@ static inline int atomic_add_negative(int i, atomic_t *v)
172 */ 172 */
173static inline int atomic_add_return(int i, atomic_t *v) 173static inline int atomic_add_return(int i, atomic_t *v)
174{ 174{
175#ifdef CONFIG_M386
176 int __i;
177 unsigned long flags;
178 if (unlikely(boot_cpu_data.x86 <= 3))
179 goto no_xadd;
180#endif
181 /* Modern 486+ processor */
182 return i + xadd(&v->counter, i); 175 return i + xadd(&v->counter, i);
183
184#ifdef CONFIG_M386
185no_xadd: /* Legacy 386 processor */
186 raw_local_irq_save(flags);
187 __i = atomic_read(v);
188 atomic_set(v, i + __i);
189 raw_local_irq_restore(flags);
190 return i + __i;
191#endif
192} 176}
193 177
194/** 178/**
diff --git a/arch/x86/include/asm/local.h b/arch/x86/include/asm/local.h
index c8bed0da434a..2d89e3980cbd 100644
--- a/arch/x86/include/asm/local.h
+++ b/arch/x86/include/asm/local.h
@@ -124,27 +124,11 @@ static inline int local_add_negative(long i, local_t *l)
124 */ 124 */
125static inline long local_add_return(long i, local_t *l) 125static inline long local_add_return(long i, local_t *l)
126{ 126{
127 long __i; 127 long __i = i;
128#ifdef CONFIG_M386
129 unsigned long flags;
130 if (unlikely(boot_cpu_data.x86 <= 3))
131 goto no_xadd;
132#endif
133 /* Modern 486+ processor */
134 __i = i;
135 asm volatile(_ASM_XADD "%0, %1;" 128 asm volatile(_ASM_XADD "%0, %1;"
136 : "+r" (i), "+m" (l->a.counter) 129 : "+r" (i), "+m" (l->a.counter)
137 : : "memory"); 130 : : "memory");
138 return i + __i; 131 return i + __i;
139
140#ifdef CONFIG_M386
141no_xadd: /* Legacy 386 processor */
142 local_irq_save(flags);
143 __i = local_read(l);
144 local_set(l, i + __i);
145 local_irq_restore(flags);
146 return i + __i;
147#endif
148} 132}
149 133
150static inline long local_sub_return(long i, local_t *l) 134static inline long local_sub_return(long i, local_t *l)
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
index 07611759ce35..b0c30dae9f55 100644
--- a/arch/x86/um/Kconfig
+++ b/arch/x86/um/Kconfig
@@ -31,7 +31,7 @@ config X86_64
31 select MODULES_USE_ELF_RELA 31 select MODULES_USE_ELF_RELA
32 32
33config RWSEM_XCHGADD_ALGORITHM 33config RWSEM_XCHGADD_ALGORITHM
34 def_bool X86_XADD && 64BIT 34 def_bool 64BIT
35 35
36config RWSEM_GENERIC_SPINLOCK 36config RWSEM_GENERIC_SPINLOCK
37 def_bool !RWSEM_XCHGADD_ALGORITHM 37 def_bool !RWSEM_XCHGADD_ALGORITHM