diff options
| author | Jeff Garzik <jeff@garzik.org> | 2006-04-12 16:54:43 -0400 |
|---|---|---|
| committer | Jeff Garzik <jeff@garzik.org> | 2006-04-12 16:54:43 -0400 |
| commit | a890b15c0990cc8d686edcc85f5fccde71ad5ce9 (patch) | |
| tree | 73162355b58283a2531f13fbbf663809f95c1483 /arch/i386/kernel/apic.c | |
| parent | 79fa1b677be3a985cc66b9218a4dd09818f1051b (diff) | |
| parent | 26ec634c31a11a003040e10b4d650495158632fd (diff) | |
Merge branch 'upstream'
Diffstat (limited to 'arch/i386/kernel/apic.c')
| -rw-r--r-- | arch/i386/kernel/apic.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c index 6273bf74c203..254cee9f0b7b 100644 --- a/arch/i386/kernel/apic.c +++ b/arch/i386/kernel/apic.c | |||
| @@ -62,6 +62,18 @@ int apic_verbosity; | |||
| 62 | 62 | ||
| 63 | static void apic_pm_activate(void); | 63 | static void apic_pm_activate(void); |
| 64 | 64 | ||
| 65 | int modern_apic(void) | ||
| 66 | { | ||
| 67 | unsigned int lvr, version; | ||
| 68 | /* AMD systems use old APIC versions, so check the CPU */ | ||
| 69 | if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD && | ||
| 70 | boot_cpu_data.x86 >= 0xf) | ||
| 71 | return 1; | ||
| 72 | lvr = apic_read(APIC_LVR); | ||
| 73 | version = GET_APIC_VERSION(lvr); | ||
| 74 | return version >= 0x14; | ||
| 75 | } | ||
| 76 | |||
| 65 | /* | 77 | /* |
| 66 | * 'what should we do if we get a hw irq event on an illegal vector'. | 78 | * 'what should we do if we get a hw irq event on an illegal vector'. |
| 67 | * each architecture has to answer this themselves. | 79 | * each architecture has to answer this themselves. |
| @@ -119,10 +131,7 @@ void enable_NMI_through_LVT0 (void * dummy) | |||
| 119 | 131 | ||
| 120 | int get_physical_broadcast(void) | 132 | int get_physical_broadcast(void) |
| 121 | { | 133 | { |
| 122 | unsigned int lvr, version; | 134 | if (modern_apic()) |
| 123 | lvr = apic_read(APIC_LVR); | ||
| 124 | version = GET_APIC_VERSION(lvr); | ||
| 125 | if (!APIC_INTEGRATED(version) || version >= 0x14) | ||
| 126 | return 0xff; | 135 | return 0xff; |
| 127 | else | 136 | else |
| 128 | return 0xf; | 137 | return 0xf; |
| @@ -349,9 +358,9 @@ int __init verify_local_APIC(void) | |||
| 349 | 358 | ||
| 350 | void __init sync_Arb_IDs(void) | 359 | void __init sync_Arb_IDs(void) |
| 351 | { | 360 | { |
| 352 | /* Unsupported on P4 - see Intel Dev. Manual Vol. 3, Ch. 8.6.1 */ | 361 | /* Unsupported on P4 - see Intel Dev. Manual Vol. 3, Ch. 8.6.1 |
| 353 | unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR)); | 362 | And not needed on AMD */ |
| 354 | if (ver >= 0x14) /* P4 or higher */ | 363 | if (modern_apic()) |
| 355 | return; | 364 | return; |
| 356 | /* | 365 | /* |
| 357 | * Wait for idle. | 366 | * Wait for idle. |
