]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - arch/sh/include/asm/smp.h
1292c6d3c53e1aadb1c4dddb2459974e35671ace
[linux-2.6-omap-h63xx.git] / arch / sh / include / asm / smp.h
1 #ifndef __ASM_SH_SMP_H
2 #define __ASM_SH_SMP_H
3
4 #include <linux/bitops.h>
5 #include <linux/cpumask.h>
6
7 #ifdef CONFIG_SMP
8
9 #include <linux/spinlock.h>
10 #include <asm/atomic.h>
11 #include <asm/current.h>
12
13 #define raw_smp_processor_id()  (current_thread_info()->cpu)
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]
23
24 #define SMP_MSG_FUNCTION        0
25 #define SMP_MSG_RESCHEDULE      1
26 #define SMP_MSG_FUNCTION_SINGLE 2
27 #define SMP_MSG_NR              3
28
29 void smp_message_recv(unsigned int msg);
30 void plat_smp_setup(void);
31 void plat_prepare_cpus(unsigned int max_cpus);
32 int plat_smp_processor_id(void);
33 void plat_start_cpu(unsigned int cpu, unsigned long entry_point);
34 void plat_send_ipi(unsigned int cpu, unsigned int message);
35 int plat_register_ipi_handler(unsigned int message,
36                               void (*handler)(void *), void *arg);
37 extern void arch_send_call_function_single_ipi(int cpu);
38 extern void arch_send_call_function_ipi(cpumask_t mask);
39
40 #else
41
42 #define hard_smp_processor_id() (0)
43
44 #endif /* CONFIG_SMP */
45
46 #endif /* __ASM_SH_SMP_H */