blob: 725b7783199328c936bb10350d55b797b661315e [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
Don Zickus299c5692011-02-07 23:25:00 -050037 *((volatile u32 *)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 }
Ingo Molnar6a64b5d2008-07-10 15:09:04 +020052#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070053}
Glauber de Oliveira Costa9f3734f2008-03-19 14:26:10 -030054
55static inline void smpboot_clear_io_apic(void)
56{
Ingo Molnar6a64b5d2008-07-10 15:09:04 +020057#ifdef CONFIG_X86_IO_APIC
Glauber de Oliveira Costa9f3734f2008-03-19 14:26:10 -030058 nr_ioapics = 0;
Ingo Molnar6a64b5d2008-07-10 15:09:04 +020059#endif
Glauber de Oliveira Costa9f3734f2008-03-19 14:26:10 -030060}