From owner-freebsd-current Thu Sep 10 09:17:39 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA27284 for freebsd-current-outgoing; Thu, 10 Sep 1998 09:17:39 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from Ilsa.StevesCafe.com (Ilsa.StevesCafe.com [205.168.119.129]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA27274 for ; Thu, 10 Sep 1998 09:17:36 -0700 (PDT) (envelope-from fbsd@Ilsa.StevesCafe.com) Received: from Ilsa.StevesCafe.com (localhost.StevesCafe.com [127.0.0.1]) by Ilsa.StevesCafe.com (8.8.8/8.8.5) with ESMTP id KAA05181 for ; Thu, 10 Sep 1998 10:17:25 -0600 (MDT) Message-Id: <199809101617.KAA05181@Ilsa.StevesCafe.com> X-Mailer: exmh version 2.0.2 2/24/98 From: Steve Passe To: freebsd-current@FreeBSD.ORG Subject: recocking NMIs Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 10 Sep 1998 10:17:25 -0600 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, A while back I reported that NMIs weren't properly reset in the kernel. I promised to send a patch, but never got around to it. While getting the thread patch I just sent, I stumbled across it. I use it in an LKM, which is proprietary code, so I can just submit the relevant chunk, someone else will have to integrate it into the kernel. The basic problem is that the first firing of the NMI leaves its input latched, preventing further NMIs till its cleared. The NMI_EDGE thingy is to allow multiple simultanious NMIs. Note that I could NOT get the NMI_EDGE part to work on our hardware. Note that this code is specific for NMIs coming from the ISA bus, ie NOT from the MB sources (watchdog and parity error). A comment marks the point needing additional work for this. When researching this issue I found at least 4 different descriptions of how NMI is handled by the motherboard, most incompatable with the rest. I suspect that they all were true for one MB or another. The following is based on the implimentation as defined by the PIIX chip, so it should work on most modern MBs. --- #define NMI_CREATE_EDGE_NOT /* diddle the IOCHK# NMI registers */ inb $0x61, %al /* current PORT-B contents */ /* XXX: need to test source bits, assume IOCHK# for now... */ andb $0x0f, %al /* PIIX wants upper bits 0 on write */ orb $0x08, %al /* IOCHK# high to clear */ outb %al, $0x61 andb $0x07, %al /* IOCHK# low to enable */ outb %al, $0x61 #ifdef NMI_CREATE_EDGE /* * If another NMI source fired while we run this code the * line is held active by that card and the signal is 'lost'. * So we disable/enable NMIs to re-create missing edge. */ inb $0x70, %al /* get NMI/RTC register */ orb $0x80, %al /* disable NMIs */ outb %al, $0x70 andb $0x7f, %al /* re-enable NMIs */ outb %al, $0x70 #endif /* NMI_CREATE_EDGE */ -- Steve Passe | powered by smp@csn.net | Symmetric MultiProcessor FreeBSD To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message