Added DEV_PING message type to drivers (but not ethernet drivers) so

RS can monitor them.
This commit is contained in:
Ben Gras 2005-10-12 14:31:39 +00:00
parent 866b3fda9c
commit 87dbfc7dda
7 changed files with 22 additions and 0 deletions

View file

@ -292,6 +292,7 @@ PUBLIC int main()
{
/* Set special disk parameters then call the generic main loop. */
init_params();
signal(SIGTERM, SIG_IGN);
driver_task(&w_dtab);
return(OK);
}
@ -1142,6 +1143,8 @@ PRIVATE void w_intr_wait()
} else if (m.m_type == HARD_INT) {
sys_inb(w_wn->base_cmd + REG_STATUS, &w_wn->w_status);
ack_irqs(m.NOTIFY_ARG);
} else if (m.m_type == DEV_PING) {
notify(m.m_source);
} else {
printf("AT_WINI got unexpected message %d from %d\n",
m.m_type, m.m_source);

View file

@ -57,6 +57,9 @@ PUBLIC void main(void)
reply(TASK_REPLY, m.m_source, m.PROC_NR, OK);
break;
case DEV_PING:
notify(m.m_source);
break;
case DEV_IOCTL:
/* Probably best to SUSPEND the caller, CMOS I/O has nasty timeouts.

View file

@ -711,6 +711,8 @@ PRIVATE void start_motor()
receive(ANY, &mess);
if (mess.m_type == SYN_ALARM) {
f_expire_tmrs(NULL, NULL);
} else if(mess.m_type == DEV_PING) {
notify(mess.m_source);
} else {
f_busy = BSY_IDLE;
}
@ -793,6 +795,8 @@ PRIVATE int seek()
receive(ANY, &mess);
if (mess.m_type == SYN_ALARM) {
f_expire_tmrs(NULL, NULL);
} else if(mess.m_type == DEV_PING) {
notify(mess.m_source);
} else {
f_busy = BSY_IDLE;
}
@ -1061,6 +1065,8 @@ PRIVATE void f_reset()
receive(ANY, &mess);
if (mess.m_type == SYN_ALARM) {
f_expire_tmrs(NULL, NULL);
} else if(mess.m_type == DEV_PING) {
notify(mess.m_source);
} else { /* expect HARD_INT */
f_busy = BSY_IDLE;
}
@ -1106,6 +1112,8 @@ PRIVATE int f_intr_wait()
receive(ANY, &mess);
if (mess.m_type == SYN_ALARM) {
f_expire_tmrs(NULL, NULL);
} else if(mess.m_type == DEV_PING) {
notify(mess.m_source);
} else {
f_busy = BSY_IDLE;
}

View file

@ -114,6 +114,8 @@ struct driver *dp; /* Device dependent entry points. */
continue; /* don't reply */
case SYN_ALARM: (*dp->dr_alarm)(dp, &mess);
continue; /* don't reply */
case DEV_PING: notify(mess.m_source);
continue;
default:
if(dp->dr_other)
r = (*dp->dr_other)(dp, &mess);

View file

@ -221,6 +221,8 @@ unsigned nr_req; /* length of request vector */
unsigned long dv_size;
int accumulated_read = 0;
struct logdevice *log;
static int f;
if(f++ > 100) exit(0);
if(log_device < 0 || log_device >= NR_DEVS)
return EIO;

View file

@ -148,6 +148,7 @@ PUBLIC void main(void)
case CANCEL: do_cancel(&pr_mess); break;
case HARD_INT: do_printer_output(); break;
case SYS_SIG: /* do nothing */ break;
case DEV_PING: notify(pr_mess.m_source); break;
default:
reply(TASK_REPLY, pr_mess.m_source, pr_mess.PROC_NR, EINVAL);
}

View file

@ -205,6 +205,9 @@ PUBLIC void main(void)
case SYN_ALARM: /* fall through */
expire_timers(); /* run watchdogs of expired timers */
continue; /* contine to check for events */
case DEV_PING:
notify(tty_mess.m_source);
continue;
case HARD_INT: { /* hardware interrupt notification */
if (tty_mess.NOTIFY_ARG & kbd_irq_set)
kbd_interrupt(&tty_mess);/* fetch chars from keyboard */