diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1997-03-03 12:01:18 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1997-03-03 12:01:18 +0000 |
commit | 2653893695d770941ae788dc69e44e65feed310f (patch) | |
tree | 8c9f94847a031c11ded1ce01ec3df4b9d27f5dae /sys | |
parent | bee45b6272f7d1fee8afd7de1703512c128927f0 (diff) |
Add a little ioctl at 4am to set the screen blanking.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/i386/include/pccons.h | 3 | ||||
-rw-r--r-- | sys/arch/i386/isa/pccons.c | 11 |
2 files changed, 10 insertions, 4 deletions
diff --git a/sys/arch/i386/include/pccons.h b/sys/arch/i386/include/pccons.h index 7802f12bee7..c20385c4831 100644 --- a/sys/arch/i386/include/pccons.h +++ b/sys/arch/i386/include/pccons.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pccons.h,v 1.4 1996/09/01 16:39:57 deraadt Exp $ */ +/* $OpenBSD: pccons.h,v 1.5 1997/03/03 12:01:17 downsj Exp $ */ /* $NetBSD: pccons.h,v 1.4 1996/02/02 18:06:06 mycroft Exp $ */ /* @@ -41,5 +41,6 @@ typedef struct { #define CONSOLE_SET_TYPEMATIC_RATE _IOW('t',124,u_char) #define CONSOLE_GET_KEYMAP _IOR('t',128,pccons_keymap_t[KB_NUM_KEYS]) #define CONSOLE_SET_KEYMAP _IOW('t',129,pccons_keymap_t[KB_NUM_KEYS]) +#define CONSOLE_SET_BLANK _IOW('t',130,int) #endif /* _PCCONS_H_ */ diff --git a/sys/arch/i386/isa/pccons.c b/sys/arch/i386/isa/pccons.c index 2c53a874f8a..cc9211566b5 100644 --- a/sys/arch/i386/isa/pccons.c +++ b/sys/arch/i386/isa/pccons.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pccons.c,v 1.33 1996/12/29 12:25:59 graichen Exp $ */ +/* $OpenBSD: pccons.c,v 1.34 1997/03/03 12:01:15 downsj Exp $ */ /* $NetBSD: pccons.c,v 1.99.4.1 1996/06/04 20:03:53 cgd Exp $ */ /*- @@ -94,6 +94,7 @@ static u_char lock_state = 0x00, /* all off */ static u_short cursor_shape = 0xffff, /* don't update until set by user */ old_cursor_shape = 0xffff; static pccons_keymap_t scan_codes[KB_NUM_KEYS];/* keyboard translation table */ +static int pc_blank = 300; #ifdef XSERVER int pc_xmode = 0; #endif @@ -727,6 +728,10 @@ pcioctl(dev, cmd, data, flag, p) return EINVAL; bcopy(scan_codes, data, sizeof(pccons_keymap_t[KB_NUM_KEYS])); return 0; + case CONSOLE_SET_BLANK: + pc_blank = *((int *)data); + screen_restore(0); + return 0; default: return ENOTTY; } @@ -1013,8 +1018,8 @@ screen_restore(perm) bcopy(screen_backup, Crtat, ROW*COL*CHR); screen_saved = 0; } - if (! perm) - timeout(screen_blank, NULL, 300*hz); + if (!perm && (pc_blank > 0)) + timeout(screen_blank, NULL, pc_blank * hz); } /* |