aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-07-08 18:06:41 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-16 04:57:59 -0400
commita9e7062d7339f1a1df2b6d7e5d595c7d55b56bfb (patch)
tree34243fea71942ac2622cbd550b3d985ae0c89bb6 /arch
parentce87b3d326de733c72b47662f106ee6cd699a20f (diff)
xen: move smp setup into smp.c
Move all the smp_ops setup into smp.c, allowing a lot of things to become static. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Cc: Stephen Tweedie <sct@redhat.com> Cc: Eduardo Habkost <ehabkost@redhat.com> Cc: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/xen/enlighten.c19
-rw-r--r--arch/x86/xen/smp.c34
-rw-r--r--arch/x86/xen/xen-ops.h13
3 files changed, 32 insertions, 34 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index ada2e1a141df..a85f447b8d00 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1237,21 +1237,6 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = {
1237 .set_fixmap = xen_set_fixmap, 1237 .set_fixmap = xen_set_fixmap,
1238}; 1238};
1239 1239
1240#ifdef CONFIG_SMP
1241static const struct smp_ops xen_smp_ops __initdata = {
1242 .smp_prepare_boot_cpu = xen_smp_prepare_boot_cpu,
1243 .smp_prepare_cpus = xen_smp_prepare_cpus,
1244 .cpu_up = xen_cpu_up,
1245 .smp_cpus_done = xen_smp_cpus_done,
1246
1247 .smp_send_stop = xen_smp_send_stop,
1248 .smp_send_reschedule = xen_smp_send_reschedule,
1249
1250 .send_call_func_ipi = xen_smp_send_call_function_ipi,
1251 .send_call_func_single_ipi = xen_smp_send_call_function_single_ipi,
1252};
1253#endif /* CONFIG_SMP */
1254
1255static void xen_reboot(int reason) 1240static void xen_reboot(int reason)
1256{ 1241{
1257 struct sched_shutdown r = { .reason = reason }; 1242 struct sched_shutdown r = { .reason = reason };
@@ -1340,9 +1325,7 @@ asmlinkage void __init xen_start_kernel(void)
1340 have_vcpu_info_placement = 0; 1325 have_vcpu_info_placement = 0;
1341#endif 1326#endif
1342 1327
1343#ifdef CONFIG_SMP 1328 xen_smp_init();
1344 smp_ops = xen_smp_ops;
1345#endif
1346 1329
1347 /* Get mfn list */ 1330 /* Get mfn list */
1348 if (!xen_feature(XENFEAT_auto_translated_physmap)) 1331 if (!xen_feature(XENFEAT_auto_translated_physmap))
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 233156f39b7f..91fae8ff756e 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -152,7 +152,7 @@ void __init xen_fill_possible_map(void)
152 } 152 }
153} 153}
154 154
155void __init xen_smp_prepare_boot_cpu(void) 155static void __init xen_smp_prepare_boot_cpu(void)
156{ 156{
157 int cpu; 157 int cpu;
158 158
@@ -176,7 +176,7 @@ void __init xen_smp_prepare_boot_cpu(void)
176 xen_setup_vcpu_info_placement(); 176 xen_setup_vcpu_info_placement();
177} 177}
178 178
179void __init xen_smp_prepare_cpus(unsigned int max_cpus) 179static void __init xen_smp_prepare_cpus(unsigned int max_cpus)
180{ 180{
181 unsigned cpu; 181 unsigned cpu;
182 182
@@ -276,7 +276,7 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
276 return 0; 276 return 0;
277} 277}
278 278
279int __cpuinit xen_cpu_up(unsigned int cpu) 279static int __cpuinit xen_cpu_up(unsigned int cpu)
280{ 280{
281 struct task_struct *idle = idle_task(cpu); 281 struct task_struct *idle = idle_task(cpu);
282 int rc; 282 int rc;
@@ -319,7 +319,7 @@ int __cpuinit xen_cpu_up(unsigned int cpu)
319 return 0; 319 return 0;
320} 320}
321 321
322void xen_smp_cpus_done(unsigned int max_cpus) 322static void xen_smp_cpus_done(unsigned int max_cpus)
323{ 323{
324} 324}
325 325
@@ -335,12 +335,12 @@ static void stop_self(void *v)
335 BUG(); 335 BUG();
336} 336}
337 337
338void xen_smp_send_stop(void) 338static void xen_smp_send_stop(void)
339{ 339{
340 smp_call_function(stop_self, NULL, 0); 340 smp_call_function(stop_self, NULL, 0);
341} 341}
342 342
343void xen_smp_send_reschedule(int cpu) 343static void xen_smp_send_reschedule(int cpu)
344{ 344{
345 xen_send_IPI_one(cpu, XEN_RESCHEDULE_VECTOR); 345 xen_send_IPI_one(cpu, XEN_RESCHEDULE_VECTOR);
346} 346}
@@ -355,7 +355,7 @@ static void xen_send_IPI_mask(cpumask_t mask, enum ipi_vector vector)
355 xen_send_IPI_one(cpu, vector); 355 xen_send_IPI_one(cpu, vector);
356} 356}
357 357
358void xen_smp_send_call_function_ipi(cpumask_t mask) 358static void xen_smp_send_call_function_ipi(cpumask_t mask)
359{ 359{
360 int cpu; 360 int cpu;
361 361
@@ -370,7 +370,7 @@ void xen_smp_send_call_function_ipi(cpumask_t mask)
370 } 370 }
371} 371}
372 372
373void xen_smp_send_call_function_single_ipi(int cpu) 373static void xen_smp_send_call_function_single_ipi(int cpu)
374{ 374{
375 xen_send_IPI_mask(cpumask_of_cpu(cpu), XEN_CALL_FUNCTION_SINGLE_VECTOR); 375 xen_send_IPI_mask(cpumask_of_cpu(cpu), XEN_CALL_FUNCTION_SINGLE_VECTOR);
376} 376}
@@ -394,3 +394,21 @@ static irqreturn_t xen_call_function_single_interrupt(int irq, void *dev_id)
394 394
395 return IRQ_HANDLED; 395 return IRQ_HANDLED;
396} 396}
397
398static const struct smp_ops xen_smp_ops __initdata = {
399 .smp_prepare_boot_cpu = xen_smp_prepare_boot_cpu,
400 .smp_prepare_cpus = xen_smp_prepare_cpus,
401 .cpu_up = xen_cpu_up,
402 .smp_cpus_done = xen_smp_cpus_done,
403
404 .smp_send_stop = xen_smp_send_stop,
405 .smp_send_reschedule = xen_smp_send_reschedule,
406
407 .send_call_func_ipi = xen_smp_send_call_function_ipi,
408 .send_call_func_single_ipi = xen_smp_send_call_function_single_ipi,
409};
410
411void __init xen_smp_init(void)
412{
413 smp_ops = xen_smp_ops;
414}
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index 77354d204257..81a779fc9b26 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -47,17 +47,14 @@ void xen_mark_init_mm_pinned(void);
47void __init xen_fill_possible_map(void); 47void __init xen_fill_possible_map(void);
48 48
49void __init xen_setup_vcpu_info_placement(void); 49void __init xen_setup_vcpu_info_placement(void);
50void xen_smp_prepare_boot_cpu(void);
51void xen_smp_prepare_cpus(unsigned int max_cpus);
52int xen_cpu_up(unsigned int cpu);
53void xen_smp_cpus_done(unsigned int max_cpus);
54 50
55void xen_smp_send_stop(void); 51#ifdef CONFIG_SMP
56void xen_smp_send_reschedule(int cpu); 52void xen_smp_init(void);
57void xen_smp_send_call_function_ipi(cpumask_t mask);
58void xen_smp_send_call_function_single_ipi(int cpu);
59 53
60extern cpumask_t xen_cpu_initialized_map; 54extern cpumask_t xen_cpu_initialized_map;
55#else
56static inline void xen_smp_init(void) {}
57#endif
61 58
62 59
63/* Declare an asm function, along with symbols needed to make it 60/* Declare an asm function, along with symbols needed to make it