From: Matthew Dillon Date: Mon, 2 Jul 2007 04:19:14 +0000 (+0000) Subject: sigwinch has to run with the big giant lock so use the DragonFly X-Git-Tag: v2.0.1~2695 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/0df380efcebc92973952b4e54b74867ba3a7af5a sigwinch has to run with the big giant lock so use the DragonFly interrupt API to handle it rather then running it directly from the signal handler. Fixes a panic. --- diff --git a/sys/platform/vkernel/platform/console.c b/sys/platform/vkernel/platform/console.c index 493848ec57..b4088abb33 100644 --- a/sys/platform/vkernel/platform/console.c +++ b/sys/platform/vkernel/platform/console.c @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/platform/vkernel/platform/console.c,v 1.16 2007/06/07 22:58:22 corecode Exp $ + * $DragonFly: src/sys/platform/vkernel/platform/console.c,v 1.17 2007/07/02 04:19:14 dillon Exp $ */ #include @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -271,7 +272,13 @@ vconssignal(int sig) } static void -vconswinch(int __unused sig) +vconswinchsig(int __unused sig) +{ + signalintr(3); +} + +static void +vconswinch_intr(void *arg __unused, void *frame __unused) { struct winsize newsize; @@ -315,19 +322,26 @@ vconsinit(struct consdev *cp) sigaction(SIGINT, &sa, NULL); sigaction(SIGTERM, &sa, NULL); atexit(vconscleanup); - - sa.sa_handler = vconswinch; - sigaction(SIGWINCH, &sa, NULL); - vcons_set_mode(0); } static void vconsinit_fini(struct consdev *cp) { + struct sigaction sa; cdev_t dev; int i; + /* + * We have to do this here rather then in early boot to be able + * to use the interrupt subsystem. + */ + register_int(3, vconswinch_intr, NULL, "swinch", NULL, 0); + bzero(&sa, sizeof(sa)); + sigemptyset(&sa.sa_mask); + sa.sa_handler = vconswinchsig; + sigaction(SIGWINCH, &sa, NULL); + /* * Implement ttyv0-ttyv7. At the moment ttyv1-7 are sink nulls. */