summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMasao Uebayashi <uebayasi@cvs.openbsd.org>2014-07-12 22:37:04 +0000
committerMasao Uebayashi <uebayasi@cvs.openbsd.org>2014-07-12 22:37:04 +0000
commitf3f99ad791727b41582218b884529e43aa7b026f (patch)
treefc5f070a051451ff78e38cf5117ea14da0c8c958 /sys
parentadaab4ef7a74e2b50b495d1427460fa446fece27 (diff)
reboot(9), panic(9): Call panic(9) for unrecoverable MD H/W errors (NMIs)
Some architectures have ability to detect hardware sanity and notify system (NMI, firmware callback, etc.). Handle these hardware severe errors, same as software errors, with panic(9). According to miod@, SGI IP27 NMI is triggered by pushing some "hidden" button, which "usual" users/admins don't know. Pushing such a button is "RB_USERREQ" (human-triggered) in that the button is pushed by a human, but not "RB_USERREQ" in that no user intervention in system (== no command input) is done. miod@ agreed that changing these from RB_USERREQ to !RB_USERREQ (== panic(9)) is not a big problem. OK miod@ kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/hppa/hppa/machdep.c8
-rw-r--r--sys/arch/hppa64/hppa64/machdep.c8
-rw-r--r--sys/arch/sgi/sgi/ip27_machdep.c7
-rw-r--r--sys/arch/sgi/sgi/ip30_machdep.c7
-rw-r--r--sys/arch/sparc64/dev/psycho.c7
5 files changed, 15 insertions, 22 deletions
diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c
index 0aed6c706ba..3e62f4d2c68 100644
--- a/sys/arch/hppa/hppa/machdep.c
+++ b/sys/arch/hppa/hppa/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.227 2014/07/12 14:12:44 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.228 2014/07/12 22:37:03 uebayasi Exp $ */
/*
* Copyright (c) 1999-2003 Michael Shalayeff
@@ -32,7 +32,6 @@
#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/buf.h>
-#include <sys/reboot.h>
#include <sys/device.h>
#include <sys/conf.h>
#include <sys/file.h>
@@ -995,10 +994,9 @@ cpu_dumpsize(void)
void
hpmc_dump(void)
{
- printf("HPMC\n");
-
cold = 0;
- reboot(RB_NOSYNC);
+ panic("HPMC");
+ /* NOTREACHED */
}
int
diff --git a/sys/arch/hppa64/hppa64/machdep.c b/sys/arch/hppa64/hppa64/machdep.c
index d9158d892cd..86a68cf1a4a 100644
--- a/sys/arch/hppa64/hppa64/machdep.c
+++ b/sys/arch/hppa64/hppa64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.65 2014/07/12 14:12:44 uebayasi Exp $ */
+/* $OpenBSD: machdep.c,v 1.66 2014/07/12 22:37:03 uebayasi Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -23,7 +23,6 @@
#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/buf.h>
-#include <sys/reboot.h>
#include <sys/device.h>
#include <sys/conf.h>
#include <sys/file.h>
@@ -628,10 +627,9 @@ cpu_dumpsize(void)
void
hpmc_dump(void)
{
- printf("HPMC\n");
-
cold = 0;
- reboot(RB_NOSYNC);
+ panic("HPMC");
+ /* NOTREACHED */
}
int
diff --git a/sys/arch/sgi/sgi/ip27_machdep.c b/sys/arch/sgi/sgi/ip27_machdep.c
index 4e4a5da76d2..f7c748ff312 100644
--- a/sys/arch/sgi/sgi/ip27_machdep.c
+++ b/sys/arch/sgi/sgi/ip27_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip27_machdep.c,v 1.61 2014/07/12 18:44:42 tedu Exp $ */
+/* $OpenBSD: ip27_machdep.c,v 1.62 2014/07/12 22:37:03 uebayasi Exp $ */
/*
* Copyright (c) 2008, 2009 Miodrag Vallat.
@@ -26,7 +26,6 @@
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/malloc.h>
-#include <sys/reboot.h>
#include <sys/tty.h>
#include <mips64/arcbios.h>
@@ -933,6 +932,6 @@ ip27_nmi(void *arg)
#ifdef DDB
(void)kdb_trap(-1, &nmi_frame);
#endif
- printf("Resetting system...\n");
- reboot(RB_USERREQ);
+ panic("NMI");
+ /* NOTREACHED */
}
diff --git a/sys/arch/sgi/sgi/ip30_machdep.c b/sys/arch/sgi/sgi/ip30_machdep.c
index 6992aefa535..2964bd13b3d 100644
--- a/sys/arch/sgi/sgi/ip30_machdep.c
+++ b/sys/arch/sgi/sgi/ip30_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip30_machdep.c,v 1.61 2014/07/12 14:12:44 uebayasi Exp $ */
+/* $OpenBSD: ip30_machdep.c,v 1.62 2014/07/12 22:37:03 uebayasi Exp $ */
/*
* Copyright (c) 2008, 2009 Miodrag Vallat.
@@ -24,7 +24,6 @@
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/device.h>
-#include <sys/reboot.h>
#include <sys/tty.h>
#include <mips64/arcbios.h>
@@ -482,8 +481,8 @@ ip30_nmi_handler()
kdb_trap(-1, fr0);
splx(s);
- printf("Resetting system...\n");
- reboot(RB_USERREQ);
+ panic("NMI");
+ /* NOTREACHED */
}
#endif
diff --git a/sys/arch/sparc64/dev/psycho.c b/sys/arch/sparc64/dev/psycho.c
index f83d2a8ab49..5dde1429d63 100644
--- a/sys/arch/sparc64/dev/psycho.c
+++ b/sys/arch/sparc64/dev/psycho.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: psycho.c,v 1.72 2014/07/12 18:44:43 tedu Exp $ */
+/* $OpenBSD: psycho.c,v 1.73 2014/07/12 22:37:03 uebayasi Exp $ */
/* $NetBSD: psycho.c,v 1.39 2001/10/07 20:30:41 eeh Exp $ */
/*
@@ -43,7 +43,6 @@
#include <sys/systm.h>
#include <sys/time.h>
#include <sys/timetc.h>
-#include <sys/reboot.h>
#include <uvm/uvm_extern.h>
@@ -838,8 +837,8 @@ psycho_powerfail(void *arg)
/*
* We lost power. Try to shut down NOW.
*/
- printf("Power Failure Detected: Shutting down NOW.\n");
- reboot(RB_POWERDOWN | RB_HALT);
+ panic("Power Failure Detected");
+ /* NOTREACHED */
return (1);
}