summaryrefslogtreecommitdiff
path: root/sys/dev/wscons/wsdisplay.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2013-05-30 16:15:03 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2013-05-30 16:15:03 +0000
commit0a2136fff807fb71339f3d499b31f09ef14bf891 (patch)
tree8996416e2647c8beebebaa3a97c2205aed0adce3 /sys/dev/wscons/wsdisplay.c
parent52c68f7659b12bec7c8ef0539aca056f2550327b (diff)
Enforce ca_activate tree-walks over the entire heirarchy for all events,
cleaning up some shutdown-hook related code on the way. (A few drivers related to sparc are still skipped at kettenis' request) ok kettenis mlarkin, tested by many others too
Diffstat (limited to 'sys/dev/wscons/wsdisplay.c')
-rw-r--r--sys/dev/wscons/wsdisplay.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c
index 49e91859a9e..00b1475fe2e 100644
--- a/sys/dev/wscons/wsdisplay.c
+++ b/sys/dev/wscons/wsdisplay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsdisplay.c,v 1.108 2013/05/12 20:41:45 kettenis Exp $ */
+/* $OpenBSD: wsdisplay.c,v 1.109 2013/05/30 16:15:02 deraadt Exp $ */
/* $NetBSD: wsdisplay.c,v 1.82 2005/02/27 00:27:52 perry Exp $ */
/*
@@ -156,7 +156,6 @@ int wsdisplay_getscreen(struct wsdisplay_softc *,
struct wsdisplay_addscreendata *);
void wsdisplay_resume_device(struct device *);
void wsdisplay_suspend_device(struct device *);
-void wsdisplay_shutdownhook(void *);
void wsdisplay_addscreen_print(struct wsdisplay_softc *, int, int);
void wsdisplay_closescreen(struct wsdisplay_softc *, struct wsscreen *);
int wsdisplay_delscreen(struct wsdisplay_softc *, int, int);
@@ -216,13 +215,15 @@ int wsdisplay_emul_match(struct device *, void *, void *);
void wsdisplay_emul_attach(struct device *, struct device *, void *);
int wsdisplay_emul_detach(struct device *, int);
+int wsdisplay_activate(struct device *, int);
+
struct cfdriver wsdisplay_cd = {
NULL, "wsdisplay", DV_TTY
};
struct cfattach wsdisplay_emul_ca = {
sizeof(struct wsdisplay_softc), wsdisplay_emul_match,
- wsdisplay_emul_attach, wsdisplay_emul_detach
+ wsdisplay_emul_attach, wsdisplay_emul_detach, wsdisplay_activate
};
void wsdisplaystart(struct tty *);
@@ -585,6 +586,20 @@ wsdisplay_emul_detach(struct device *self, int flags)
}
int
+wsdisplay_activate(struct device *self, int act)
+{
+ int ret = 0;
+
+ switch (act) {
+ case DVACT_POWERDOWN:
+ wsdisplay_switchtoconsole();
+ break;
+ }
+
+ return (ret);
+}
+
+int
wsdisplay_common_detach(struct wsdisplay_softc *sc, int flags)
{
int i;
@@ -659,7 +674,6 @@ wsdisplay_common_attach(struct wsdisplay_softc *sc, int console, int kbdmux,
const struct wsdisplay_accessops *accessops, void *accesscookie,
u_int defaultscreens)
{
- static int hookset = 0;
int i, start = 0;
#if NWSKBD > 0
struct wsevsrc *kme;
@@ -754,10 +768,6 @@ wsdisplay_common_attach(struct wsdisplay_softc *sc, int console, int kbdmux,
wsdisplay_burn(sc, sc->sc_burnflags);
#endif
- if (hookset == 0)
- shutdownhook_establish(wsdisplay_shutdownhook, NULL);
- hookset = 1;
-
#if NWSKBD > 0 && NWSMUX == 0
if (console == 0) {
/*
@@ -2353,15 +2363,6 @@ wsdisplay_burner(void *v)
}
#endif
-/*
- * Switch the console at shutdown.
- */
-void
-wsdisplay_shutdownhook(void *arg)
-{
- wsdisplay_switchtoconsole();
-}
-
#ifdef WSMOUSED_SUPPORT
/*
* wsmoused(8) support functions