]> Zhao Yanbai Git Server - minix.git/commitdiff
Added DEV_PING message type to drivers (but not ethernet drivers) so
authorBen Gras <ben@minix3.org>
Wed, 12 Oct 2005 14:31:39 +0000 (14:31 +0000)
committerBen Gras <ben@minix3.org>
Wed, 12 Oct 2005 14:31:39 +0000 (14:31 +0000)
RS can monitor them.

drivers/at_wini/at_wini.c
drivers/cmos/cmos.c
drivers/floppy/floppy.c
drivers/libdriver/driver.c
drivers/log/log.c
drivers/printer/printer.c
drivers/tty/tty.c

index 969b436254d5501f42ce2a52e7715238f2709967..d7e888a9bd3bdf1dfab496a9751000d458114934 100644 (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);
index a74c587488d1c80e77aac84859ab2433611b2512..bfcf7c17ac9adc4b8c1e5fa15cc1cf328ce34cee 100644 (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. 
index f18d90853371ae52a8257628850d6c457b0e6ef8..371de2f436ec675aabdbc41dad921b677e3d9cdd 100644 (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;
        }
index 44c658100c85071cadca974556fdef52d050984e..50a2fcf7d77747ff26606e8fc39d40c753523338 100644 (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);
index 4157e337ecfc0ef8e3cb10f2f489f42c5b92e163..2840767ecb3c04bd59bbe097abe0444e64c9fa25 100644 (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;
index 33dba079a1db5bbcd8cc9fc581b6a52ad29114d3..fb4f8588d02a84bc7a2903411bb03bc3fba83dc0 100644 (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);
        }
index b5abd3fd09b6bc549422eda779939b3994f18264..68323afdb8fe6ef1da805b3231d64de1a2b28540 100644 (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 */