diff options
author | ps <ps@FreeBSD.org> | 2000-07-14 11:49:44 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2000-07-14 11:49:44 +0000 |
commit | b436e363443a1a03f98797ed042606d9b80e8f7e (patch) | |
tree | c47394fdb1ce78132c57822b987a4544009c5477 | |
parent | 2d06929aedd53838560a0c034a53f4bc8abe9ea4 (diff) | |
download | FreeBSD-src-b436e363443a1a03f98797ed042606d9b80e8f7e.zip FreeBSD-src-b436e363443a1a03f98797ed042606d9b80e8f7e.tar.gz |
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
-rw-r--r-- | sys/amd64/amd64/trap.c | 26 | ||||
-rw-r--r-- | sys/i386/i386/trap.c | 26 | ||||
-rw-r--r-- | sys/kern/subr_trap.c | 26 |
3 files changed, 42 insertions, 36 deletions
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 */ |