aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-i386/percpu.h
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2007-05-02 13:27:16 -0400
committerAndi Kleen <andi@basil.nowhere.org>2007-05-02 13:27:16 -0400
commit978c038ec944e4f2c940b0975c6acb433203a9be (patch)
treef4bab9c040e5c4876fadeea765fed623f148ad69 /include/asm-i386/percpu.h
parent7c3576d261ce046789a7db14f43303f8120910c7 (diff)
[PATCH] i386: cleanups to help using per-cpu variables from asm
This patch does a few small cleanups: - use PER_CPU_NAME to generate the names of per-cpu variables - use lea to add the per_cpu offset in PER_CPU(), because it doesn't affect condition flags - add PER_CPU_VAR which allows direct access to pre-cpu variables with the %fs: prefix on SMP. Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com> Signed-off-by: Andi Kleen <ak@suse.de> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Andi Kleen <ak@suse.de>
Diffstat (limited to 'include/asm-i386/percpu.h')
-rw-r--r--include/asm-i386/percpu.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/asm-i386/percpu.h b/include/asm-i386/percpu.h
index c5f12f0d9c23..cdcb63db30a9 100644
--- a/include/asm-i386/percpu.h
+++ b/include/asm-i386/percpu.h
@@ -16,12 +16,14 @@
16 * PER_CPU(cpu_gdt_descr, %ebx) 16 * PER_CPU(cpu_gdt_descr, %ebx)
17 */ 17 */
18#ifdef CONFIG_SMP 18#ifdef CONFIG_SMP
19#define PER_CPU(var, reg) \ 19#define PER_CPU(var, reg) \
20 movl %fs:per_cpu__this_cpu_off, reg; \ 20 movl %fs:per_cpu__##this_cpu_off, reg; \
21 addl $per_cpu__##var, reg 21 lea per_cpu__##var(reg), reg
22#define PER_CPU_VAR(var) %fs:per_cpu__##var
22#else /* ! SMP */ 23#else /* ! SMP */
23#define PER_CPU(var, reg) \ 24#define PER_CPU(var, reg) \
24 movl $per_cpu__##var, reg; 25 movl $per_cpu__##var, reg
26#define PER_CPU_VAR(var) per_cpu__##var
25#endif /* SMP */ 27#endif /* SMP */
26 28
27#else /* ...!ASSEMBLY */ 29#else /* ...!ASSEMBLY */