summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2009-10-31 20:26:44 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2009-10-31 20:26:44 +0000
commit8f8685affa1f1960cfaa44476c713e95447bebbc (patch)
treec77e91283119a659d219ca10a2fd6cabf64fef50 /sys/arch/sparc64
parent90e373b1248bb464461fde4e785bc3960d46fe23 (diff)
Establish a shutdown hook to disable the watchdog timer to prevent watchdog
triggers after the kernel has been halted.
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/dev/lom.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/arch/sparc64/dev/lom.c b/sys/arch/sparc64/dev/lom.c
index 6b4e0e98fda..6949a3fb98b 100644
--- a/sys/arch/sparc64/dev/lom.c
+++ b/sys/arch/sparc64/dev/lom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lom.c,v 1.17 2009/10/31 19:13:37 kettenis Exp $ */
+/* $OpenBSD: lom.c,v 1.18 2009/10/31 20:26:43 kettenis Exp $ */
/*
* Copyright (c) 2009 Mark Kettenis
*
@@ -212,6 +212,8 @@ void lom2_write_hostname(struct lom_softc *);
void lom_wdog_pat(void *);
int lom_wdog_cb(void *, int);
+void lom_shutdown(void *);
+
int
lom_match(struct device *parent, void *match, void *aux)
{
@@ -340,6 +342,8 @@ lom_attach(struct device *parent, struct device *self, void *aux)
printf(": %s rev %d.%d\n",
sc->sc_type < LOM_LOMLITE2 ? "LOMlite" : "LOMlite2",
fw_rev >> 4, fw_rev & 0x0f);
+
+ shutdownhook_establish(lom_shutdown, sc);
}
int
@@ -919,3 +923,12 @@ lom_wdog_cb(void *arg, int period)
return (period);
}
+
+void
+lom_shutdown(void *arg)
+{
+ struct lom_softc *sc = arg;
+
+ sc->sc_wdog_ctl &= ~LOM_WDOG_ENABLE;
+ lom_write(sc, LOM_IDX_WDOG_CTL, sc->sc_wdog_ctl);
+}