diff options
author | Cyrill Gorcunov <gorcunov@openvz.org> | 2009-04-12 12:47:40 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-12 13:23:53 -0400 |
commit | c0eaa4536f08b98fbcfa7fce5b7b0de1bebcb0e1 (patch) | |
tree | 28562a6448397e6ad70651ac4d30c7c0de17b6f1 /arch/x86/kernel/apic/apic.c | |
parent | edea7148a87c099e5d5d4838285cc27e459588b7 (diff) |
x86: apic - introduce imcr_ helpers
Impact: cleanup
Distinguish port writting magic into helpers with comments.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
LKML-Reference: <20090412165058.535921550@openvz.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/apic/apic.c')
-rw-r--r-- | arch/x86/kernel/apic/apic.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 098ec84b8c00..c3be10f5773e 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -98,6 +98,29 @@ early_param("lapic", parse_lapic); | |||
98 | /* Local APIC was disabled by the BIOS and enabled by the kernel */ | 98 | /* Local APIC was disabled by the BIOS and enabled by the kernel */ |
99 | static int enabled_via_apicbase; | 99 | static int enabled_via_apicbase; |
100 | 100 | ||
101 | /* | ||
102 | * Handle interrupt mode configuration register (IMCR). | ||
103 | * This register controls whether the interrupt signals | ||
104 | * that reach the BSP come from the master PIC or from the | ||
105 | * local APIC. Before entering Symmetric I/O Mode, either | ||
106 | * the BIOS or the operating system must switch out of | ||
107 | * PIC Mode by changing the IMCR. | ||
108 | */ | ||
109 | static inline imcr_pic_to_apic(void) | ||
110 | { | ||
111 | /* select IMCR register */ | ||
112 | outb(0x70, 0x22); | ||
113 | /* NMI and 8259 INTR go through APIC */ | ||
114 | outb(0x01, 0x23); | ||
115 | } | ||
116 | |||
117 | static inline imcr_apic_to_pic(void) | ||
118 | { | ||
119 | /* select IMCR register */ | ||
120 | outb(0x70, 0x22); | ||
121 | /* NMI and 8259 INTR go directly to BSP */ | ||
122 | outb(0x00, 0x23); | ||
123 | } | ||
101 | #endif | 124 | #endif |
102 | 125 | ||
103 | #ifdef CONFIG_X86_64 | 126 | #ifdef CONFIG_X86_64 |
@@ -1727,8 +1750,7 @@ void __init connect_bsp_APIC(void) | |||
1727 | */ | 1750 | */ |
1728 | apic_printk(APIC_VERBOSE, "leaving PIC mode, " | 1751 | apic_printk(APIC_VERBOSE, "leaving PIC mode, " |
1729 | "enabling APIC mode.\n"); | 1752 | "enabling APIC mode.\n"); |
1730 | outb(0x70, 0x22); | 1753 | imcr_pic_to_apic(); |
1731 | outb(0x01, 0x23); | ||
1732 | } | 1754 | } |
1733 | #endif | 1755 | #endif |
1734 | if (apic->enable_apic_mode) | 1756 | if (apic->enable_apic_mode) |
@@ -1756,8 +1778,7 @@ void disconnect_bsp_APIC(int virt_wire_setup) | |||
1756 | */ | 1778 | */ |
1757 | apic_printk(APIC_VERBOSE, "disabling APIC mode, " | 1779 | apic_printk(APIC_VERBOSE, "disabling APIC mode, " |
1758 | "entering PIC mode.\n"); | 1780 | "entering PIC mode.\n"); |
1759 | outb(0x70, 0x22); | 1781 | imcr_apic_to_pic(); |
1760 | outb(0x00, 0x23); | ||
1761 | return; | 1782 | return; |
1762 | } | 1783 | } |
1763 | #endif | 1784 | #endif |