From a2575e01e8f7a197506e5325e91578104d9c970e Mon Sep 17 00:00:00 2001 From: Stephen McKay Date: Sun, 28 Sep 1997 15:48:34 +0000 Subject: [PATCH] Add a small hack to support the strange antics of the Unisys ELI 4003. This machine generates an NMI for each floating point error, just like an old XT. Since it is ISA only, reading the EISA status port yields 0xff, which would give a spurious EISA panic. The simplest thing to do is to ignore the 0xff. --- sys/amd64/isa/intr_machdep.c | 36 ++++++++++++++++++++++++------------ sys/amd64/isa/nmi.c | 36 ++++++++++++++++++++++++------------ sys/i386/isa/intr_machdep.c | 36 ++++++++++++++++++++++++------------ sys/i386/isa/nmi.c | 36 ++++++++++++++++++++++++------------ 4 files changed, 96 insertions(+), 48 deletions(-) diff --git a/sys/amd64/isa/intr_machdep.c b/sys/amd64/isa/intr_machdep.c index fd836dd5c3b..80ae7b8dba5 100644 --- a/sys/amd64/isa/intr_machdep.c +++ b/sys/amd64/isa/intr_machdep.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 - * $Id: intr_machdep.c,v 1.5 1997/08/29 18:45:19 fsmp Exp $ + * $Id: intr_machdep.c,v 1.6 1997/08/30 08:08:04 fsmp Exp $ */ #include "opt_auto_eoi.h" @@ -150,20 +150,32 @@ isa_nmi(cd) #else /* IBM-PC */ int isa_port = inb(0x61); int eisa_port = inb(0x461); - if(isa_port & NMI_PARITY) { + + if (isa_port & NMI_PARITY) panic("RAM parity error, likely hardware failure."); - } else if(isa_port & NMI_IOCHAN) { + + if (isa_port & NMI_IOCHAN) panic("I/O channel check, likely hardware failure."); - } else if(eisa_port & ENMI_WATCHDOG) { - panic("EISA watchdog timer expired, likely hardware failure."); - } else if(eisa_port & ENMI_BUSTIMER) { - panic("EISA bus timeout, likely hardware failure."); - } else if(eisa_port & ENMI_IOSTATUS) { - panic("EISA I/O port status error."); - } else { - printf("\nNMI ISA %x, EISA %x\n", isa_port, eisa_port); + + /* + * On a real EISA machine, this will never happen. However it can + * happen on ISA machines which implement XT style floating point + * error handling (very rare). Save them from a meaningless panic. + */ + if (eisa_port == 0xff) return(0); - } + + if (eisa_port & ENMI_WATCHDOG) + panic("EISA watchdog timer expired, likely hardware failure."); + + if (eisa_port & ENMI_BUSTIMER) + panic("EISA bus timeout, likely hardware failure."); + + if (eisa_port & ENMI_IOSTATUS) + panic("EISA I/O port status error."); + + printf("\nNMI ISA %x, EISA %x\n", isa_port, eisa_port); + return(0); #endif } diff --git a/sys/amd64/isa/nmi.c b/sys/amd64/isa/nmi.c index fd836dd5c3b..80ae7b8dba5 100644 --- a/sys/amd64/isa/nmi.c +++ b/sys/amd64/isa/nmi.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 - * $Id: intr_machdep.c,v 1.5 1997/08/29 18:45:19 fsmp Exp $ + * $Id: intr_machdep.c,v 1.6 1997/08/30 08:08:04 fsmp Exp $ */ #include "opt_auto_eoi.h" @@ -150,20 +150,32 @@ isa_nmi(cd) #else /* IBM-PC */ int isa_port = inb(0x61); int eisa_port = inb(0x461); - if(isa_port & NMI_PARITY) { + + if (isa_port & NMI_PARITY) panic("RAM parity error, likely hardware failure."); - } else if(isa_port & NMI_IOCHAN) { + + if (isa_port & NMI_IOCHAN) panic("I/O channel check, likely hardware failure."); - } else if(eisa_port & ENMI_WATCHDOG) { - panic("EISA watchdog timer expired, likely hardware failure."); - } else if(eisa_port & ENMI_BUSTIMER) { - panic("EISA bus timeout, likely hardware failure."); - } else if(eisa_port & ENMI_IOSTATUS) { - panic("EISA I/O port status error."); - } else { - printf("\nNMI ISA %x, EISA %x\n", isa_port, eisa_port); + + /* + * On a real EISA machine, this will never happen. However it can + * happen on ISA machines which implement XT style floating point + * error handling (very rare). Save them from a meaningless panic. + */ + if (eisa_port == 0xff) return(0); - } + + if (eisa_port & ENMI_WATCHDOG) + panic("EISA watchdog timer expired, likely hardware failure."); + + if (eisa_port & ENMI_BUSTIMER) + panic("EISA bus timeout, likely hardware failure."); + + if (eisa_port & ENMI_IOSTATUS) + panic("EISA I/O port status error."); + + printf("\nNMI ISA %x, EISA %x\n", isa_port, eisa_port); + return(0); #endif } diff --git a/sys/i386/isa/intr_machdep.c b/sys/i386/isa/intr_machdep.c index fd836dd5c3b..80ae7b8dba5 100644 --- a/sys/i386/isa/intr_machdep.c +++ b/sys/i386/isa/intr_machdep.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 - * $Id: intr_machdep.c,v 1.5 1997/08/29 18:45:19 fsmp Exp $ + * $Id: intr_machdep.c,v 1.6 1997/08/30 08:08:04 fsmp Exp $ */ #include "opt_auto_eoi.h" @@ -150,20 +150,32 @@ isa_nmi(cd) #else /* IBM-PC */ int isa_port = inb(0x61); int eisa_port = inb(0x461); - if(isa_port & NMI_PARITY) { + + if (isa_port & NMI_PARITY) panic("RAM parity error, likely hardware failure."); - } else if(isa_port & NMI_IOCHAN) { + + if (isa_port & NMI_IOCHAN) panic("I/O channel check, likely hardware failure."); - } else if(eisa_port & ENMI_WATCHDOG) { - panic("EISA watchdog timer expired, likely hardware failure."); - } else if(eisa_port & ENMI_BUSTIMER) { - panic("EISA bus timeout, likely hardware failure."); - } else if(eisa_port & ENMI_IOSTATUS) { - panic("EISA I/O port status error."); - } else { - printf("\nNMI ISA %x, EISA %x\n", isa_port, eisa_port); + + /* + * On a real EISA machine, this will never happen. However it can + * happen on ISA machines which implement XT style floating point + * error handling (very rare). Save them from a meaningless panic. + */ + if (eisa_port == 0xff) return(0); - } + + if (eisa_port & ENMI_WATCHDOG) + panic("EISA watchdog timer expired, likely hardware failure."); + + if (eisa_port & ENMI_BUSTIMER) + panic("EISA bus timeout, likely hardware failure."); + + if (eisa_port & ENMI_IOSTATUS) + panic("EISA I/O port status error."); + + printf("\nNMI ISA %x, EISA %x\n", isa_port, eisa_port); + return(0); #endif } diff --git a/sys/i386/isa/nmi.c b/sys/i386/isa/nmi.c index fd836dd5c3b..80ae7b8dba5 100644 --- a/sys/i386/isa/nmi.c +++ b/sys/i386/isa/nmi.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 - * $Id: intr_machdep.c,v 1.5 1997/08/29 18:45:19 fsmp Exp $ + * $Id: intr_machdep.c,v 1.6 1997/08/30 08:08:04 fsmp Exp $ */ #include "opt_auto_eoi.h" @@ -150,20 +150,32 @@ isa_nmi(cd) #else /* IBM-PC */ int isa_port = inb(0x61); int eisa_port = inb(0x461); - if(isa_port & NMI_PARITY) { + + if (isa_port & NMI_PARITY) panic("RAM parity error, likely hardware failure."); - } else if(isa_port & NMI_IOCHAN) { + + if (isa_port & NMI_IOCHAN) panic("I/O channel check, likely hardware failure."); - } else if(eisa_port & ENMI_WATCHDOG) { - panic("EISA watchdog timer expired, likely hardware failure."); - } else if(eisa_port & ENMI_BUSTIMER) { - panic("EISA bus timeout, likely hardware failure."); - } else if(eisa_port & ENMI_IOSTATUS) { - panic("EISA I/O port status error."); - } else { - printf("\nNMI ISA %x, EISA %x\n", isa_port, eisa_port); + + /* + * On a real EISA machine, this will never happen. However it can + * happen on ISA machines which implement XT style floating point + * error handling (very rare). Save them from a meaningless panic. + */ + if (eisa_port == 0xff) return(0); - } + + if (eisa_port & ENMI_WATCHDOG) + panic("EISA watchdog timer expired, likely hardware failure."); + + if (eisa_port & ENMI_BUSTIMER) + panic("EISA bus timeout, likely hardware failure."); + + if (eisa_port & ENMI_IOSTATUS) + panic("EISA I/O port status error."); + + printf("\nNMI ISA %x, EISA %x\n", isa_port, eisa_port); + return(0); #endif }