diff options
author | yokota <yokota@FreeBSD.org> | 1999-01-11 03:18:56 +0000 |
---|---|---|
committer | yokota <yokota@FreeBSD.org> | 1999-01-11 03:18:56 +0000 |
commit | ae16d918a316eb60407be875de416efb373a652f (patch) | |
tree | 114e5de93fcbb59a8cff261d560719502d115314 /sys/dev/syscons/green/green_saver.c | |
parent | f24a0f863faf18c039916001f2cc71561fc29b38 (diff) | |
download | FreeBSD-src-ae16d918a316eb60407be875de416efb373a652f.zip FreeBSD-src-ae16d918a316eb60407be875de416efb373a652f.tar.gz |
The first stage of console driver reorganization: activate new
keyboard and video card drivers.
Because of the changes, you are required to update your kernel
configuration file now!
The files in sys/dev/syscons are still i386-specific (but less so than
before), and won't compile for alpha and PC98 yet.
syscons still directly accesses the video card registers here and
there; this will be rectified in the later stages.
Diffstat (limited to 'sys/dev/syscons/green/green_saver.c')
-rw-r--r-- | sys/dev/syscons/green/green_saver.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/sys/dev/syscons/green/green_saver.c b/sys/dev/syscons/green/green_saver.c index 0491c67..9decd72 100644 --- a/sys/dev/syscons/green/green_saver.c +++ b/sys/dev/syscons/green/green_saver.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: green_saver.c,v 1.13 1998/09/17 19:40:30 sos Exp $ + * $Id: green_saver.c,v 1.14 1998/11/04 03:49:38 peter Exp $ */ #include <sys/param.h> @@ -33,18 +33,21 @@ #include <sys/kernel.h> #include <sys/module.h> +#include <dev/fb/vgareg.h> + #include <i386/isa/isa.h> #include <saver.h> -static void -green_saver(int blank) +static int +green_saver(video_adapter_t *adp, int blank) { + int crtc_addr; u_char val; + + crtc_addr = adp->va_crtc_addr; if (blank) { - scrn_blanked = 1; - cur_console->status |= SAVER_RUNNING; - switch (crtc_type) { + switch (adp->va_type) { case KD_VGA: outb(TSIDX, 0x01); val = inb(TSREG); outb(TSIDX, 0x01); outb(TSREG, val | 0x20); @@ -66,7 +69,7 @@ green_saver(int blank) } } else { - switch (crtc_type) { + switch (adp->va_type) { case KD_VGA: outb(TSIDX, 0x01); val = inb(TSREG); outb(TSIDX, 0x01); outb(TSREG, val & 0xDF); @@ -86,15 +89,14 @@ green_saver(int blank) default: break; } - cur_console->status &= ~SAVER_RUNNING; - scrn_blanked = 0; } + return 0; } static int -green_saver_load(void) +green_init(video_adapter_t *adp) { - switch (crtc_type) { + switch (adp->va_type) { case KD_MONO: case KD_HERCULES: case KD_CGA: @@ -109,13 +111,17 @@ green_saver_load(void) default: return ENODEV; } - return add_scrn_saver(green_saver); + return 0; } static int -green_saver_unload(void) +green_term(video_adapter_t *adp) { - return remove_scrn_saver(green_saver); + return 0; } -SAVER_MODULE(green_saver); +static scrn_saver_t green_module = { + "green_saver", green_init, green_term, green_saver, NULL, +}; + +SAVER_MODULE(green_saver, green_module); |