diff options
author | nyan <nyan@FreeBSD.org> | 2002-09-16 07:11:43 +0000 |
---|---|---|
committer | nyan <nyan@FreeBSD.org> | 2002-09-16 07:11:43 +0000 |
commit | 879fee156b55352456a94abb21bf96d65e23098f (patch) | |
tree | d20cb2bbedb417688040a22b3dad46e870aff2b2 | |
parent | 576537351a28f557ba6776169061146f1904e518 (diff) | |
download | FreeBSD-src-879fee156b55352456a94abb21bf96d65e23098f.zip FreeBSD-src-879fee156b55352456a94abb21bf96d65e23098f.tar.gz |
Merged from sys/isa/syscons_isa.c revision 1.18.
-rw-r--r-- | sys/pc98/cbus/syscons_cbus.c | 35 | ||||
-rw-r--r-- | sys/pc98/pc98/syscons_pc98.c | 35 |
2 files changed, 70 insertions, 0 deletions
diff --git a/sys/pc98/cbus/syscons_cbus.c b/sys/pc98/cbus/syscons_cbus.c index e45dbf7..10a90be 100644 --- a/sys/pc98/cbus/syscons_cbus.c +++ b/sys/pc98/cbus/syscons_cbus.c @@ -74,6 +74,39 @@ scattach(device_t dev) return sc_attach_unit(device_get_unit(dev), device_get_flags(dev)); } +static int sc_cur_scr; + +static int +scsuspend(device_t dev) +{ + int retry = 10; + static int dummy; + sc_softc_t *sc; + + sc = &main_softc; + sc_cur_scr = sc->cur_scp->index; + do { + sc_switch_scr(sc, 0); + if (!sc->switch_in_progress) { + break; + } + tsleep(&dummy, 0, "scsuspend", 100); + } while (retry--); + + return (0); +} + +static int +scresume(device_t dev) +{ + sc_softc_t *sc; + + sc = &main_softc; + sc_switch_scr(sc, sc_cur_scr); + + return (0); +} + int sc_max_unit(void) { @@ -199,6 +232,8 @@ static device_method_t sc_methods[] = { DEVMETHOD(device_identify, scidentify), DEVMETHOD(device_probe, scprobe), DEVMETHOD(device_attach, scattach), + DEVMETHOD(device_suspend, scsuspend), + DEVMETHOD(device_resume, scresume), { 0, 0 } }; diff --git a/sys/pc98/pc98/syscons_pc98.c b/sys/pc98/pc98/syscons_pc98.c index e45dbf7..10a90be 100644 --- a/sys/pc98/pc98/syscons_pc98.c +++ b/sys/pc98/pc98/syscons_pc98.c @@ -74,6 +74,39 @@ scattach(device_t dev) return sc_attach_unit(device_get_unit(dev), device_get_flags(dev)); } +static int sc_cur_scr; + +static int +scsuspend(device_t dev) +{ + int retry = 10; + static int dummy; + sc_softc_t *sc; + + sc = &main_softc; + sc_cur_scr = sc->cur_scp->index; + do { + sc_switch_scr(sc, 0); + if (!sc->switch_in_progress) { + break; + } + tsleep(&dummy, 0, "scsuspend", 100); + } while (retry--); + + return (0); +} + +static int +scresume(device_t dev) +{ + sc_softc_t *sc; + + sc = &main_softc; + sc_switch_scr(sc, sc_cur_scr); + + return (0); +} + int sc_max_unit(void) { @@ -199,6 +232,8 @@ static device_method_t sc_methods[] = { DEVMETHOD(device_identify, scidentify), DEVMETHOD(device_probe, scprobe), DEVMETHOD(device_attach, scattach), + DEVMETHOD(device_suspend, scsuspend), + DEVMETHOD(device_resume, scresume), { 0, 0 } }; |