| 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 | |
| 16 | extern struct mutex smp_cpu_state_mutex; |
| 17 | |
| 18 | extern int __cpu_up(unsigned int cpu, struct task_struct *tidle); |
| 19 | |
| 20 | extern void arch_send_call_function_single_ipi(int cpu); |
| 21 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); |
| 22 | |
| 23 | extern void smp_call_online_cpu(void (*func)(void *), void *); |
| 24 | extern void smp_call_ipl_cpu(void (*func)(void *), void *); |
| 25 | |
| 26 | extern int smp_find_processor_id(u16 address); |
| 27 | extern int smp_store_status(int cpu); |
| 28 | extern int smp_vcpu_scheduled(int cpu); |
| 29 | extern void smp_yield_cpu(int cpu); |
| 30 | extern void smp_yield(void); |
| 31 | extern void smp_stop_cpu(void); |
| 32 | extern void smp_cpu_set_polarization(int cpu, int val); |
| 33 | extern int smp_cpu_get_polarization(int cpu); |
| 34 | extern void smp_fill_possible_mask(void); |
| 35 | |
| 36 | #else /* CONFIG_SMP */ |
| 37 | |
| 38 | static inline void smp_call_ipl_cpu(void (*func)(void *), void *data) |
| 39 | { |
| 40 | func(data); |
| 41 | } |
| 42 | |
| 43 | static inline void smp_call_online_cpu(void (*func)(void *), void *data) |
| 44 | { |
| 45 | func(data); |
| 46 | } |
| 47 | |
| 48 | static inline int smp_find_processor_id(u16 address) { return 0; } |
| 49 | static inline int smp_store_status(int cpu) { return 0; } |
| 50 | static inline int smp_vcpu_scheduled(int cpu) { return 1; } |
| 51 | static inline void smp_yield_cpu(int cpu) { } |
| 52 | static inline void smp_yield(void) { } |
| 53 | static inline void smp_stop_cpu(void) { } |
| 54 | static inline void smp_fill_possible_mask(void) { } |
| 55 | |
| 56 | #endif /* CONFIG_SMP */ |
| 57 | |
| 58 | #ifdef CONFIG_HOTPLUG_CPU |
| 59 | extern int smp_rescan_cpus(void); |
| 60 | extern void __noreturn cpu_die(void); |
| 61 | extern void __cpu_die(unsigned int cpu); |
| 62 | extern int __cpu_disable(void); |
| 63 | #else |
| 64 | static inline int smp_rescan_cpus(void) { return 0; } |
| 65 | static inline void cpu_die(void) { } |
| 66 | #endif |
| 67 | |
| 68 | #endif /* __ASM_SMP_H */ |