* [patch 1/2] x86: apic unification - merge down lapic_get_maxlvt
[not found] <20080724112241.164873410@gmail.com>
@ 1970-01-01 0:00 ` Cyrill Gorcunov
1970-01-01 0:00 ` [patch 2/2] x86: apic unification - merge down enable_NMI_through_LVT0 Cyrill Gorcunov
1 sibling, 0 replies; 3+ messages in thread
From: Cyrill Gorcunov @ 1970-01-01 0:00 UTC (permalink / raw)
To: mingo, hpa, linux-kernel, tglx, macro; +Cc: gorcunov
[-- Attachment #1: x86-apic-merge-lapic_get_maxlvt --]
[-- Type: text/plain, Size: 1479 bytes --]
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;
}
/*
--
^ permalink raw reply [flat|nested] 3+ messages in thread
* [patch 2/2] x86: apic unification - merge down enable_NMI_through_LVT0
[not found] <20080724112241.164873410@gmail.com>
1970-01-01 0:00 ` [patch 1/2] x86: apic unification - merge down lapic_get_maxlvt Cyrill Gorcunov
@ 1970-01-01 0:00 ` Cyrill Gorcunov
1 sibling, 0 replies; 3+ messages in thread
From: Cyrill Gorcunov @ 1970-01-01 0:00 UTC (permalink / raw)
To: mingo, hpa, linux-kernel, tglx, macro; +Cc: gorcunov
[-- Attachment #1: x86-apic-merge-enable_NMI_through_LVT0 --]
[-- Type: text/plain, Size: 1306 bytes --]
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 14:16:55.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/apic_32.c 2008-07-24 14:22:00.000000000 +0400
@@ -205,11 +205,15 @@ EXPORT_SYMBOL_GPL(apic_ops);
*/
void __cpuinit enable_NMI_through_LVT0(void)
{
- unsigned int v = APIC_DM_NMI;
+ unsigned int v;
+
+ /* unmask and set to NMI */
+ v = APIC_DM_NMI;
- /* Level triggered for 82489DX */
+ /* Level triggered for 82489DX (32bit mode) */
if (!lapic_is_integrated())
v |= APIC_LVT_LEVEL_TRIGGER;
+
apic_write(APIC_LVT0, v);
}
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 14:16:55.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/apic_64.c 2008-07-24 14:22:09.000000000 +0400
@@ -220,6 +220,11 @@ void __cpuinit enable_NMI_through_LVT0(v
/* unmask and set to NMI */
v = APIC_DM_NMI;
+
+ /* Level triggered for 82489DX (32bit mode) */
+ if (!lapic_is_integrated())
+ v |= APIC_LVT_LEVEL_TRIGGER;
+
apic_write(APIC_LVT0, v);
}
--
^ permalink raw reply [flat|nested] 3+ messages in thread
* [patch 1/2] x86: apic unification - merge down lapic_get_maxlvt
2008-07-24 11:43 [patch 0/2] x86 apic - a few function merge v2 Cyrill Gorcunov
@ 1970-01-01 0:00 ` Cyrill Gorcunov
0 siblings, 0 replies; 3+ messages in thread
From: Cyrill Gorcunov @ 1970-01-01 0:00 UTC (permalink / raw)
To: mingo, linux-kernel, macro; +Cc: Cyrill Gorcunov
[-- Attachment #1: x86-apic-merge-lapic_get_maxlvt --]
[-- Type: text/plain, Size: 1479 bytes --]
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;
}
/*
--
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-07-24 11:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20080724112241.164873410@gmail.com>
1970-01-01 0:00 ` [patch 1/2] x86: apic unification - merge down lapic_get_maxlvt Cyrill Gorcunov
1970-01-01 0:00 ` [patch 2/2] x86: apic unification - merge down enable_NMI_through_LVT0 Cyrill Gorcunov
2008-07-24 11:43 [patch 0/2] x86 apic - a few function merge v2 Cyrill Gorcunov
1970-01-01 0:00 ` [patch 1/2] x86: apic unification - merge down lapic_get_maxlvt Cyrill Gorcunov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).