Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __ASM_SH_SMP_H |
| 2 | #define __ASM_SH_SMP_H |
| 3 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | #include <linux/bitops.h> |
| 5 | #include <linux/cpumask.h> |
| 6 | |
| 7 | #ifdef CONFIG_SMP |
| 8 | |
Evgeniy Polyakov | 66c5227 | 2007-05-31 13:46:21 +0900 | [diff] [blame] | 9 | #include <linux/spinlock.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | #include <asm/atomic.h> |
| 11 | #include <asm/current.h> |
| 12 | |
Ingo Molnar | 39c715b | 2005-06-21 17:14:34 -0700 | [diff] [blame] | 13 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
Paul Mundt | aba1030 | 2007-09-21 18:32:32 +0900 | [diff] [blame] | 14 | #define hard_smp_processor_id() plat_smp_processor_id() |
| 15 | |
| 16 | /* Map from cpu id to sequential logical cpu number. */ |
| 17 | extern int __cpu_number_map[NR_CPUS]; |
| 18 | #define cpu_number_map(cpu) __cpu_number_map[cpu] |
| 19 | |
| 20 | /* The reverse map from sequential logical cpu number to cpu id. */ |
| 21 | extern int __cpu_logical_map[NR_CPUS]; |
| 22 | #define cpu_logical_map(cpu) __cpu_logical_map[cpu] |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | |
| 24 | /* I've no idea what the real meaning of this is */ |
| 25 | #define PROC_CHANGE_PENALTY 20 |
| 26 | |
| 27 | #define NO_PROC_ID (-1) |
| 28 | |
Paul Mundt | aba1030 | 2007-09-21 18:32:32 +0900 | [diff] [blame] | 29 | #define SMP_MSG_FUNCTION 0 |
| 30 | #define SMP_MSG_RESCHEDULE 1 |
Jens Axboe | 490f5de | 2008-06-10 20:52:59 +0200 | [diff] [blame] | 31 | #define SMP_MSG_FUNCTION_SINGLE 2 |
| 32 | #define SMP_MSG_NR 3 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | |
Paul Mundt | aba1030 | 2007-09-21 18:32:32 +0900 | [diff] [blame] | 34 | void plat_smp_setup(void); |
| 35 | void plat_prepare_cpus(unsigned int max_cpus); |
| 36 | int plat_smp_processor_id(void); |
| 37 | void plat_start_cpu(unsigned int cpu, unsigned long entry_point); |
| 38 | void plat_send_ipi(unsigned int cpu, unsigned int message); |
| 39 | int plat_register_ipi_handler(unsigned int message, |
| 40 | void (*handler)(void *), void *arg); |
Jens Axboe | 490f5de | 2008-06-10 20:52:59 +0200 | [diff] [blame] | 41 | extern void arch_send_call_function_single_ipi(int cpu); |
| 42 | extern void arch_send_call_function_ipi(cpumask_t mask); |
Paul Mundt | aba1030 | 2007-09-21 18:32:32 +0900 | [diff] [blame] | 43 | |
| 44 | #else |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | |
Paul Mundt | 027e56e | 2007-06-20 18:23:49 +0900 | [diff] [blame] | 46 | #define hard_smp_processor_id() (0) |
| 47 | |
Paul Mundt | aba1030 | 2007-09-21 18:32:32 +0900 | [diff] [blame] | 48 | #endif /* CONFIG_SMP */ |
| 49 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | #endif /* __ASM_SH_SMP_H */ |