Fixed small bug in alarm code.
Kernel timer count was not reset after expiry.
This commit is contained in:
parent
7de7ca978d
commit
e396496d8c
4 changed files with 6 additions and 16 deletions
|
@ -1,4 +1,3 @@
|
||||||
#define NEW_REVIVE 1
|
|
||||||
/* This file contains the tesminal driver, both for the IBM console and regular
|
/* This file contains the tesminal driver, both for the IBM console and regular
|
||||||
* ASCII terminals. It handles only the device-independent part of a TTY, the
|
* ASCII terminals. It handles only the device-independent part of a TTY, the
|
||||||
* device dependent parts are in console.c, rs232.c, etc. This file contains
|
* device dependent parts are in console.c, rs232.c, etc. This file contains
|
||||||
|
@ -870,7 +869,6 @@ tty_t *tp; /* TTY to check for events. */
|
||||||
|
|
||||||
/* Reply if enough bytes are available. */
|
/* Reply if enough bytes are available. */
|
||||||
if (tp->tty_incum >= tp->tty_min && tp->tty_inleft > 0) {
|
if (tp->tty_incum >= tp->tty_min && tp->tty_inleft > 0) {
|
||||||
#if NEW_REVIVE
|
|
||||||
if (tp->tty_inrepcode == REVIVE) {
|
if (tp->tty_inrepcode == REVIVE) {
|
||||||
notify(tp->tty_incaller);
|
notify(tp->tty_incaller);
|
||||||
tp->tty_inrevived = 1;
|
tp->tty_inrevived = 1;
|
||||||
|
@ -879,11 +877,6 @@ tty_t *tp; /* TTY to check for events. */
|
||||||
tp->tty_inproc, tp->tty_incum);
|
tp->tty_inproc, tp->tty_incum);
|
||||||
tp->tty_inleft = tp->tty_incum = 0;
|
tp->tty_inleft = tp->tty_incum = 0;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
tty_reply(tp->tty_inrepcode, tp->tty_incaller, tp->tty_inproc,
|
|
||||||
tp->tty_incum);
|
|
||||||
tp->tty_inleft = tp->tty_incum = 0;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
if(tp->tty_select_ops)
|
if(tp->tty_select_ops)
|
||||||
select_retry(tp);
|
select_retry(tp);
|
||||||
|
@ -951,7 +944,6 @@ register tty_t *tp; /* pointer to terminal to read from */
|
||||||
|
|
||||||
/* Usually reply to the reader, possibly even if incum == 0 (EOF). */
|
/* Usually reply to the reader, possibly even if incum == 0 (EOF). */
|
||||||
if (tp->tty_inleft == 0) {
|
if (tp->tty_inleft == 0) {
|
||||||
#if NEW_REVIVE
|
|
||||||
if (tp->tty_inrepcode == REVIVE) {
|
if (tp->tty_inrepcode == REVIVE) {
|
||||||
notify(tp->tty_incaller);
|
notify(tp->tty_incaller);
|
||||||
tp->tty_inrevived = 1;
|
tp->tty_inrevived = 1;
|
||||||
|
@ -960,11 +952,6 @@ register tty_t *tp; /* pointer to terminal to read from */
|
||||||
tp->tty_inproc, tp->tty_incum);
|
tp->tty_inproc, tp->tty_incum);
|
||||||
tp->tty_inleft = tp->tty_incum = 0;
|
tp->tty_inleft = tp->tty_incum = 0;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
tty_reply(tp->tty_inrepcode, tp->tty_incaller, tp->tty_inproc,
|
|
||||||
tp->tty_incum);
|
|
||||||
tp->tty_inleft = tp->tty_incum = 0;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,9 @@ timer_t *tp;
|
||||||
* alarm. The process number is stored in timer argument 'ta_int'. Notify that
|
* alarm. The process number is stored in timer argument 'ta_int'. Notify that
|
||||||
* process with a notification message from CLOCK.
|
* process with a notification message from CLOCK.
|
||||||
*/
|
*/
|
||||||
lock_notify(CLOCK, tmr_arg(tp)->ta_int);
|
int proc_nr = tmr_arg(tp)->ta_int; /* get process number */
|
||||||
|
tmr_inittimer(tp); /* reset alarm timer */
|
||||||
|
lock_notify(CLOCK, proc_nr); /* notify process */
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* USE_SETALARM */
|
#endif /* USE_SETALARM */
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
|
#include <timers.h>
|
||||||
|
|
||||||
/*===========================================================================*
|
/*===========================================================================*
|
||||||
* tickdelay *
|
* tickdelay *
|
||||||
|
@ -27,7 +28,7 @@ long ticks; /* number of ticks to wait */
|
||||||
receive(CLOCK,&m_alarm); /* await synchronous alarm */
|
receive(CLOCK,&m_alarm); /* await synchronous alarm */
|
||||||
|
|
||||||
/* Check if we must reschedule the current alarm. */
|
/* Check if we must reschedule the current alarm. */
|
||||||
if (m.ALRM_TIME_LEFT > 0) {
|
if (m.ALRM_TIME_LEFT > 0 && m.ALRM_TIME_LEFT != TMR_NEVER) {
|
||||||
m.ALRM_EXP_TIME = m.ALRM_TIME_LEFT - ticks;
|
m.ALRM_EXP_TIME = m.ALRM_TIME_LEFT - ticks;
|
||||||
if (m.ALRM_EXP_TIME <= 0)
|
if (m.ALRM_EXP_TIME <= 0)
|
||||||
m.ALRM_EXP_TIME = 1;
|
m.ALRM_EXP_TIME = 1;
|
||||||
|
|
|
@ -253,7 +253,7 @@ PRIVATE void pm_init()
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize tables to all physical memory and print memory information. */
|
/* Initialize tables to all physical memory and print memory information. */
|
||||||
printf("Gathering memory:");
|
printf("Physical memory:");
|
||||||
mem_init(mem_chunks, &free_clicks);
|
mem_init(mem_chunks, &free_clicks);
|
||||||
total_clicks = minix_clicks + free_clicks;
|
total_clicks = minix_clicks + free_clicks;
|
||||||
printf(" total %u KB,", click_to_round_k(total_clicks));
|
printf(" total %u KB,", click_to_round_k(total_clicks));
|
||||||
|
|
Loading…
Reference in a new issue