blob: 1def60114906bf1b1dfa98ef3bd8ac177f65010f [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* two abstractions specific to kernel/smpboot.c, mainly to cater to visws
2 * which needs to alter them. */
3
4static inline void smpboot_clear_io_apic_irqs(void)
5{
Ingo Molnar6a64b5d2008-07-10 15:09:04 +02006#ifdef CONFIG_X86_IO_APIC
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 io_apic_irqs = 0;
Ingo Molnar6a64b5d2008-07-10 15:09:04 +02008#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07009}
10
11static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip)
12{
13 CMOS_WRITE(0xa, 0xf);
14 local_flush_tlb();
Thomas Gleixnercfc1b9a2008-07-21 21:35:38 +020015 pr_debug("1.\n");
Ingo Molnar6f177c02009-01-28 16:09:23 +010016 *((volatile unsigned short *)phys_to_virt(apic->trampoline_phys_high)) =
Yinghai Lu569712b2008-11-16 03:12:49 -080017 start_eip >> 4;
Thomas Gleixnercfc1b9a2008-07-21 21:35:38 +020018 pr_debug("2.\n");
Ingo Molnar6f177c02009-01-28 16:09:23 +010019 *((volatile unsigned short *)phys_to_virt(apic->trampoline_phys_low)) =
Yinghai Lu569712b2008-11-16 03:12:49 -080020 start_eip & 0xf;
Thomas Gleixnercfc1b9a2008-07-21 21:35:38 +020021 pr_debug("3.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -070022}
23
24static inline void smpboot_restore_warm_reset_vector(void)
25{
26 /*
27 * Install writable page 0 entry to set BIOS data area.
28 */
29 local_flush_tlb();
30
31 /*
32 * Paranoid: Set warm reset code and vector here back
33 * to default values.
34 */
35 CMOS_WRITE(0, 0xf);
36
Ingo Molnar6f177c02009-01-28 16:09:23 +010037 *((volatile long *)phys_to_virt(apic->trampoline_phys_low)) = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070038}
39
Jacek Luczakb6dbf332008-04-11 13:28:49 +020040static inline void __init smpboot_setup_io_apic(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070041{
Ingo Molnar6a64b5d2008-07-10 15:09:04 +020042#ifdef CONFIG_X86_IO_APIC
Linus Torvalds1da177e2005-04-16 15:20:36 -070043 /*
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();
Maciej W. Rozyckid788bad2008-06-06 03:28:13 +010049 else {
Glauber de Oliveira Costa3fa7b342008-03-19 14:26:06 -030050 nr_ioapics = 0;
Maciej W. Rozyckid788bad2008-06-06 03:28:13 +010051 localise_nmi_watchdog();
52 }
Ingo Molnar6a64b5d2008-07-10 15:09:04 +020053#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070054}
Glauber de Oliveira Costa9f3734f2008-03-19 14:26:10 -030055
56static inline void smpboot_clear_io_apic(void)
57{
Ingo Molnar6a64b5d2008-07-10 15:09:04 +020058#ifdef CONFIG_X86_IO_APIC
Glauber de Oliveira Costa9f3734f2008-03-19 14:26:10 -030059 nr_ioapics = 0;
Ingo Molnar6a64b5d2008-07-10 15:09:04 +020060#endif
Glauber de Oliveira Costa9f3734f2008-03-19 14:26:10 -030061}