mach_ipi.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef _ASM_X86_MACH_DEFAULT_MACH_IPI_H
  2. #define _ASM_X86_MACH_DEFAULT_MACH_IPI_H
  3. /* Avoid include hell */
  4. #define NMI_VECTOR 0x02
  5. void send_IPI_mask_bitmask(const struct cpumask *mask, int vector);
  6. void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
  7. void __send_IPI_shortcut(unsigned int shortcut, int vector);
  8. extern int no_broadcast;
  9. #ifdef CONFIG_X86_64
  10. #include <asm/genapic.h>
  11. #define send_IPI_mask (genapic->send_IPI_mask)
  12. #define send_IPI_mask_allbutself (genapic->send_IPI_mask_allbutself)
  13. #else
  14. static inline void send_IPI_mask(const struct cpumask *mask, int vector)
  15. {
  16. send_IPI_mask_bitmask(mask, vector);
  17. }
  18. void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
  19. #endif
  20. static inline void __local_send_IPI_allbutself(int vector)
  21. {
  22. if (no_broadcast || vector == NMI_VECTOR)
  23. send_IPI_mask_allbutself(cpu_online_mask, vector);
  24. else
  25. __send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
  26. }
  27. static inline void __local_send_IPI_all(int vector)
  28. {
  29. if (no_broadcast || vector == NMI_VECTOR)
  30. send_IPI_mask(cpu_online_mask, vector);
  31. else
  32. __send_IPI_shortcut(APIC_DEST_ALLINC, vector);
  33. }
  34. #ifdef CONFIG_X86_64
  35. #define send_IPI_allbutself (genapic->send_IPI_allbutself)
  36. #define send_IPI_all (genapic->send_IPI_all)
  37. #else
  38. static inline void send_IPI_allbutself(int vector)
  39. {
  40. /*
  41. * if there are no other CPUs in the system then we get an APIC send
  42. * error if we try to broadcast, thus avoid sending IPIs in this case.
  43. */
  44. if (!(num_online_cpus() > 1))
  45. return;
  46. __local_send_IPI_allbutself(vector);
  47. return;
  48. }
  49. static inline void send_IPI_all(int vector)
  50. {
  51. __local_send_IPI_all(vector);
  52. }
  53. #endif
  54. #endif /* _ASM_X86_MACH_DEFAULT_MACH_IPI_H */