From owner-freebsd-hackers Fri Apr 5 12:39:15 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from cognet.ci0.org (cognet.ci0.org [80.65.224.102]) by hub.freebsd.org (Postfix) with ESMTP id BA12C37B41F for ; Fri, 5 Apr 2002 12:39:07 -0800 (PST) Received: from cognet.ci0.org (localhost [127.0.0.1]) by cognet.ci0.org (8.12.2/8.12.2) with ESMTP id g35Kap1X000862 for ; Fri, 5 Apr 2002 22:36:51 +0200 (CEST) (envelope-from doginou@cognet.ci0.org) Received: (from doginou@localhost) by cognet.ci0.org (8.12.2/8.12.2/Submit) id g35KapXl000861 for freebsd-hackers@freebsd.org; Fri, 5 Apr 2002 22:36:51 +0200 (CEST) Date: Fri, 5 Apr 2002 22:36:51 +0200 From: Olivier Houchard To: freebsd-hackers@freebsd.org Subject: syscons screensaver Message-ID: <20020405203651.GA788@ci0.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" Content-Disposition: inline User-Agent: Mutt/1.3.28i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, Here is a small patch to re-add the hw.syscons.saver.timeout using SYSCTL_PROC as suggested by jhb. It adds a CONS_SAVER_KBD_ONLY ioctl too that does the same that the hw.syscons.saver.keybonly. --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="syscons.c.diff" --- /sys/dev/syscons/syscons.c Fri Apr 5 20:17:49 2002 +++ /root/syscons.c Fri Apr 5 22:18:59 2002 @@ -240,6 +240,30 @@ } /* probe video adapters, return TRUE if found */ +static int +sysctl_saver_timeout(SYSCTL_HANDLER_ARGS) +{ + long saver_timeout = scrn_blank_time; + int error; + int s; + + if (!(error = sysctl_handle_long(oidp, &saver_timeout, + sizeof(saver_timeout), req))) { + if (saver_timeout < 0 || saver_timeout > MAX_BLANKTIME) + error = EINVAL; + else { + s = spltty(); + scrn_blank_time = saver_timeout; + run_scrn_saver = (scrn_blank_time != 0); + splx(s); + } + } + return error; +} + +SYSCTL_PROC(_hw_syscons_saver, OID_AUTO, timeout, CTLTYPE_LONG | CTLFLAG_RW, + 0, sizeof(long), sysctl_saver_timeout, "L", "screen saver time"); + static int scvidprobe(int unit, int flags, int cons) { @@ -701,6 +725,9 @@ splx(s); return 0; + case CONS_SAVER_KBD_ONLY: + sc_saver_keyb_only = *(int *)data; + return (0); case CONS_CURSORTYPE: /* set cursor type (obsolete) */ s = spltty(); *(int *)data &= CONS_CURSOR_ATTRS; --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="consio.h.diff" --- /sys/sys/consio.h Sun Mar 17 00:31:14 2002 +++ /root/consio.h Fri Apr 5 22:19:46 2002 @@ -286,6 +286,7 @@ #define CONS_GETTERM _IOWR('c', 112, term_info_t) #define CONS_SETTERM _IOW('c', 113, term_info_t) +#define CONS_SAVER_KBD_ONLY _IOW('c', 114, int) #ifdef PC98 #define ADJUST_CLOCK _IO('t',100) /* for 98note resume */ --OgqxwSJOaUobr8KG-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message