diff options
author | jkim <jkim@FreeBSD.org> | 2010-05-26 15:29:53 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2010-05-26 15:29:53 +0000 |
commit | 21b2ea8d2f5e539f993a5b48f885539bc6c30d24 (patch) | |
tree | 4f52bd6a1a4fcca13fb33e7f5a02aa246c37242e /sys/isa | |
parent | 5f53690fd730b460e292914426bdb0c32a4fc022 (diff) | |
download | FreeBSD-src-21b2ea8d2f5e539f993a5b48f885539bc6c30d24.zip FreeBSD-src-21b2ea8d2f5e539f993a5b48f885539bc6c30d24.tar.gz |
Let the first device suspend and the last device resume syscons(4).
Diffstat (limited to 'sys/isa')
-rw-r--r-- | sys/isa/syscons_isa.c | 15 |
1 files changed, 5 insertions, 10 deletions
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); |