From b436e363443a1a03f98797ed042606d9b80e8f7e Mon Sep 17 00:00:00 2001 From: ps Date: Fri, 14 Jul 2000 11:49:44 +0000 Subject: Change the way NMI's are handled. Before, if DDB was enabled and a NMI occured, you could type continue in DDB and the kernel would not attempt to detect what type of NMI was recieved. Now we check for the type of NMI first and then go to DDB if it is enabled. This will solve the problem with having DDB enabled and getting an NMI due to some possibly bad error and being able to continue the operation of the kernel when you really want to panic and know what happened. Submitted by: jhb --- sys/amd64/amd64/trap.c | 26 ++++++++++++++------------ sys/i386/i386/trap.c | 26 ++++++++++++++------------ sys/kern/subr_trap.c | 26 ++++++++++++++------------ 3 files changed, 42 insertions(+), 36 deletions(-) (limited to 'sys') diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 83c83b4..3f87909 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -369,14 +369,15 @@ restart: #ifdef POWERFAIL_NMI goto handle_powerfail; #else /* !POWERFAIL_NMI */ + /* machine/parity/power fail/"kitchen sink" faults */ + if (isa_nmi(code) == 0) { #ifdef DDB - /* NMI can be hooked up to a pushbutton for debugging */ - printf ("NMI ... going to debugger\n"); - if (kdb_trap (type, 0, &frame)) - return; + /* NMI can be hooked up to a pushbutton for debugging */ + printf ("NMI ... going to debugger\n"); + kdb_trap (type, 0, &frame); #endif /* DDB */ - /* machine/parity/power fail/"kitchen sink" faults */ - if (isa_nmi(code) == 0) return; + return; + } panic("NMI indicates hardware failure"); #endif /* POWERFAIL_NMI */ #endif /* NISA > 0 */ @@ -573,14 +574,15 @@ kernel_trap: return; } #else /* !POWERFAIL_NMI */ + /* machine/parity/power fail/"kitchen sink" faults */ + if (isa_nmi(code) == 0) { #ifdef DDB - /* NMI can be hooked up to a pushbutton for debugging */ - printf ("NMI ... going to debugger\n"); - if (kdb_trap (type, 0, &frame)) - return; + /* NMI can be hooked up to a pushbutton for debugging */ + printf ("NMI ... going to debugger\n"); + kdb_trap (type, 0, &frame); #endif /* DDB */ - /* machine/parity/power fail/"kitchen sink" faults */ - if (isa_nmi(code) == 0) return; + return; + } /* FALL THROUGH */ #endif /* POWERFAIL_NMI */ #endif /* NISA > 0 */ diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index 83c83b4..3f87909 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -369,14 +369,15 @@ restart: #ifdef POWERFAIL_NMI goto handle_powerfail; #else /* !POWERFAIL_NMI */ + /* machine/parity/power fail/"kitchen sink" faults */ + if (isa_nmi(code) == 0) { #ifdef DDB - /* NMI can be hooked up to a pushbutton for debugging */ - printf ("NMI ... going to debugger\n"); - if (kdb_trap (type, 0, &frame)) - return; + /* NMI can be hooked up to a pushbutton for debugging */ + printf ("NMI ... going to debugger\n"); + kdb_trap (type, 0, &frame); #endif /* DDB */ - /* machine/parity/power fail/"kitchen sink" faults */ - if (isa_nmi(code) == 0) return; + return; + } panic("NMI indicates hardware failure"); #endif /* POWERFAIL_NMI */ #endif /* NISA > 0 */ @@ -573,14 +574,15 @@ kernel_trap: return; } #else /* !POWERFAIL_NMI */ + /* machine/parity/power fail/"kitchen sink" faults */ + if (isa_nmi(code) == 0) { #ifdef DDB - /* NMI can be hooked up to a pushbutton for debugging */ - printf ("NMI ... going to debugger\n"); - if (kdb_trap (type, 0, &frame)) - return; + /* NMI can be hooked up to a pushbutton for debugging */ + printf ("NMI ... going to debugger\n"); + kdb_trap (type, 0, &frame); #endif /* DDB */ - /* machine/parity/power fail/"kitchen sink" faults */ - if (isa_nmi(code) == 0) return; + return; + } /* FALL THROUGH */ #endif /* POWERFAIL_NMI */ #endif /* NISA > 0 */ diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 83c83b4..3f87909 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -369,14 +369,15 @@ restart: #ifdef POWERFAIL_NMI goto handle_powerfail; #else /* !POWERFAIL_NMI */ + /* machine/parity/power fail/"kitchen sink" faults */ + if (isa_nmi(code) == 0) { #ifdef DDB - /* NMI can be hooked up to a pushbutton for debugging */ - printf ("NMI ... going to debugger\n"); - if (kdb_trap (type, 0, &frame)) - return; + /* NMI can be hooked up to a pushbutton for debugging */ + printf ("NMI ... going to debugger\n"); + kdb_trap (type, 0, &frame); #endif /* DDB */ - /* machine/parity/power fail/"kitchen sink" faults */ - if (isa_nmi(code) == 0) return; + return; + } panic("NMI indicates hardware failure"); #endif /* POWERFAIL_NMI */ #endif /* NISA > 0 */ @@ -573,14 +574,15 @@ kernel_trap: return; } #else /* !POWERFAIL_NMI */ + /* machine/parity/power fail/"kitchen sink" faults */ + if (isa_nmi(code) == 0) { #ifdef DDB - /* NMI can be hooked up to a pushbutton for debugging */ - printf ("NMI ... going to debugger\n"); - if (kdb_trap (type, 0, &frame)) - return; + /* NMI can be hooked up to a pushbutton for debugging */ + printf ("NMI ... going to debugger\n"); + kdb_trap (type, 0, &frame); #endif /* DDB */ - /* machine/parity/power fail/"kitchen sink" faults */ - if (isa_nmi(code) == 0) return; + return; + } /* FALL THROUGH */ #endif /* POWERFAIL_NMI */ #endif /* NISA > 0 */ -- cgit v1.1