Paul Mundt | 3366e35 | 2010-03-30 12:38:01 +0900 | [diff] [blame] | 1 | #ifndef __ASM_SH_SMP_OPS_H |
| 2 | #define __ASM_SH_SMP_OPS_H |
| 3 | |
| 4 | struct plat_smp_ops { |
| 5 | void (*smp_setup)(void); |
| 6 | unsigned int (*smp_processor_id)(void); |
| 7 | void (*prepare_cpus)(unsigned int max_cpus); |
| 8 | void (*start_cpu)(unsigned int cpu, unsigned long entry_point); |
| 9 | void (*send_ipi)(unsigned int cpu, unsigned int message); |
Paul Mundt | 763142d | 2010-04-26 19:08:55 +0900 | [diff] [blame] | 10 | int (*cpu_disable)(unsigned int cpu); |
| 11 | void (*cpu_die)(unsigned int cpu); |
| 12 | void (*play_dead)(void); |
Paul Mundt | 3366e35 | 2010-03-30 12:38:01 +0900 | [diff] [blame] | 13 | }; |
| 14 | |
Paul Mundt | 763142d | 2010-04-26 19:08:55 +0900 | [diff] [blame] | 15 | extern struct plat_smp_ops *mp_ops; |
Paul Mundt | 3366e35 | 2010-03-30 12:38:01 +0900 | [diff] [blame] | 16 | extern struct plat_smp_ops shx3_smp_ops; |
| 17 | |
| 18 | #ifdef CONFIG_SMP |
| 19 | |
| 20 | static inline void plat_smp_setup(void) |
| 21 | { |
Paul Mundt | 3366e35 | 2010-03-30 12:38:01 +0900 | [diff] [blame] | 22 | BUG_ON(!mp_ops); |
| 23 | mp_ops->smp_setup(); |
| 24 | } |
| 25 | |
Paul Mundt | 763142d | 2010-04-26 19:08:55 +0900 | [diff] [blame] | 26 | static inline void play_dead(void) |
| 27 | { |
| 28 | mp_ops->play_dead(); |
| 29 | } |
| 30 | |
Paul Mundt | 3366e35 | 2010-03-30 12:38:01 +0900 | [diff] [blame] | 31 | extern void register_smp_ops(struct plat_smp_ops *ops); |
| 32 | |
| 33 | #else |
| 34 | |
| 35 | static inline void plat_smp_setup(void) |
| 36 | { |
| 37 | /* UP, nothing to do ... */ |
| 38 | } |
| 39 | |
| 40 | static inline void register_smp_ops(struct plat_smp_ops *ops) |
| 41 | { |
| 42 | } |
| 43 | |
Paul Mundt | 763142d | 2010-04-26 19:08:55 +0900 | [diff] [blame] | 44 | static inline void play_dead(void) |
| 45 | { |
| 46 | BUG(); |
| 47 | } |
| 48 | |
Paul Mundt | 3366e35 | 2010-03-30 12:38:01 +0900 | [diff] [blame] | 49 | #endif /* CONFIG_SMP */ |
| 50 | |
| 51 | #endif /* __ASM_SH_SMP_OPS_H */ |