From 21b2ea8d2f5e539f993a5b48f885539bc6c30d24 Mon Sep 17 00:00:00 2001 From: jkim Date: Wed, 26 May 2010 15:29:53 +0000 Subject: Let the first device suspend and the last device resume syscons(4). --- sys/isa/syscons_isa.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'sys/isa') diff --git a/sys/isa/syscons_isa.c b/sys/isa/syscons_isa.c index d4b8fa3..5b6b2d1 100644 --- a/sys/isa/syscons_isa.c +++ b/sys/isa/syscons_isa.c @@ -116,10 +116,10 @@ scsuspend(device_t dev) sc = &main_softc; - if (sc->cur_scp == NULL || sc->suspend_in_progress) + if (sc->cur_scp == NULL) return (0); - if (!sc_no_suspend_vtswitch) { + if (sc->suspend_in_progress == 0 && !sc_no_suspend_vtswitch) { sc_cur_scr = sc->cur_scp->index; do { sc_switch_scr(sc, 0); @@ -128,8 +128,7 @@ scsuspend(device_t dev) pause("scsuspend", hz); } while (retry--); } - - sc->suspend_in_progress = TRUE; + sc->suspend_in_progress++; return (0); } @@ -141,12 +140,8 @@ scresume(device_t dev) sc = &main_softc; - if (!sc->suspend_in_progress) - return (0); - - sc->suspend_in_progress = FALSE; - - if (!sc_no_suspend_vtswitch) + sc->suspend_in_progress--; + if (sc->suspend_in_progress == 0 && !sc_no_suspend_vtswitch) sc_switch_scr(sc, sc_cur_scr); return (0); -- cgit v1.1