summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authormlelstv <mlelstv@NetBSD.org>2022-03-28 11:21:40 +0000
committermlelstv <mlelstv@NetBSD.org>2022-03-28 11:21:40 +0000
commit68478a546548d97b8d1c10bb8affd59ea7d8c44c (patch)
treed5b76c5fde089bb33f7e4dde052ff0af9e99c343 /sys
parentc6d70a2f68a5d41151bde5da12a89b25c803006e (diff)
Add helper to detach genfb console.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/wsfb/genfb.c15
-rw-r--r--sys/dev/wsfb/genfbvar.h3
2 files changed, 15 insertions, 3 deletions
diff --git a/sys/dev/wsfb/genfb.c b/sys/dev/wsfb/genfb.c
index 5912f896a28..f68f99d7f0b 100644
--- a/sys/dev/wsfb/genfb.c
+++ b/sys/dev/wsfb/genfb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb.c,v 1.85 2021/12/24 18:12:58 jmcneill Exp $ */
+/* $NetBSD: genfb.c,v 1.86 2022/03/28 11:21:40 mlelstv Exp $ */
/*-
* Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.85 2021/12/24 18:12:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.86 2022/03/28 11:21:40 mlelstv Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -835,6 +835,17 @@ genfb_cnattach(void)
genfb_cnattach_called = 1;
}
+int
+genfb_cndetach(void)
+{
+
+ if (genfb_cnattach_called) {
+ genfb_cnattach_called = 0;
+ return 1;
+ }
+ return 0;
+}
+
void
genfb_disable(void)
{
diff --git a/sys/dev/wsfb/genfbvar.h b/sys/dev/wsfb/genfbvar.h
index e73240a5a75..680bd95a11b 100644
--- a/sys/dev/wsfb/genfbvar.h
+++ b/sys/dev/wsfb/genfbvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: genfbvar.h,v 1.26 2021/01/27 22:42:53 macallan Exp $ */
+/* $NetBSD: genfbvar.h,v 1.27 2022/03/28 11:21:40 mlelstv Exp $ */
/*-
* Copyright (c) 2007 Michael Lorenz
@@ -167,6 +167,7 @@ struct genfb_softc {
};
void genfb_cnattach(void);
+int genfb_cndetach(void);
void genfb_disable(void);
int genfb_is_console(void);
int genfb_is_enabled(void);