smp.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright IBM Corp. 1999,2012
  3. * Author(s): Denis Joseph Barrow,
  4. * Martin Schwidefsky <schwidefsky@de.ibm.com>,
  5. * Heiko Carstens <heiko.carstens@de.ibm.com>,
  6. */
  7. #ifndef __ASM_SMP_H
  8. #define __ASM_SMP_H
  9. #ifdef CONFIG_SMP
  10. #include <asm/lowcore.h>
  11. #define raw_smp_processor_id() (S390_lowcore.cpu_nr)
  12. extern struct mutex smp_cpu_state_mutex;
  13. extern struct save_area *zfcpdump_save_areas[NR_CPUS + 1];
  14. extern int __cpu_up(unsigned int cpu);
  15. extern void arch_send_call_function_single_ipi(int cpu);
  16. extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
  17. extern void smp_call_online_cpu(void (*func)(void *), void *);
  18. extern void smp_call_ipl_cpu(void (*func)(void *), void *);
  19. extern int smp_find_processor_id(u16 address);
  20. extern int smp_store_status(int cpu);
  21. extern int smp_vcpu_scheduled(int cpu);
  22. extern void smp_yield_cpu(int cpu);
  23. extern void smp_yield(void);
  24. extern void smp_stop_cpu(void);
  25. #else /* CONFIG_SMP */
  26. static inline void smp_call_ipl_cpu(void (*func)(void *), void *data)
  27. {
  28. func(data);
  29. }
  30. static inline void smp_call_online_cpu(void (*func)(void *), void *data)
  31. {
  32. func(data);
  33. }
  34. static inline int smp_find_processor_id(int address) { return 0; }
  35. static inline int smp_vcpu_scheduled(int cpu) { return 1; }
  36. static inline void smp_yield_cpu(int cpu) { }
  37. static inline void smp_yield(void) { }
  38. static inline void smp_stop_cpu(void) { }
  39. #endif /* CONFIG_SMP */
  40. #ifdef CONFIG_HOTPLUG_CPU
  41. extern int smp_rescan_cpus(void);
  42. extern void __noreturn cpu_die(void);
  43. extern void __cpu_die(unsigned int cpu);
  44. extern int __cpu_disable(void);
  45. #else
  46. static inline int smp_rescan_cpus(void) { return 0; }
  47. static inline void cpu_die(void) { }
  48. #endif
  49. #endif /* __ASM_SMP_H */