Full support for Ginger Console
[linux-ginger.git] / arch / sh / include / asm / smp.h
blob53ef26ced75fddfba4ae5a837a66b8638fd2a5a4
1 #ifndef __ASM_SH_SMP_H
2 #define __ASM_SH_SMP_H
4 #include <linux/bitops.h>
5 #include <linux/cpumask.h>
7 #ifdef CONFIG_SMP
9 #include <linux/spinlock.h>
10 #include <asm/atomic.h>
11 #include <asm/current.h>
13 #define raw_smp_processor_id() (current_thread_info()->cpu)
14 #define hard_smp_processor_id() plat_smp_processor_id()
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]
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]
24 enum {
25 SMP_MSG_FUNCTION,
26 SMP_MSG_RESCHEDULE,
27 SMP_MSG_FUNCTION_SINGLE,
28 SMP_MSG_TIMER,
30 SMP_MSG_NR, /* must be last */
33 void smp_message_recv(unsigned int msg);
34 void smp_timer_broadcast(const struct cpumask *mask);
36 void local_timer_interrupt(void);
37 void local_timer_setup(unsigned int cpu);
39 void plat_smp_setup(void);
40 void plat_prepare_cpus(unsigned int max_cpus);
41 int plat_smp_processor_id(void);
42 void plat_start_cpu(unsigned int cpu, unsigned long entry_point);
43 void plat_send_ipi(unsigned int cpu, unsigned int message);
45 void arch_send_call_function_single_ipi(int cpu);
46 extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
48 #else
50 #define hard_smp_processor_id() (0)
52 #endif /* CONFIG_SMP */
54 #endif /* __ASM_SH_SMP_H */