public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATHC -tip 1/2] x86, nmi: Define a name for NMI control port
@ 2011-02-28 21:40 Cyrill Gorcunov
  2011-03-01  7:57 ` Ingo Molnar
  0 siblings, 1 reply; 5+ messages in thread
From: Cyrill Gorcunov @ 2011-02-28 21:40 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner
  Cc: H. Peter Anvin, Don Zickus, Huang, Ying, lkml, Maciej W. Rozycki

Also add a comment anout why we need in-out operations.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
---
  arch/x86/include/asm/mach_traps.h |   18 +++++++++++++-----
  1 file changed, 13 insertions(+), 5 deletions(-)

Index: linux-2.6.git/arch/x86/include/asm/mach_traps.h
=====================================================================
--- linux-2.6.git.orig/arch/x86/include/asm/mach_traps.h
+++ linux-2.6.git/arch/x86/include/asm/mach_traps.h
@@ -8,6 +8,7 @@
  #include <asm/mc146818rtc.h>

  #define NMI_REASON_PORT		0x61
+#define NMI_ENABLE_PORT		0x70 /* Real-Time Clock Address Register as well */

  #define NMI_REASON_SERR		0x80
  #define NMI_REASON_IOCHK	0x40
@@ -30,12 +31,19 @@ static inline void reassert_nmi(void)
  		old_reg = current_lock_cmos_reg();
  	else
  		lock_cmos(0); /* register doesn't matter here */
-	outb(0x8f, 0x70);
-	inb(0x71);		/* dummy */
-	outb(0x0f, 0x70);
-	inb(0x71);		/* dummy */
+
+	/*
+	 * This will cause the NMI output to transition low
+	 * then high if there are any pending NMI sources. The
+	 * CPU's NMI input logic will then register a new NMI.
+	 */
+	outb(0x8f, NMI_ENABLE_PORT);
+	inb(0x71);	/* dummy */
+	outb(0x0f, NMI_ENABLE_PORT);
+	inb(0x71);	/* dummy */
+
  	if (old_reg >= 0)
-		outb(old_reg, 0x70);
+		outb(old_reg, NMI_ENABLE_PORT);
  	else
  		unlock_cmos();
  }
-- 
     Cyrill

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-01 17:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-28 21:40 [PATHC -tip 1/2] x86, nmi: Define a name for NMI control port Cyrill Gorcunov
2011-03-01  7:57 ` Ingo Molnar
2011-03-01  8:22   ` Cyrill Gorcunov
2011-03-01 17:33   ` Cyrill Gorcunov
2011-03-01 17:35     ` Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox