2005-04-17 00:20:36 +02:00
|
|
|
#ifndef __ARCH_I386_PERCPU__
|
|
|
|
#define __ARCH_I386_PERCPU__
|
|
|
|
|
2006-12-07 02:14:01 +01:00
|
|
|
#ifndef __ASSEMBLY__
|
2005-04-17 00:20:36 +02:00
|
|
|
#include <asm-generic/percpu.h>
|
2006-12-07 02:14:01 +01:00
|
|
|
#else
|
|
|
|
|
|
|
|
/*
|
|
|
|
* PER_CPU finds an address of a per-cpu variable.
|
|
|
|
*
|
|
|
|
* Args:
|
|
|
|
* var - variable name
|
|
|
|
* cpu - 32bit register containing the current CPU number
|
|
|
|
*
|
|
|
|
* The resulting address is stored in the "cpu" argument.
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* PER_CPU(cpu_gdt_descr, %ebx)
|
|
|
|
*/
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
#define PER_CPU(var, cpu) \
|
|
|
|
movl __per_cpu_offset(,cpu,4), cpu; \
|
2007-05-02 19:27:05 +02:00
|
|
|
addl $per_cpu__##var, cpu;
|
2006-12-07 02:14:01 +01:00
|
|
|
#else /* ! SMP */
|
|
|
|
#define PER_CPU(var, cpu) \
|
2007-05-02 19:27:05 +02:00
|
|
|
movl $per_cpu__##var, cpu;
|
2006-12-07 02:14:01 +01:00
|
|
|
#endif /* SMP */
|
|
|
|
|
|
|
|
#endif /* !__ASSEMBLY__ */
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
#endif /* __ARCH_I386_PERCPU__ */
|