smp-ops.h 973 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef __ASM_SH_SMP_OPS_H
  2. #define __ASM_SH_SMP_OPS_H
  3. struct plat_smp_ops {
  4. void (*smp_setup)(void);
  5. unsigned int (*smp_processor_id)(void);
  6. void (*prepare_cpus)(unsigned int max_cpus);
  7. void (*start_cpu)(unsigned int cpu, unsigned long entry_point);
  8. void (*send_ipi)(unsigned int cpu, unsigned int message);
  9. int (*cpu_disable)(unsigned int cpu);
  10. void (*cpu_die)(unsigned int cpu);
  11. void (*play_dead)(void);
  12. };
  13. extern struct plat_smp_ops *mp_ops;
  14. extern struct plat_smp_ops shx3_smp_ops;
  15. #ifdef CONFIG_SMP
  16. static inline void plat_smp_setup(void)
  17. {
  18. BUG_ON(!mp_ops);
  19. mp_ops->smp_setup();
  20. }
  21. static inline void play_dead(void)
  22. {
  23. mp_ops->play_dead();
  24. }
  25. extern void register_smp_ops(struct plat_smp_ops *ops);
  26. #else
  27. static inline void plat_smp_setup(void)
  28. {
  29. /* UP, nothing to do ... */
  30. }
  31. static inline void register_smp_ops(struct plat_smp_ops *ops)
  32. {
  33. }
  34. static inline void play_dead(void)
  35. {
  36. BUG();
  37. }
  38. #endif /* CONFIG_SMP */
  39. #endif /* __ASM_SH_SMP_OPS_H */