smpboot_hooks.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* two abstractions specific to kernel/smpboot.c, mainly to cater to visws
  2. * which needs to alter them. */
  3. static inline void smpboot_clear_io_apic_irqs(void)
  4. {
  5. #ifdef CONFIG_X86_IO_APIC
  6. io_apic_irqs = 0;
  7. #endif
  8. }
  9. static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip)
  10. {
  11. CMOS_WRITE(0xa, 0xf);
  12. local_flush_tlb();
  13. pr_debug("1.\n");
  14. *((volatile unsigned short *)phys_to_virt(TRAMPOLINE_PHYS_HIGH)) =
  15. start_eip >> 4;
  16. pr_debug("2.\n");
  17. *((volatile unsigned short *)phys_to_virt(TRAMPOLINE_PHYS_LOW)) =
  18. start_eip & 0xf;
  19. pr_debug("3.\n");
  20. }
  21. static inline void smpboot_restore_warm_reset_vector(void)
  22. {
  23. /*
  24. * Install writable page 0 entry to set BIOS data area.
  25. */
  26. local_flush_tlb();
  27. /*
  28. * Paranoid: Set warm reset code and vector here back
  29. * to default values.
  30. */
  31. CMOS_WRITE(0, 0xf);
  32. *((volatile long *)phys_to_virt(TRAMPOLINE_PHYS_LOW)) = 0;
  33. }
  34. static inline void __init smpboot_setup_io_apic(void)
  35. {
  36. #ifdef CONFIG_X86_IO_APIC
  37. /*
  38. * Here we can be sure that there is an IO-APIC in the system. Let's
  39. * go and set it up:
  40. */
  41. if (!skip_ioapic_setup && nr_ioapics)
  42. setup_IO_APIC();
  43. else {
  44. nr_ioapics = 0;
  45. localise_nmi_watchdog();
  46. }
  47. #endif
  48. }
  49. static inline void smpboot_clear_io_apic(void)
  50. {
  51. #ifdef CONFIG_X86_IO_APIC
  52. nr_ioapics = 0;
  53. #endif
  54. }