smpboot_hooks.h 1.2 KB

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