Loading...
1/*
2 * Copyright IBM Corp. 1999,2012
3 * Author(s): Denis Joseph Barrow,
4 * Martin Schwidefsky <schwidefsky@de.ibm.com>,
5 * Heiko Carstens <heiko.carstens@de.ibm.com>,
6 */
7#ifndef __ASM_SMP_H
8#define __ASM_SMP_H
9
10#ifdef CONFIG_SMP
11
12#include <asm/lowcore.h>
13
14#define raw_smp_processor_id() (S390_lowcore.cpu_nr)
15
16extern struct mutex smp_cpu_state_mutex;
17extern struct save_area *zfcpdump_save_areas[NR_CPUS + 1];
18
19extern int __cpu_up(unsigned int cpu, struct task_struct *tidle);
20
21extern void arch_send_call_function_single_ipi(int cpu);
22extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
23
24extern void smp_call_online_cpu(void (*func)(void *), void *);
25extern void smp_call_ipl_cpu(void (*func)(void *), void *);
26
27extern int smp_find_processor_id(u16 address);
28extern int smp_store_status(int cpu);
29extern int smp_vcpu_scheduled(int cpu);
30extern void smp_yield_cpu(int cpu);
31extern void smp_yield(void);
32extern void smp_stop_cpu(void);
33
34#else /* CONFIG_SMP */
35
36static inline void smp_call_ipl_cpu(void (*func)(void *), void *data)
37{
38 func(data);
39}
40
41static inline void smp_call_online_cpu(void (*func)(void *), void *data)
42{
43 func(data);
44}
45
46static inline int smp_find_processor_id(int address) { return 0; }
47static inline int smp_vcpu_scheduled(int cpu) { return 1; }
48static inline void smp_yield_cpu(int cpu) { }
49static inline void smp_yield(void) { }
50static inline void smp_stop_cpu(void) { }
51
52#endif /* CONFIG_SMP */
53
54#ifdef CONFIG_HOTPLUG_CPU
55extern int smp_rescan_cpus(void);
56extern void __noreturn cpu_die(void);
57extern void __cpu_die(unsigned int cpu);
58extern int __cpu_disable(void);
59#else
60static inline int smp_rescan_cpus(void) { return 0; }
61static inline void cpu_die(void) { }
62#endif
63
64#endif /* __ASM_SMP_H */
1/*
2 * Copyright IBM Corp. 1999, 2012
3 * Author(s): Denis Joseph Barrow,
4 * Martin Schwidefsky <schwidefsky@de.ibm.com>,
5 * Heiko Carstens <heiko.carstens@de.ibm.com>,
6 */
7#ifndef __ASM_SMP_H
8#define __ASM_SMP_H
9
10#include <asm/sigp.h>
11
12#ifdef CONFIG_SMP
13
14#include <asm/lowcore.h>
15
16#define raw_smp_processor_id() (S390_lowcore.cpu_nr)
17
18extern struct mutex smp_cpu_state_mutex;
19
20extern int __cpu_up(unsigned int cpu, struct task_struct *tidle);
21
22extern void arch_send_call_function_single_ipi(int cpu);
23extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
24
25extern void smp_call_online_cpu(void (*func)(void *), void *);
26extern void smp_call_ipl_cpu(void (*func)(void *), void *);
27
28extern int smp_find_processor_id(u16 address);
29extern int smp_store_status(int cpu);
30extern int smp_vcpu_scheduled(int cpu);
31extern void smp_yield_cpu(int cpu);
32extern void smp_yield(void);
33extern void smp_stop_cpu(void);
34extern void smp_cpu_set_polarization(int cpu, int val);
35extern int smp_cpu_get_polarization(int cpu);
36extern void smp_fill_possible_mask(void);
37
38#else /* CONFIG_SMP */
39
40static inline void smp_call_ipl_cpu(void (*func)(void *), void *data)
41{
42 func(data);
43}
44
45static inline void smp_call_online_cpu(void (*func)(void *), void *data)
46{
47 func(data);
48}
49
50static inline int smp_find_processor_id(u16 address) { return 0; }
51static inline int smp_store_status(int cpu) { return 0; }
52static inline int smp_vcpu_scheduled(int cpu) { return 1; }
53static inline void smp_yield_cpu(int cpu) { }
54static inline void smp_yield(void) { }
55static inline void smp_fill_possible_mask(void) { }
56
57static inline void smp_stop_cpu(void)
58{
59 u16 pcpu = stap();
60
61 for (;;) {
62 __pcpu_sigp(pcpu, SIGP_STOP, 0, NULL);
63 cpu_relax();
64 }
65}
66
67#endif /* CONFIG_SMP */
68
69#ifdef CONFIG_HOTPLUG_CPU
70extern int smp_rescan_cpus(void);
71extern void __noreturn cpu_die(void);
72extern void __cpu_die(unsigned int cpu);
73extern int __cpu_disable(void);
74#else
75static inline int smp_rescan_cpus(void) { return 0; }
76static inline void cpu_die(void) { }
77#endif
78
79#endif /* __ASM_SMP_H */