smp.h 1.9 KB
Newer Older
L
Linus Torvalds 已提交
1
/*
2
 *    Copyright IBM Corp. 1999, 2012
3 4 5
 *    Author(s): Denis Joseph Barrow,
 *		 Martin Schwidefsky <schwidefsky@de.ibm.com>,
 *		 Heiko Carstens <heiko.carstens@de.ibm.com>,
L
Linus Torvalds 已提交
6 7 8 9
 */
#ifndef __ASM_SMP_H
#define __ASM_SMP_H

10
#ifdef CONFIG_SMP
L
Linus Torvalds 已提交
11

12
#include <asm/lowcore.h>
13

14
#define raw_smp_processor_id()	(S390_lowcore.cpu_nr)
L
Linus Torvalds 已提交
15

16
extern struct mutex smp_cpu_state_mutex;
M
Martin Schwidefsky 已提交
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

M
Martin Schwidefsky 已提交
23 24
extern void smp_call_online_cpu(void (*func)(void *), void *);
extern void smp_call_ipl_cpu(void (*func)(void *), void *);
25

M
Martin Schwidefsky 已提交
26 27 28 29 30 31
extern int smp_find_processor_id(u16 address);
extern int smp_store_status(int cpu);
extern int smp_vcpu_scheduled(int cpu);
extern void smp_yield_cpu(int cpu);
extern void smp_yield(void);
extern void smp_stop_cpu(void);
32 33
extern void smp_cpu_set_polarization(int cpu, int val);
extern int smp_cpu_get_polarization(int cpu);
34
extern void smp_fill_possible_mask(void);
35

36 37
#else /* CONFIG_SMP */

M
Martin Schwidefsky 已提交
38
static inline void smp_call_ipl_cpu(void (*func)(void *), void *data)
39 40 41 42
{
	func(data);
}

M
Martin Schwidefsky 已提交
43
static inline void smp_call_online_cpu(void (*func)(void *), void *data)
44
{
M
Martin Schwidefsky 已提交
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; }
M
Martin Schwidefsky 已提交
50 51 52 53
static inline int smp_vcpu_scheduled(int cpu) { return 1; }
static inline void smp_yield_cpu(int cpu) { }
static inline void smp_yield(void) { }
static inline void smp_stop_cpu(void) { }
54
static inline void smp_fill_possible_mask(void) { }
55

56
#endif /* CONFIG_SMP */
L
Linus Torvalds 已提交
57

58 59
#ifdef CONFIG_HOTPLUG_CPU
extern int smp_rescan_cpus(void);
60
extern void __noreturn cpu_die(void);
M
Martin Schwidefsky 已提交
61 62
extern void __cpu_die(unsigned int cpu);
extern int __cpu_disable(void);
63 64
#else
static inline int smp_rescan_cpus(void) { return 0; }
65
static inline void cpu_die(void) { }
66 67
#endif

68
#endif /* __ASM_SMP_H */