From 24dda235e48b6330dd7cba605bff25b2b1e54257 Mon Sep 17 00:00:00 2001 From: mlelstv Date: Mon, 28 Mar 2022 11:21:40 +0000 Subject: [PATCH] Add helper to detach genfb console. --- sys/dev/wsfb/genfb.c | 15 +++++++++++++-- sys/dev/wsfb/genfbvar.h | 3 ++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/sys/dev/wsfb/genfb.c b/sys/dev/wsfb/genfb.c index 5912f896a282..f68f99d7f0b7 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 -__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 #include @@ -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 e73240a5a75a..680bd95a11b4 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);