blob: 85b660c17eb070e230b7ce3e0dcac1c7f7ab27c8 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __ASM_SH_SMP_H
2#define __ASM_SH_SMP_H
3
Linus Torvalds1da177e2005-04-16 15:20:36 -07004#include <linux/bitops.h>
5#include <linux/cpumask.h>
6
7#ifdef CONFIG_SMP
8
Evgeniy Polyakov66c52272007-05-31 13:46:21 +09009#include <linux/spinlock.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070010#include <asm/atomic.h>
11#include <asm/current.h>
12
Ingo Molnar39c715b2005-06-21 17:14:34 -070013#define raw_smp_processor_id() (current_thread_info()->cpu)
Paul Mundtaba10302007-09-21 18:32:32 +090014#define hard_smp_processor_id() plat_smp_processor_id()
15
16/* Map from cpu id to sequential logical cpu number. */
17extern 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. */
21extern int __cpu_logical_map[NR_CPUS];
22#define cpu_logical_map(cpu) __cpu_logical_map[cpu]
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
Paul Mundt6f527072008-08-06 18:21:03 +090024enum {
25 SMP_MSG_FUNCTION,
26 SMP_MSG_RESCHEDULE,
27 SMP_MSG_FUNCTION_SINGLE,
28 SMP_MSG_TIMER,
29
30 SMP_MSG_NR, /* must be last */
31};
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
Paul Mundt173a44d2008-08-06 18:02:48 +090033void smp_message_recv(unsigned int msg);
Paul Mundt6f527072008-08-06 18:21:03 +090034void smp_timer_broadcast(cpumask_t mask);
35
Paul Mundt8c245942008-08-06 18:37:07 +090036void local_timer_interrupt(void);
37void local_timer_setup(unsigned int cpu);
38
Paul Mundtaba10302007-09-21 18:32:32 +090039void plat_smp_setup(void);
40void plat_prepare_cpus(unsigned int max_cpus);
41int plat_smp_processor_id(void);
42void plat_start_cpu(unsigned int cpu, unsigned long entry_point);
43void plat_send_ipi(unsigned int cpu, unsigned int message);
Paul Mundt6f527072008-08-06 18:21:03 +090044
45void arch_send_call_function_single_ipi(int cpu);
46void arch_send_call_function_ipi(cpumask_t mask);
Paul Mundtaba10302007-09-21 18:32:32 +090047
48#else
Linus Torvalds1da177e2005-04-16 15:20:36 -070049
Paul Mundt027e56e2007-06-20 18:23:49 +090050#define hard_smp_processor_id() (0)
51
Paul Mundtaba10302007-09-21 18:32:32 +090052#endif /* CONFIG_SMP */
53
Linus Torvalds1da177e2005-04-16 15:20:36 -070054#endif /* __ASM_SH_SMP_H */