Sync with sys/i386/isa/syscons.c revision 1.257.

This commit is contained in:
KATO Takenori 1998-04-04 17:18:09 +00:00
parent a117d26a3d
commit 71dab323ee

View File

@ -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: syscons.c,v 1.79 1998/02/14 08:39:35 kato Exp $
* $Id: syscons.c,v 1.80 1998/03/05 03:31:27 kato Exp $
*/
#include "sc.h"
@ -186,7 +186,7 @@ static const u_int n_fkey_tab = sizeof(fkey_tab) / sizeof(*fkey_tab);
static int delayed_next_scr = FALSE;
static long scrn_blank_time = 0; /* screen saver timeout value */
int scrn_blanked = 0; /* screen saver active flag */
static long scrn_time_stamp;
static struct timeval scrn_time_stamp;
u_char scr_map[256];
u_char scr_rmap[256];
char *video_mode_ptr = NULL;
@ -1166,7 +1166,7 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
return EINVAL;
scrn_blank_time = *(int *)data;
if (scrn_blank_time == 0)
scrn_time_stamp = mono_time.tv_sec;
getmicroruntime(&scrn_time_stamp);
return 0;
case CONS_CURSORTYPE: /* set cursor type blink/noblink */
@ -1534,7 +1534,7 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
return EINVAL;
}
/* make screensaver happy */
scrn_time_stamp = mono_time.tv_sec;
getmicroruntime(&scrn_time_stamp);
return 0;
}
@ -2466,6 +2466,7 @@ get_scr_num()
static void
scrn_timer(void *arg)
{
struct timeval tv;
scr_stat *scp = cur_console;
int s;
@ -2507,14 +2508,18 @@ scrn_timer(void *arg)
}
/* should we stop the screen saver? */
getmicroruntime(&tv);
if (panicstr)
scrn_time_stamp = mono_time.tv_sec;
scrn_time_stamp = tv;
if (tv.tv_sec <= scrn_time_stamp.tv_sec + scrn_blank_time)
if (scrn_blanked > 0)
stop_scrn_saver(current_saver);
scp = cur_console;
if (scrn_blanked <= 0)
scrn_update(scp, TRUE);
/* should we activate the screen saver? */
if ((scrn_blank_time != 0)
&& (mono_time.tv_sec > scrn_time_stamp + scrn_blank_time))
&& (tv.tv_sec > scrn_time_stamp.tv_sec + scrn_blank_time))
(*current_saver)(TRUE);
timeout(scrn_timer, NULL, hz / 25);
@ -2627,7 +2632,7 @@ static void
stop_scrn_saver(void (*saver)(int))
{
(*saver)(FALSE);
scrn_time_stamp = mono_time.tv_sec;
getmicroruntime(&scrn_time_stamp);
mark_all(cur_console);
}
@ -3670,7 +3675,7 @@ ansi_put(scr_stat *scp, u_char *buf, int len)
/* make screensaver happy */
if (scp == cur_console)
scrn_time_stamp = mono_time.tv_sec;
getmicroruntime(&scrn_time_stamp);
write_in_progress++;
outloop:
@ -4325,7 +4330,7 @@ scgetc(u_int flags)
/* make screensaver happy */
if (!(scancode & 0x80))
scrn_time_stamp = mono_time.tv_sec;
getmicroruntime(&scrn_time_stamp);
if (!(flags & SCGETC_CN)) {
/* do the /dev/random device a favour */