1 #ifndef __XEN_SMP_H__
2 #define __XEN_SMP_H__
3
4 #include <asm/smp.h>
5
6 /*
7 * stops all CPUs but the current one:
8 */
9 extern void smp_send_stop(void);
10
11 extern void smp_send_event_check_mask(const cpumask_t *mask);
12 #define smp_send_event_check_cpu(cpu) \
13 smp_send_event_check_mask(cpumask_of(cpu))
14
15 extern void smp_send_state_dump(unsigned int cpu);
16
17 /*
18 * Prepare machine for booting other CPUs.
19 */
20 extern void smp_prepare_cpus(unsigned int max_cpus);
21
22 /*
23 * Final polishing of CPUs
24 */
25 extern void smp_cpus_done(void);
26
27 /*
28 * Call a function on all other processors
29 */
30 extern void smp_call_function(
31 void (*func) (void *info),
32 void *info,
33 int wait);
34
35 /*
36 * Call a function on a selection of processors
37 */
38 extern void on_selected_cpus(
39 const cpumask_t *selected,
40 void (*func) (void *info),
41 void *info,
42 int wait);
43
44 /*
45 * Mark the boot cpu "online" so that it can call console drivers in
46 * printk() and can access its per-cpu storage.
47 */
48 void smp_prepare_boot_cpu(void);
49
50 /*
51 * Call a function on all processors
52 */
on_each_cpu(void (* func)(void * info),void * info,int wait)53 static inline void on_each_cpu(
54 void (*func) (void *info),
55 void *info,
56 int wait)
57 {
58 on_selected_cpus(&cpu_online_map, func, info, wait);
59 }
60
61 /*
62 * Call a function on the current CPU
63 */
64 void smp_call_function_interrupt(void);
65
66 void smp_send_call_function_mask(const cpumask_t *mask);
67
68 #define smp_processor_id() raw_smp_processor_id()
69
70 int alloc_cpu_id(void);
71
72 extern void *stack_base[NR_CPUS];
73
74 void initialize_cpu_data(unsigned int cpu);
75
76 #endif /* __XEN_SMP_H__ */
77