Merge branch 'regmap-linus' into regmap-next
[deliverable/linux.git] / arch / x86 / include / asm / smpboot_hooks.h
CommitLineData
1da177e4
LT
1/* 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{
6a64b5da 6#ifdef CONFIG_X86_IO_APIC
1da177e4 7 io_apic_irqs = 0;
6a64b5da 8#endif
1da177e4
LT
9}
10
11static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip)
12{
ac619f4e
JB
13 unsigned long flags;
14
15 spin_lock_irqsave(&rtc_lock, flags);
1da177e4 16 CMOS_WRITE(0xa, 0xf);
ac619f4e 17 spin_unlock_irqrestore(&rtc_lock, flags);
1da177e4 18 local_flush_tlb();
cfc1b9a6 19 pr_debug("1.\n");
6f177c01 20 *((volatile unsigned short *)phys_to_virt(apic->trampoline_phys_high)) =
569712b2 21 start_eip >> 4;
cfc1b9a6 22 pr_debug("2.\n");
6f177c01 23 *((volatile unsigned short *)phys_to_virt(apic->trampoline_phys_low)) =
569712b2 24 start_eip & 0xf;
cfc1b9a6 25 pr_debug("3.\n");
1da177e4
LT
26}
27
28static inline void smpboot_restore_warm_reset_vector(void)
29{
ac619f4e
JB
30 unsigned long flags;
31
1da177e4
LT
32 /*
33 * Install writable page 0 entry to set BIOS data area.
34 */
35 local_flush_tlb();
36
37 /*
38 * Paranoid: Set warm reset code and vector here back
39 * to default values.
40 */
ac619f4e 41 spin_lock_irqsave(&rtc_lock, flags);
1da177e4 42 CMOS_WRITE(0, 0xf);
ac619f4e 43 spin_unlock_irqrestore(&rtc_lock, flags);
1da177e4 44
299c5696 45 *((volatile u32 *)phys_to_virt(apic->trampoline_phys_low)) = 0;
1da177e4
LT
46}
47
b6dbf334 48static inline void __init smpboot_setup_io_apic(void)
1da177e4 49{
6a64b5da 50#ifdef CONFIG_X86_IO_APIC
1da177e4
LT
51 /*
52 * Here we can be sure that there is an IO-APIC in the system. Let's
53 * go and set it up:
54 */
55 if (!skip_ioapic_setup && nr_ioapics)
56 setup_IO_APIC();
d788bada 57 else {
3fa7b348 58 nr_ioapics = 0;
d788bada 59 }
6a64b5da 60#endif
1da177e4 61}
9f3734f6
GOC
62
63static inline void smpboot_clear_io_apic(void)
64{
6a64b5da 65#ifdef CONFIG_X86_IO_APIC
9f3734f6 66 nr_ioapics = 0;
6a64b5da 67#endif
9f3734f6 68}
This page took 0.580465 seconds and 5 git commands to generate.