aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/percpu.h
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-05-18 15:13:45 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-05-18 15:13:45 +0100
commit00c51c29c14611cdb4164fc64e89b6e7ad6c1df2 (patch)
tree4c4462e5d66a0bc71b12f669a3a3c9a17c682b1d /xen/include/asm-x86/percpu.h
parentc12bbde846af61d1b8441da6c627181ccbc7a157 (diff)
downloadxen-00c51c29c14611cdb4164fc64e89b6e7ad6c1df2.tar.gz
xen-00c51c29c14611cdb4164fc64e89b6e7ad6c1df2.tar.bz2
xen-00c51c29c14611cdb4164fc64e89b6e7ad6c1df2.zip
x86: Dynamically allocate percpu data area when a CPU comes online.
At the same time, the data area starts life zeroed. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/include/asm-x86/percpu.h')
-rw-r--r--xen/include/asm-x86/percpu.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/xen/include/asm-x86/percpu.h b/xen/include/asm-x86/percpu.h
index d8860203ae..fb1d4140ec 100644
--- a/xen/include/asm-x86/percpu.h
+++ b/xen/include/asm-x86/percpu.h
@@ -1,17 +1,20 @@
#ifndef __X86_PERCPU_H__
#define __X86_PERCPU_H__
-#define PERCPU_SHIFT 13
-#define PERCPU_SIZE (1UL << PERCPU_SHIFT)
+#ifndef __ASSEMBLY__
+extern char __per_cpu_start[], __per_cpu_data_end[];
+extern unsigned long __per_cpu_offset[NR_CPUS];
+void percpu_init_areas(void);
+#endif
/* Separate out the type, so (int[3], foo) works. */
#define __DEFINE_PER_CPU(type, name, suffix) \
- __attribute__((__section__(".data.percpu" #suffix))) \
+ __attribute__((__section__(".bss.percpu" #suffix))) \
__typeof__(type) per_cpu_##name
/* var is in discarded region: offset to particular copy we want */
#define per_cpu(var, cpu) \
- (*RELOC_HIDE(&per_cpu__##var, ((unsigned int)(cpu))<<PERCPU_SHIFT))
+ (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]))
#define __get_cpu_var(var) \
(per_cpu(var, smp_processor_id()))