smp.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef __ASM_SH_SMP_H
  2. #define __ASM_SH_SMP_H
  3. #include <linux/bitops.h>
  4. #include <linux/cpumask.h>
  5. #ifdef CONFIG_SMP
  6. #include <linux/spinlock.h>
  7. #include <asm/atomic.h>
  8. #include <asm/current.h>
  9. #define raw_smp_processor_id() (current_thread_info()->cpu)
  10. #define hard_smp_processor_id() plat_smp_processor_id()
  11. /* Map from cpu id to sequential logical cpu number. */
  12. extern int __cpu_number_map[NR_CPUS];
  13. #define cpu_number_map(cpu) __cpu_number_map[cpu]
  14. /* The reverse map from sequential logical cpu number to cpu id. */
  15. extern int __cpu_logical_map[NR_CPUS];
  16. #define cpu_logical_map(cpu) __cpu_logical_map[cpu]
  17. enum {
  18. SMP_MSG_FUNCTION,
  19. SMP_MSG_RESCHEDULE,
  20. SMP_MSG_FUNCTION_SINGLE,
  21. SMP_MSG_TIMER,
  22. SMP_MSG_NR, /* must be last */
  23. };
  24. void smp_message_recv(unsigned int msg);
  25. void smp_timer_broadcast(const struct cpumask *mask);
  26. void local_timer_interrupt(void);
  27. void local_timer_setup(unsigned int cpu);
  28. void plat_smp_setup(void);
  29. void plat_prepare_cpus(unsigned int max_cpus);
  30. int plat_smp_processor_id(void);
  31. void plat_start_cpu(unsigned int cpu, unsigned long entry_point);
  32. void plat_send_ipi(unsigned int cpu, unsigned int message);
  33. void arch_send_call_function_single_ipi(int cpu);
  34. extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
  35. #define arch_send_call_function_ipi_mask arch_send_call_function_ipi_mask
  36. #else
  37. #define hard_smp_processor_id() (0)
  38. #endif /* CONFIG_SMP */
  39. #endif /* __ASM_SH_SMP_H */