4 #include <linux/bitops.h>
5 #include <linux/cpumask.h>
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 /* I've no idea what the real meaning of this is */
25 #define PROC_CHANGE_PENALTY 20
27 #define NO_PROC_ID (-1)
29 struct smp_fn_call_struct
{
36 extern struct smp_fn_call_struct smp_fn_call
;
38 #define SMP_MSG_FUNCTION 0
39 #define SMP_MSG_RESCHEDULE 1
42 void plat_smp_setup(void);
43 void plat_prepare_cpus(unsigned int max_cpus
);
44 int plat_smp_processor_id(void);
45 void plat_start_cpu(unsigned int cpu
, unsigned long entry_point
);
46 void plat_send_ipi(unsigned int cpu
, unsigned int message
);
47 int plat_register_ipi_handler(unsigned int message
,
48 void (*handler
)(void *), void *arg
);
52 #define hard_smp_processor_id() (0)
54 #endif /* CONFIG_SMP */
56 #endif /* __ASM_SH_SMP_H */