diff options
-rw-r--r-- | arch/i386/kernel/apic.c | 22 | ||||
-rw-r--r-- | include/asm-i386/apic.h | 9 |
2 files changed, 25 insertions, 6 deletions
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c index 93aa911646ad..aca054cc0552 100644 --- a/arch/i386/kernel/apic.c +++ b/arch/i386/kernel/apic.c | |||
@@ -129,6 +129,28 @@ static int modern_apic(void) | |||
129 | return lapic_get_version() >= 0x14; | 129 | return lapic_get_version() >= 0x14; |
130 | } | 130 | } |
131 | 131 | ||
132 | void apic_wait_icr_idle(void) | ||
133 | { | ||
134 | while (apic_read(APIC_ICR) & APIC_ICR_BUSY) | ||
135 | cpu_relax(); | ||
136 | } | ||
137 | |||
138 | unsigned long safe_apic_wait_icr_idle(void) | ||
139 | { | ||
140 | unsigned long send_status; | ||
141 | int timeout; | ||
142 | |||
143 | timeout = 0; | ||
144 | do { | ||
145 | send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY; | ||
146 | if (!send_status) | ||
147 | break; | ||
148 | udelay(100); | ||
149 | } while (timeout++ < 1000); | ||
150 | |||
151 | return send_status; | ||
152 | } | ||
153 | |||
132 | /** | 154 | /** |
133 | * enable_NMI_through_LVT0 - enable NMI through local vector table 0 | 155 | * enable_NMI_through_LVT0 - enable NMI through local vector table 0 |
134 | */ | 156 | */ |
diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h index a19810a08ae9..1e8f6f252dd3 100644 --- a/include/asm-i386/apic.h +++ b/include/asm-i386/apic.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __ASM_APIC_H | 2 | #define __ASM_APIC_H |
3 | 3 | ||
4 | #include <linux/pm.h> | 4 | #include <linux/pm.h> |
5 | #include <linux/delay.h> | ||
5 | #include <asm/fixmap.h> | 6 | #include <asm/fixmap.h> |
6 | #include <asm/apicdef.h> | 7 | #include <asm/apicdef.h> |
7 | #include <asm/processor.h> | 8 | #include <asm/processor.h> |
@@ -64,12 +65,8 @@ static __inline fastcall unsigned long native_apic_read(unsigned long reg) | |||
64 | return *((volatile unsigned long *)(APIC_BASE+reg)); | 65 | return *((volatile unsigned long *)(APIC_BASE+reg)); |
65 | } | 66 | } |
66 | 67 | ||
67 | static __inline__ void apic_wait_icr_idle(void) | 68 | void apic_wait_icr_idle(void); |
68 | { | 69 | unsigned long safe_apic_wait_icr_idle(void); |
69 | while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY ) | ||
70 | cpu_relax(); | ||
71 | } | ||
72 | |||
73 | int get_physical_broadcast(void); | 70 | int get_physical_broadcast(void); |
74 | 71 | ||
75 | #ifdef CONFIG_X86_GOOD_APIC | 72 | #ifdef CONFIG_X86_GOOD_APIC |