summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2002-03-13 05:58:45 +0000
committerjake <jake@FreeBSD.org>2002-03-13 05:58:45 +0000
commit31419a58a4100975fff9b19aed50c7806d0e924f (patch)
treedd146c2683745b019e878c4e3851f142e761d63c /sys
parentb767cbaa7aa34db7e0d83b435e4252b35854e23f (diff)
downloadFreeBSD-src-31419a58a4100975fff9b19aed50c7806d0e924f.zip
FreeBSD-src-31419a58a4100975fff9b19aed50c7806d0e924f.tar.gz
Add a DEBUGGER_ON_POWERFAIL option. This makes the power button on ultra 10s
work like an NMI button.
Diffstat (limited to 'sys')
-rw-r--r--sys/conf/options.sparc641
-rw-r--r--sys/sparc64/pci/psycho.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/sys/conf/options.sparc64 b/sys/conf/options.sparc64
index 01a3fb4..8fc55a9 100644
--- a/sys/conf/options.sparc64
+++ b/sys/conf/options.sparc64
@@ -8,6 +8,7 @@ PANIC_REBOOT_WAIT_TIME opt_panic.h
EBUS_DEBUG opt_ebus.h
PSYCHO_DEBUG opt_psycho.h
PSYCHO_STRAY opt_psycho.h
+DEBUGGER_ON_POWERFAIL opt_psycho.h
OFW_PCI_DEBUG opt_ofw_pci.h
# Normal IOMMU debugging
IOMMU_DEBUG opt_iommu.h
diff --git a/sys/sparc64/pci/psycho.c b/sys/sparc64/pci/psycho.c
index d790364..045281e 100644
--- a/sys/sparc64/pci/psycho.c
+++ b/sys/sparc64/pci/psycho.c
@@ -760,8 +760,15 @@ psycho_powerfail(void *arg)
{
/* We lost power. Try to shut down NOW. */
+#ifdef DEBUGGER_ON_POWERFAIL
+ struct psycho_softc *sc = (struct psycho_softc *)arg;
+
+ Debugger("powerfail");
+ PSYCHO_WRITE8(sc, PSR_POWER_INT_CLR, 0);
+#else
printf("Power Failure Detected: Shutting down NOW.\n");
shutdown_nice(0);
+#endif
}
#ifdef PSYCHO_MAP_WAKEUP
OpenPOWER on IntegriCloud