Commit | Line | Data |
---|---|---|
1da177e4 | 1 | /* |
a53c8fab | 2 | * Copyright IBM Corp. 1999, 2012 |
c20c89a6 HC |
3 | * Author(s): Denis Joseph Barrow, |
4 | * Martin Schwidefsky <schwidefsky@de.ibm.com>, | |
5 | * Heiko Carstens <heiko.carstens@de.ibm.com>, | |
1da177e4 LT |
6 | */ |
7 | #ifndef __ASM_SMP_H | |
8 | #define __ASM_SMP_H | |
9 | ||
e7c46c66 HC |
10 | #include <asm/sigp.h> |
11 | ||
c20c89a6 | 12 | #ifdef CONFIG_SMP |
1da177e4 | 13 | |
a0616cde | 14 | #include <asm/lowcore.h> |
2b67fc46 | 15 | |
7b468488 | 16 | #define raw_smp_processor_id() (S390_lowcore.cpu_nr) |
1da177e4 | 17 | |
dbd70fb4 | 18 | extern struct mutex smp_cpu_state_mutex; |
10ad34bc MS |
19 | extern unsigned int smp_cpu_mt_shift; |
20 | extern unsigned int smp_cpu_mtid; | |
1a36a39e | 21 | extern __vector128 __initdata boot_cpu_vector_save_area[__NUM_VXRS]; |
8b646bd7 | 22 | |
8239c25f | 23 | extern int __cpu_up(unsigned int cpu, struct task_struct *tidle); |
dbd70fb4 | 24 | |
ca9fc75a | 25 | extern void arch_send_call_function_single_ipi(int cpu); |
630cd046 | 26 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); |
ca9fc75a | 27 | |
8b646bd7 MS |
28 | extern void smp_call_online_cpu(void (*func)(void *), void *); |
29 | extern void smp_call_ipl_cpu(void (*func)(void *), void *); | |
2c2df118 | 30 | |
8b646bd7 MS |
31 | extern int smp_find_processor_id(u16 address); |
32 | extern int smp_store_status(int cpu); | |
1592a8e4 | 33 | extern void smp_save_dump_cpus(void); |
8b646bd7 MS |
34 | extern int smp_vcpu_scheduled(int cpu); |
35 | extern void smp_yield_cpu(int cpu); | |
50ab9a9a HC |
36 | extern void smp_cpu_set_polarization(int cpu, int val); |
37 | extern int smp_cpu_get_polarization(int cpu); | |
d80512f8 | 38 | extern void smp_fill_possible_mask(void); |
59b69787 | 39 | |
2c2df118 HC |
40 | #else /* CONFIG_SMP */ |
41 | ||
10ad34bc MS |
42 | #define smp_cpu_mtid 0 |
43 | ||
8b646bd7 | 44 | static inline void smp_call_ipl_cpu(void (*func)(void *), void *data) |
2c2df118 HC |
45 | { |
46 | func(data); | |
47 | } | |
48 | ||
8b646bd7 | 49 | static inline void smp_call_online_cpu(void (*func)(void *), void *data) |
1943f53c | 50 | { |
8b646bd7 | 51 | func(data); |
1943f53c MH |
52 | } |
53 | ||
0d0e471b | 54 | static inline int smp_find_processor_id(u16 address) { return 0; } |
29a877fa | 55 | static inline int smp_store_status(int cpu) { return 0; } |
8b646bd7 MS |
56 | static inline int smp_vcpu_scheduled(int cpu) { return 1; } |
57 | static inline void smp_yield_cpu(int cpu) { } | |
d80512f8 | 58 | static inline void smp_fill_possible_mask(void) { } |
59b69787 | 59 | |
f4192bf2 MH |
60 | #endif /* CONFIG_SMP */ |
61 | ||
e7c46c66 HC |
62 | static inline void smp_stop_cpu(void) |
63 | { | |
64 | u16 pcpu = stap(); | |
65 | ||
66 | for (;;) { | |
67 | __pcpu_sigp(pcpu, SIGP_STOP, 0, NULL); | |
68 | cpu_relax(); | |
69 | } | |
70 | } | |
71 | ||
1e489518 HC |
72 | #ifdef CONFIG_HOTPLUG_CPU |
73 | extern int smp_rescan_cpus(void); | |
da7f51c1 | 74 | extern void __noreturn cpu_die(void); |
8b646bd7 MS |
75 | extern void __cpu_die(unsigned int cpu); |
76 | extern int __cpu_disable(void); | |
1e489518 HC |
77 | #else |
78 | static inline int smp_rescan_cpus(void) { return 0; } | |
da7f51c1 | 79 | static inline void cpu_die(void) { } |
1e489518 HC |
80 | #endif |
81 | ||
c20c89a6 | 82 | #endif /* __ASM_SMP_H */ |