smp.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright IBM Corp. 1999, 2012
  4. * Author(s): Denis Joseph Barrow,
  5. * Martin Schwidefsky <[email protected]>,
  6. */
  7. #ifndef __ASM_SMP_H
  8. #define __ASM_SMP_H
  9. #include <asm/sigp.h>
  10. #include <asm/lowcore.h>
  11. #include <asm/processor.h>
  12. #define raw_smp_processor_id() (S390_lowcore.cpu_nr)
  13. extern struct mutex smp_cpu_state_mutex;
  14. extern unsigned int smp_cpu_mt_shift;
  15. extern unsigned int smp_cpu_mtid;
  16. extern __vector128 __initdata boot_cpu_vector_save_area[__NUM_VXRS];
  17. extern cpumask_t cpu_setup_mask;
  18. extern int __cpu_up(unsigned int cpu, struct task_struct *tidle);
  19. extern void arch_send_call_function_single_ipi(int cpu);
  20. extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
  21. extern void smp_call_online_cpu(void (*func)(void *), void *);
  22. extern void smp_call_ipl_cpu(void (*func)(void *), void *);
  23. extern void smp_emergency_stop(void);
  24. extern int smp_find_processor_id(u16 address);
  25. extern int smp_store_status(int cpu);
  26. extern void smp_save_dump_ipl_cpu(void);
  27. extern void smp_save_dump_secondary_cpus(void);
  28. extern void smp_yield_cpu(int cpu);
  29. extern void smp_cpu_set_polarization(int cpu, int val);
  30. extern int smp_cpu_get_polarization(int cpu);
  31. extern int smp_cpu_get_cpu_address(int cpu);
  32. extern void smp_fill_possible_mask(void);
  33. extern void smp_detect_cpus(void);
  34. static inline void smp_stop_cpu(void)
  35. {
  36. u16 pcpu = stap();
  37. for (;;) {
  38. __pcpu_sigp(pcpu, SIGP_STOP, 0, NULL);
  39. cpu_relax();
  40. }
  41. }
  42. /* Return thread 0 CPU number as base CPU */
  43. static inline int smp_get_base_cpu(int cpu)
  44. {
  45. return cpu - (cpu % (smp_cpu_mtid + 1));
  46. }
  47. static inline void smp_cpus_done(unsigned int max_cpus)
  48. {
  49. }
  50. extern int smp_reinit_ipl_cpu(void);
  51. extern int smp_rescan_cpus(void);
  52. extern void __noreturn cpu_die(void);
  53. extern void __cpu_die(unsigned int cpu);
  54. extern int __cpu_disable(void);
  55. extern void schedule_mcck_handler(void);
  56. void notrace smp_yield_cpu(int cpu);
  57. #endif /* __ASM_SMP_H */