diff options
-rw-r--r-- | sys/conf/options.sparc64 | 1 | ||||
-rw-r--r-- | sys/sparc64/pci/psycho.c | 7 |
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 |