smp-ops.h 1.0 KB

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