smp-ops.h 1012 B

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 play_dead(void)
  23. {
  24. mp_ops->play_dead();
  25. }
  26. extern void register_smp_ops(struct plat_smp_ops *ops);
  27. #else
  28. static inline void plat_smp_setup(void)
  29. {
  30. /* UP, nothing to do ... */
  31. }
  32. static inline void register_smp_ops(struct plat_smp_ops *ops)
  33. {
  34. }
  35. static inline void play_dead(void)
  36. {
  37. BUG();
  38. }
  39. #endif /* CONFIG_SMP */
  40. #endif /* __ASM_SH_SMP_OPS_H */