Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[deliverable/linux.git] / arch / s390 / include / asm / smp.h
CommitLineData
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 18extern struct mutex smp_cpu_state_mutex;
10ad34bc
MS
19extern unsigned int smp_cpu_mt_shift;
20extern unsigned int smp_cpu_mtid;
1a36a39e 21extern __vector128 __initdata boot_cpu_vector_save_area[__NUM_VXRS];
8b646bd7 22
8239c25f 23extern int __cpu_up(unsigned int cpu, struct task_struct *tidle);
dbd70fb4 24
ca9fc75a 25extern void arch_send_call_function_single_ipi(int cpu);
630cd046 26extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
ca9fc75a 27
8b646bd7
MS
28extern void smp_call_online_cpu(void (*func)(void *), void *);
29extern void smp_call_ipl_cpu(void (*func)(void *), void *);
2c2df118 30
8b646bd7
MS
31extern int smp_find_processor_id(u16 address);
32extern int smp_store_status(int cpu);
1592a8e4 33extern void smp_save_dump_cpus(void);
8b646bd7
MS
34extern int smp_vcpu_scheduled(int cpu);
35extern void smp_yield_cpu(int cpu);
50ab9a9a
HC
36extern void smp_cpu_set_polarization(int cpu, int val);
37extern int smp_cpu_get_polarization(int cpu);
d80512f8 38extern 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 44static inline void smp_call_ipl_cpu(void (*func)(void *), void *data)
2c2df118
HC
45{
46 func(data);
47}
48
8b646bd7 49static inline void smp_call_online_cpu(void (*func)(void *), void *data)
1943f53c 50{
8b646bd7 51 func(data);
1943f53c
MH
52}
53
0d0e471b 54static inline int smp_find_processor_id(u16 address) { return 0; }
29a877fa 55static inline int smp_store_status(int cpu) { return 0; }
8b646bd7
MS
56static inline int smp_vcpu_scheduled(int cpu) { return 1; }
57static inline void smp_yield_cpu(int cpu) { }
d80512f8 58static inline void smp_fill_possible_mask(void) { }
59b69787 59
f4192bf2
MH
60#endif /* CONFIG_SMP */
61
e7c46c66
HC
62static 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
73extern int smp_rescan_cpus(void);
da7f51c1 74extern void __noreturn cpu_die(void);
8b646bd7
MS
75extern void __cpu_die(unsigned int cpu);
76extern int __cpu_disable(void);
1e489518
HC
77#else
78static inline int smp_rescan_cpus(void) { return 0; }
da7f51c1 79static inline void cpu_die(void) { }
1e489518
HC
80#endif
81
c20c89a6 82#endif /* __ASM_SMP_H */
This page took 0.785672 seconds and 5 git commands to generate.