[patch 1/2] x86: apic unification - merge down lapic_get_maxlvt

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <mingo@...>, <hpa@...>, <linux-kernel@...>, <tglx@...>, <macro@...>
Cc: <gorcunov@...>
Date: Wednesday, December 31, 1969 - 8:00 pm

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---

No code change on binary level.

Index: linux-2.6.git/arch/x86/kernel/apic_32.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/apic_32.c	2008-07-24 13:40:58.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/apic_32.c	2008-07-24 13:48:52.000000000 +0400
@@ -226,9 +226,13 @@ int get_physical_broadcast(void)
  */
 int lapic_get_maxlvt(void)
 {
-	unsigned int v = apic_read(APIC_LVR);
+	unsigned int v;
 
-	/* 82489DXs do not report # of LVT entries. */
+	v = apic_read(APIC_LVR);
+	/*
+	 * - we always have APIC integrated on 64bit mode
+	 * - 82489DXs do not report # of LVT entries
+	 */
 	return APIC_INTEGRATED(GET_APIC_VERSION(v)) ? GET_APIC_MAXLVT(v) : 2;
 }
 
Index: linux-2.6.git/arch/x86/kernel/apic_64.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/apic_64.c	2008-07-24 13:40:58.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/apic_64.c	2008-07-24 13:48:38.000000000 +0400
@@ -228,11 +228,14 @@ void __cpuinit enable_NMI_through_LVT0(v
  */
 int lapic_get_maxlvt(void)
 {
-	unsigned int v, maxlvt;
+	unsigned int v;
 
 	v = apic_read(APIC_LVR);
-	maxlvt = GET_APIC_MAXLVT(v);
-	return maxlvt;
+	/*
+	 * - we always have APIC integrated on 64bit mode
+	 * - 82489DXs do not report # of LVT entries
+	 */
+	return APIC_INTEGRATED(GET_APIC_VERSION(v)) ? GET_APIC_MAXLVT(v) : 2;
 }
 
 /*

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 1/2] x86: apic unification - merge down lapic_get_max..., Cyrill Gorcunov, (Wed Dec 31, 8:00 pm)
Re: Happy New Year (and v2.6.20-rc3 released), Alessandro Suardi, (Mon Jan 1, 9:28 am)
Re: Happy New Year (and v2.6.20-rc3 released), Linus Torvalds, (Mon Jan 1, 4:13 pm)
Re: Happy New Year (and v2.6.20-rc3 released), Jeff Garzik, (Mon Jan 1, 4:49 pm)
Re: Happy New Year (and v2.6.20-rc3 released), Linus Torvalds, (Mon Jan 1, 7:34 pm)
Re: Happy New Year (and v2.6.20-rc3 released), Theodore Tso, (Mon Jan 1, 10:32 pm)
Re: Happy New Year (and v2.6.20-rc3 released), Linus Torvalds, (Tue Jan 2, 12:09 pm)