Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Heiko Carstens | a53c8fa | 2012-07-20 11:15:04 +0200 | [diff] [blame] | 2 | * Copyright IBM Corp. 1999, 2012 |
Heiko Carstens | c20c89a | 2009-12-07 12:52:07 +0100 | [diff] [blame] | 3 | * Author(s): Denis Joseph Barrow, |
| 4 | * Martin Schwidefsky <schwidefsky@de.ibm.com>, |
| 5 | * Heiko Carstens <heiko.carstens@de.ibm.com>, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | */ |
| 7 | #ifndef __ASM_SMP_H |
| 8 | #define __ASM_SMP_H |
| 9 | |
Heiko Carstens | c20c89a | 2009-12-07 12:52:07 +0100 | [diff] [blame] | 10 | #ifdef CONFIG_SMP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | |
David Howells | a0616cd | 2012-03-28 18:30:02 +0100 | [diff] [blame] | 12 | #include <asm/lowcore.h> |
Heiko Carstens | 2b67fc4 | 2007-02-05 21:16:47 +0100 | [diff] [blame] | 13 | |
Martin Schwidefsky | 7b46848 | 2009-03-26 15:24:42 +0100 | [diff] [blame] | 14 | #define raw_smp_processor_id() (S390_lowcore.cpu_nr) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | |
Heiko Carstens | dbd70fb | 2008-04-17 07:46:12 +0200 | [diff] [blame] | 16 | extern struct mutex smp_cpu_state_mutex; |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 17 | extern struct save_area *zfcpdump_save_areas[NR_CPUS + 1]; |
| 18 | |
Thomas Gleixner | 8239c25 | 2012-04-20 13:05:42 +0000 | [diff] [blame] | 19 | extern int __cpu_up(unsigned int cpu, struct task_struct *tidle); |
Heiko Carstens | dbd70fb | 2008-04-17 07:46:12 +0200 | [diff] [blame] | 20 | |
Heiko Carstens | ca9fc75 | 2008-12-25 13:38:39 +0100 | [diff] [blame] | 21 | extern void arch_send_call_function_single_ipi(int cpu); |
Rusty Russell | 630cd04 | 2009-09-24 09:34:45 -0600 | [diff] [blame] | 22 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); |
Heiko Carstens | ca9fc75 | 2008-12-25 13:38:39 +0100 | [diff] [blame] | 23 | |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 24 | extern void smp_call_online_cpu(void (*func)(void *), void *); |
| 25 | extern void smp_call_ipl_cpu(void (*func)(void *), void *); |
Heiko Carstens | c20c89a | 2009-12-07 12:52:07 +0100 | [diff] [blame] | 26 | |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 27 | extern int smp_find_processor_id(u16 address); |
| 28 | extern int smp_store_status(int cpu); |
| 29 | extern int smp_vcpu_scheduled(int cpu); |
| 30 | extern void smp_yield_cpu(int cpu); |
| 31 | extern void smp_yield(void); |
| 32 | extern void smp_stop_cpu(void); |
Gerald Schaefer | 59b6978 | 2010-02-26 22:37:40 +0100 | [diff] [blame] | 33 | |
Heiko Carstens | 2c2df11 | 2010-02-26 22:37:34 +0100 | [diff] [blame] | 34 | #else /* CONFIG_SMP */ |
| 35 | |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 36 | static inline void smp_call_ipl_cpu(void (*func)(void *), void *data) |
Heiko Carstens | 2c2df11 | 2010-02-26 22:37:34 +0100 | [diff] [blame] | 37 | { |
| 38 | func(data); |
| 39 | } |
| 40 | |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 41 | static inline void smp_call_online_cpu(void (*func)(void *), void *data) |
Michael Holzheu | 1943f53 | 2011-10-30 15:16:38 +0100 | [diff] [blame] | 42 | { |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 43 | func(data); |
Michael Holzheu | 1943f53 | 2011-10-30 15:16:38 +0100 | [diff] [blame] | 44 | } |
| 45 | |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 46 | static inline int smp_find_processor_id(int address) { return 0; } |
Heiko Carstens | 29a877f | 2012-08-27 15:18:45 +0200 | [diff] [blame^] | 47 | static inline int smp_store_status(int cpu) { return 0; } |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 48 | static inline int smp_vcpu_scheduled(int cpu) { return 1; } |
| 49 | static inline void smp_yield_cpu(int cpu) { } |
| 50 | static inline void smp_yield(void) { } |
| 51 | static inline void smp_stop_cpu(void) { } |
Gerald Schaefer | 59b6978 | 2010-02-26 22:37:40 +0100 | [diff] [blame] | 52 | |
Heiko Carstens | c20c89a | 2009-12-07 12:52:07 +0100 | [diff] [blame] | 53 | #endif /* CONFIG_SMP */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | |
Heiko Carstens | 1e48951 | 2008-04-30 13:38:37 +0200 | [diff] [blame] | 55 | #ifdef CONFIG_HOTPLUG_CPU |
| 56 | extern int smp_rescan_cpus(void); |
Heiko Carstens | da7f51c | 2011-01-05 12:48:09 +0100 | [diff] [blame] | 57 | extern void __noreturn cpu_die(void); |
Martin Schwidefsky | 8b646bd | 2012-03-11 11:59:26 -0400 | [diff] [blame] | 58 | extern void __cpu_die(unsigned int cpu); |
| 59 | extern int __cpu_disable(void); |
Heiko Carstens | 1e48951 | 2008-04-30 13:38:37 +0200 | [diff] [blame] | 60 | #else |
| 61 | static inline int smp_rescan_cpus(void) { return 0; } |
Heiko Carstens | da7f51c | 2011-01-05 12:48:09 +0100 | [diff] [blame] | 62 | static inline void cpu_die(void) { } |
Heiko Carstens | 1e48951 | 2008-04-30 13:38:37 +0200 | [diff] [blame] | 63 | #endif |
| 64 | |
Heiko Carstens | c20c89a | 2009-12-07 12:52:07 +0100 | [diff] [blame] | 65 | #endif /* __ASM_SMP_H */ |