smp.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. /* I've no idea what the real meaning of this is */
  18. #define PROC_CHANGE_PENALTY 20
  19. #define NO_PROC_ID (-1)
  20. #define SMP_MSG_FUNCTION 0
  21. #define SMP_MSG_RESCHEDULE 1
  22. #define SMP_MSG_FUNCTION_SINGLE 2
  23. #define SMP_MSG_NR 3
  24. void plat_smp_setup(void);
  25. void plat_prepare_cpus(unsigned int max_cpus);
  26. int plat_smp_processor_id(void);
  27. void plat_start_cpu(unsigned int cpu, unsigned long entry_point);
  28. void plat_send_ipi(unsigned int cpu, unsigned int message);
  29. int plat_register_ipi_handler(unsigned int message,
  30. void (*handler)(void *), void *arg);
  31. extern void arch_send_call_function_single_ipi(int cpu);
  32. extern void arch_send_call_function_ipi(cpumask_t mask);
  33. #else
  34. #define hard_smp_processor_id() (0)
  35. #endif /* CONFIG_SMP */
  36. #endif /* __ASM_SH_SMP_H */