smp.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 int __cpu_up(unsigned int cpu, struct task_struct *tidle);
  14. extern void arch_send_call_function_single_ipi(int cpu);
  15. extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
  16. extern void smp_call_online_cpu(void (*func)(void *), void *);
  17. extern void smp_call_ipl_cpu(void (*func)(void *), void *);
  18. extern int smp_find_processor_id(u16 address);
  19. extern int smp_store_status(int cpu);
  20. extern int smp_vcpu_scheduled(int cpu);
  21. extern void smp_yield_cpu(int cpu);
  22. extern void smp_yield(void);
  23. extern void smp_stop_cpu(void);
  24. extern void smp_cpu_set_polarization(int cpu, int val);
  25. extern int smp_cpu_get_polarization(int cpu);
  26. #else /* CONFIG_SMP */
  27. static inline void smp_call_ipl_cpu(void (*func)(void *), void *data)
  28. {
  29. func(data);
  30. }
  31. static inline void smp_call_online_cpu(void (*func)(void *), void *data)
  32. {
  33. func(data);
  34. }
  35. static inline int smp_find_processor_id(u16 address) { return 0; }
  36. static inline int smp_store_status(int cpu) { return 0; }
  37. static inline int smp_vcpu_scheduled(int cpu) { return 1; }
  38. static inline void smp_yield_cpu(int cpu) { }
  39. static inline void smp_yield(void) { }
  40. static inline void smp_stop_cpu(void) { }
  41. #endif /* CONFIG_SMP */
  42. #ifdef CONFIG_HOTPLUG_CPU
  43. extern int smp_rescan_cpus(void);
  44. extern void __noreturn cpu_die(void);
  45. extern void __cpu_die(unsigned int cpu);
  46. extern int __cpu_disable(void);
  47. #else
  48. static inline int smp_rescan_cpus(void) { return 0; }
  49. static inline void cpu_die(void) { }
  50. #endif
  51. #endif /* __ASM_SMP_H */