From f99e00da2cd661688417af3f125f9f98cbefeecb Mon Sep 17 00:00:00 2001 From: Fernando Luis VazquezCao Date: Wed, 2 May 2007 19:27:17 +0200 Subject: [PATCH] --- yaml --- r: 53893 b: refs/heads/master c: f2b218dd6199983b120a96bc6531c1b81f4090d8 h: refs/heads/master i: 53891: 826ee571ef60bab2a05169040ad256804ce03e2f v: v3 --- [refs] | 2 +- trunk/arch/i386/kernel/apic.c | 22 ++++++++++++++++++++++ trunk/include/asm-i386/apic.h | 9 +++------ 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 5cac0c8b261d..ae991344cc57 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: de938c51d5fec4ae03af64b06beb15d4423ec611 +refs/heads/master: f2b218dd6199983b120a96bc6531c1b81f4090d8 diff --git a/trunk/arch/i386/kernel/apic.c b/trunk/arch/i386/kernel/apic.c index 93aa911646ad..aca054cc0552 100644 --- a/trunk/arch/i386/kernel/apic.c +++ b/trunk/arch/i386/kernel/apic.c @@ -129,6 +129,28 @@ static int modern_apic(void) return lapic_get_version() >= 0x14; } +void apic_wait_icr_idle(void) +{ + while (apic_read(APIC_ICR) & APIC_ICR_BUSY) + cpu_relax(); +} + +unsigned long safe_apic_wait_icr_idle(void) +{ + unsigned long send_status; + int timeout; + + timeout = 0; + do { + send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY; + if (!send_status) + break; + udelay(100); + } while (timeout++ < 1000); + + return send_status; +} + /** * enable_NMI_through_LVT0 - enable NMI through local vector table 0 */ diff --git a/trunk/include/asm-i386/apic.h b/trunk/include/asm-i386/apic.h index a19810a08ae9..1e8f6f252dd3 100644 --- a/trunk/include/asm-i386/apic.h +++ b/trunk/include/asm-i386/apic.h @@ -2,6 +2,7 @@ #define __ASM_APIC_H #include +#include #include #include #include @@ -64,12 +65,8 @@ static __inline fastcall unsigned long native_apic_read(unsigned long reg) return *((volatile unsigned long *)(APIC_BASE+reg)); } -static __inline__ void apic_wait_icr_idle(void) -{ - while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY ) - cpu_relax(); -} - +void apic_wait_icr_idle(void); +unsigned long safe_apic_wait_icr_idle(void); int get_physical_broadcast(void); #ifdef CONFIG_X86_GOOD_APIC