Skip to contentSkip to conversation

espfix Use scaling addressing mode rather than shifting in PER_CPU

PATCH New Jeremy Fitzhardinge 1 participant 1 message Oct 11, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 espfix Use scaling addressing mode rather than shifting in PER_CPU

Use the x86 scaling addressing mode rather than shifting to multiplying by 4 in PER_CPU().

Cc Andrew Morton <[email protected]>
Cc Stas Sergeev <[email protected]>
Cc Zachary Amsden <[email protected]>
Cc Chuck Ebbert <[email protected]>
Cc Jan Beulich <[email protected]>
Cc Andi Kleen <[email protected]>
include/asm-i386/percpu.h +0 -0
diff -r ea4549dd86a4 include/asm-i386/percpu.h
@@ -19,8 +19,7 @@
 */

#ifdef CONFIG_SMP
#define PER_CPU(var, cpu) \
- shll $2, cpu; \
- movl __per_cpu_offset(cpu), cpu; \

+	movl __per_cpu_offset(,cpu,4), cpu;	\
	addl $per_cpu__/**/var, cpu;

#else /* ! SMP */
#define PER_CPU(var, cpu) \