smpboot_hooks.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. unsigned long flags;
  12. spin_lock_irqsave(&rtc_lock, flags);
  13. CMOS_WRITE(0xa, 0xf);
  14. spin_unlock_irqrestore(&rtc_lock, flags);
  15. local_flush_tlb();
  16. pr_debug("1.\n");
  17. *((volatile unsigned short *)phys_to_virt(apic->trampoline_phys_high)) =
  18. start_eip >> 4;
  19. pr_debug("2.\n");
  20. *((volatile unsigned short *)phys_to_virt(apic->trampoline_phys_low)) =
  21. start_eip & 0xf;
  22. pr_debug("3.\n");
  23. }
  24. static inline void smpboot_restore_warm_reset_vector(void)
  25. {
  26. unsigned long flags;
  27. /*
  28. * Install writable page 0 entry to set BIOS data area.
  29. */
  30. local_flush_tlb();
  31. /*
  32. * Paranoid: Set warm reset code and vector here back
  33. * to default values.
  34. */
  35. spin_lock_irqsave(&rtc_lock, flags);
  36. CMOS_WRITE(0, 0xf);
  37. spin_unlock_irqrestore(&rtc_lock, flags);
  38. *((volatile u32 *)phys_to_virt(apic->trampoline_phys_low)) = 0;
  39. }
  40. static inline void __init smpboot_setup_io_apic(void)
  41. {
  42. #ifdef CONFIG_X86_IO_APIC
  43. /*
  44. * Here we can be sure that there is an IO-APIC in the system. Let's
  45. * go and set it up:
  46. */
  47. if (!skip_ioapic_setup && nr_ioapics)
  48. setup_IO_APIC();
  49. else {
  50. nr_ioapics = 0;
  51. }
  52. #endif
  53. }
  54. static inline void smpboot_clear_io_apic(void)
  55. {
  56. #ifdef CONFIG_X86_IO_APIC
  57. nr_ioapics = 0;
  58. #endif
  59. }