From 0bc28762a382dbc51fbdc5218ec0401fa9e04b5c Mon Sep 17 00:00:00 2001 From: mlelstv Date: Tue, 21 Jan 2014 00:08:27 +0000 Subject: [PATCH] add function to detach wscons from a console. This allows to switch the console to a different driver. --- sys/dev/wscons/wsdisplay.c | 13 +++++++++++-- sys/dev/wscons/wsdisplayvar.h | 3 ++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c index cf39a53620a9..baa8457d6433 100644 --- a/sys/dev/wscons/wsdisplay.c +++ b/sys/dev/wscons/wsdisplay.c @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay.c,v 1.135 2012/02/02 13:11:25 drochner Exp $ */ +/* $NetBSD: wsdisplay.c,v 1.136 2014/01/21 00:08:27 mlelstv Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.135 2012/02/02 13:11:25 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.136 2014/01/21 00:08:27 mlelstv Exp $"); #include "opt_wsdisplay_compat.h" #include "opt_wsmsgattrs.h" @@ -884,6 +884,15 @@ wsdisplay_preattach(const struct wsscreen_descr *type, void *cookie, wsdisplay_console_initted = 1; } +void +wsdisplay_cndetach(void) +{ + KASSERT(wsdisplay_console_initted == 2); + + cn_tab = NULL; + wsdisplay_console_initted = 0; +} + /* * Tty and cdevsw functions. */ diff --git a/sys/dev/wscons/wsdisplayvar.h b/sys/dev/wscons/wsdisplayvar.h index 963d1637e926..a01083ae5f85 100644 --- a/sys/dev/wscons/wsdisplayvar.h +++ b/sys/dev/wscons/wsdisplayvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplayvar.h,v 1.50 2013/01/31 10:57:30 macallan Exp $ */ +/* $NetBSD: wsdisplayvar.h,v 1.51 2014/01/21 00:08:27 mlelstv Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -163,6 +163,7 @@ void wsdisplay_cnattach(const struct wsscreen_descr *, void *, int, int, long); void wsdisplay_preattach(const struct wsscreen_descr *, void *, int, int, long); +void wsdisplay_cndetach(void); int wsdisplaydevprint(void *, const char *); int wsemuldisplaydevprint(void *, const char *);