From: Ben Gras Date: Wed, 12 Oct 2005 14:31:39 +0000 (+0000) Subject: Added DEV_PING message type to drivers (but not ethernet drivers) so X-Git-Tag: v3.1.2a~640 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/static/%20%22?a=commitdiff_plain;h=87dbfc7ddafaa61951e87c142e056ef54b9e16fa;p=minix.git Added DEV_PING message type to drivers (but not ethernet drivers) so RS can monitor them. --- diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index 969b43625..d7e888a9b 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -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); diff --git a/drivers/cmos/cmos.c b/drivers/cmos/cmos.c index a74c58748..bfcf7c17a 100644 --- a/drivers/cmos/cmos.c +++ b/drivers/cmos/cmos.c @@ -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. diff --git a/drivers/floppy/floppy.c b/drivers/floppy/floppy.c index f18d90853..371de2f43 100644 --- a/drivers/floppy/floppy.c +++ b/drivers/floppy/floppy.c @@ -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; } diff --git a/drivers/libdriver/driver.c b/drivers/libdriver/driver.c index 44c658100..50a2fcf7d 100644 --- a/drivers/libdriver/driver.c +++ b/drivers/libdriver/driver.c @@ -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); diff --git a/drivers/log/log.c b/drivers/log/log.c index 4157e337e..2840767ec 100644 --- a/drivers/log/log.c +++ b/drivers/log/log.c @@ -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; diff --git a/drivers/printer/printer.c b/drivers/printer/printer.c index 33dba079a..fb4f8588d 100644 --- a/drivers/printer/printer.c +++ b/drivers/printer/printer.c @@ -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); } diff --git a/drivers/tty/tty.c b/drivers/tty/tty.c index b5abd3fd0..68323afdb 100644 --- a/drivers/tty/tty.c +++ b/drivers/tty/tty.c @@ -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 */