Merge branch 'parisc-3.15-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller...
[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;
8b646bd7 19
8239c25f 20extern int __cpu_up(unsigned int cpu, struct task_struct *tidle);
dbd70fb4 21
ca9fc75a 22extern void arch_send_call_function_single_ipi(int cpu);
630cd046 23extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
ca9fc75a 24
8b646bd7
MS
25extern void smp_call_online_cpu(void (*func)(void *), void *);
26extern void smp_call_ipl_cpu(void (*func)(void *), void *);
2c2df118 27
8b646bd7
MS
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);
50ab9a9a
HC
34extern void smp_cpu_set_polarization(int cpu, int val);
35extern int smp_cpu_get_polarization(int cpu);
d80512f8 36extern void smp_fill_possible_mask(void);
59b69787 37
2c2df118
HC
38#else /* CONFIG_SMP */
39
8b646bd7 40static inline void smp_call_ipl_cpu(void (*func)(void *), void *data)
2c2df118
HC
41{
42 func(data);
43}
44
8b646bd7 45static inline void smp_call_online_cpu(void (*func)(void *), void *data)
1943f53c 46{
8b646bd7 47 func(data);
1943f53c
MH
48}
49
0d0e471b 50static inline int smp_find_processor_id(u16 address) { return 0; }
29a877fa 51static inline int smp_store_status(int cpu) { return 0; }
8b646bd7
MS
52static inline int smp_vcpu_scheduled(int cpu) { return 1; }
53static inline void smp_yield_cpu(int cpu) { }
54static inline void smp_yield(void) { }
d80512f8 55static inline void smp_fill_possible_mask(void) { }
59b69787 56
e7c46c66
HC
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
c20c89a6 67#endif /* CONFIG_SMP */
1da177e4 68
1e489518
HC
69#ifdef CONFIG_HOTPLUG_CPU
70extern int smp_rescan_cpus(void);
da7f51c1 71extern void __noreturn cpu_die(void);
8b646bd7
MS
72extern void __cpu_die(unsigned int cpu);
73extern int __cpu_disable(void);
1e489518
HC
74#else
75static inline int smp_rescan_cpus(void) { return 0; }
da7f51c1 76static inline void cpu_die(void) { }
1e489518
HC
77#endif
78
c20c89a6 79#endif /* __ASM_SMP_H */
This page took 0.769835 seconds and 5 git commands to generate.