From: Tomas Hruby Date: Tue, 29 Sep 2009 18:47:56 +0000 (+0000) Subject: Removed macros that depend on NOTIFY_FROM from servers and drivers. They X-Git-Tag: v3.1.5~68 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=4dad30937b9af025bef03c2892998c13255213af;p=minix.git Removed macros that depend on NOTIFY_FROM from servers and drivers. They determine the information defined by these macros from the m_source field of the notify message. --- diff --git a/drivers/amddev/amddev.c b/drivers/amddev/amddev.c index 1491af553..e476551f4 100644 --- a/drivers/amddev/amddev.c +++ b/drivers/amddev/amddev.c @@ -21,6 +21,7 @@ Driver for the AMD Device Exclusion Vector (DEV) #include #include #include +#include #include /* Offsets from capability pointer */ @@ -78,13 +79,13 @@ int main(void) r= receive(ANY, &m); if (r != OK) panic(__FILE__, "receive failed", r); - switch(m.m_type) - { - case PROC_EVENT: - do_pm_notify(&m); - continue; - - case IOMMU_MAP: + if (is_notify(m.m_type)) { + if (_ENDPOINT_P(m.m_source) == PM_PROC_NR) { + do_pm_notify(&m); + continue; + } + } + else if (m.m_type == IOMMU_MAP) { r= do_add4pci(&m); m.m_type= r; send(m.m_source, &m); diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index c4da021ec..cb11f7c38 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -1586,11 +1587,10 @@ struct command *cmd; /* Command block */ return(ERR); } - /* Schedule a wakeup call, some controllers are flaky. This is done with - * a synchronous alarm. If a timeout occurs a SYN_ALARM message is sent - * from HARDWARE, so that w_intr_wait() can call w_timeout() in case the - * controller was not able to execute the command. Leftover timeouts are - * simply ignored by the main loop. + /* Schedule a wakeup call, some controllers are flaky. This is done with a + * synchronous alarm. If a timeout occurs a notify from CLOCK is sent, so that + * w_intr_wait() can call w_timeout() in case the controller was not able to + * execute the command. Leftover timeouts are simply ignored by the main loop. */ sys_setalarm(wakeup_ticks, 0); @@ -1639,11 +1639,10 @@ struct command *cmd; /* Command block */ return(ERR); } - /* Schedule a wakeup call, some controllers are flaky. This is done with - * a synchronous alarm. If a timeout occurs a SYN_ALARM message is sent - * from HARDWARE, so that w_intr_wait() can call w_timeout() in case the - * controller was not able to execute the command. Leftover timeouts are - * simply ignored by the main loop. + /* Schedule a wakeup call, some controllers are flaky. This is done with a + * synchronous alarm. If a timeout occurs a notify from CLOCK is sent, so that + * w_intr_wait() can call w_timeout() in case the controller was not able to + * execute the command. Leftover timeouts are simply ignored by the main loop. */ sys_setalarm(wakeup_ticks, 0); @@ -2057,26 +2056,38 @@ PRIVATE void w_intr_wait() int rr; if((rr=receive(ANY, &m)) != OK) panic("at_wini", "receive(ANY) failed", rr); - switch(m.m_type) { - case SYN_ALARM: - /* Timeout. */ - w_timeout(); /* a.o. set w_status */ - break; - case HARD_INT: - /* Interrupt. */ - r= sys_inb(w_wn->base_cmd + REG_STATUS, &w_status); - if (r != 0) - panic("at_wini", "sys_inb failed", r); - w_wn->w_status= w_status; - ack_irqs(m.NOTIFY_ARG); - break; - case DEV_PING: - /* RS monitor ping. */ - notify(m.m_source); - break; - default: - /* unhandled message. - * queue it and handle it in the libdriver loop. + if (is_notify(m.m_type)) { + switch (_ENDPOINT_P(m.m_source)) { + case CLOCK: + /* Timeout. */ + w_timeout(); /* a.o. set w_status */ + break; + case HARDWARE: + /* Interrupt. */ + r= sys_inb(w_wn->base_cmd + + REG_STATUS, &w_status); + if (r != 0) + panic("at_wini", + "sys_inb failed", r); + w_wn->w_status= w_status; + ack_irqs(m.NOTIFY_ARG); + break; + case RS_PROC_NR: + /* RS monitor ping. */ + notify(m.m_source); + break; + default: + /* + * unhandled message. queue it and + * handle it in the libdriver loop. + */ + mq_queue(&m); + } + } + else { + /* + * unhandled message. queue it and handle it in the + * libdriver loop. */ mq_queue(&m); } diff --git a/drivers/dp8390/dp8390.c b/drivers/dp8390/dp8390.c index 365a16a53..5caa73282 100644 --- a/drivers/dp8390/dp8390.c +++ b/drivers/dp8390/dp8390.c @@ -56,6 +56,7 @@ #include #include +#include #include #include #include @@ -202,13 +203,42 @@ _PROTOTYPE( static void do_vir_outsb, (port_t port, int proc, _PROTOTYPE( static void do_vir_outsw, (port_t port, int proc, vir_bytes buf, size_t size) ); +PRIVATE int handle_hw_intr(void) +{ + int i, r, irq; + dpeth_t *dep; + + for (i= 0, dep= &de_table[0]; ide_mode != DEM_ENABLED) + continue; + assert(dep->de_flags & DEF_ENABLED); + irq= dep->de_irq; + assert(irq >= 0 && irq < NR_IRQ_VECTORS); + if (dep->de_int_pending || 1) + { + dep->de_int_pending= 0; + dp_check_ints(dep); + do_int(dep); + r= sys_irqenable(&dep->de_hook); + if (r != OK) + { + panic("DP8390", + "unable enable interrupts", r); + } + } + } + + return r; +} + /*===========================================================================* * dpeth_task * *===========================================================================*/ int main(int argc, char *argv[]) { message m; - int i, irq, r, tasknr; + int i, r, tasknr; dpeth_t *dep; long v; @@ -243,9 +273,36 @@ int main(int argc, char *argv[]) if ((r= receive(ANY, &m)) != OK) panic("", "dp8390: receive failed", r); + if (is_notify(m.m_type)) { + switch (_ENDPOINT_P(m.m_source)) { + case RS_PROC_NR: + notify(m.m_source); + break; + case HARDWARE: + r = handle_hw_intr(); + break; + case SYSTEM: + if (sigismember((sigset_t*) + &m.NOTIFY_ARG, + SIGKSTOP)) + dp8390_stop(); + break; + case CLOCK: + printf("dp8390: notify from CLOCK\n"); + break; + case PM_PROC_NR: + break; + default: + panic("", "dp8390: illegal notify from", + m.m_source); + } + + /* done, get a new message */ + continue; + } + switch (m.m_type) { - case DEV_PING: notify(m.m_source); continue; case DL_WRITE: do_vwrite(&m, FALSE, FALSE); break; case DL_WRITEV: do_vwrite(&m, FALSE, TRUE); break; case DL_WRITEV_S: do_vwrite_s(&m, FALSE); break; @@ -257,38 +314,6 @@ int main(int argc, char *argv[]) case DL_GETSTAT_S: do_getstat_s(&m); break; case DL_GETNAME: do_getname(&m); break; case DL_STOP: do_stop(&m); break; - case HARD_INT: - for (i= 0, dep= &de_table[0]; ide_mode != DEM_ENABLED) - continue; - assert(dep->de_flags & DEF_ENABLED); - irq= dep->de_irq; - assert(irq >= 0 && irq < NR_IRQ_VECTORS); - if (dep->de_int_pending || 1) - { - dep->de_int_pending= 0; - dp_check_ints(dep); - do_int(dep); - r= sys_irqenable(&dep->de_hook); - if (r != OK) - { - panic("DP8390", - "unable enable interrupts", r); - } - } - } - break; - case SYS_SIG: { - sigset_t sigset = m.NOTIFY_ARG; - if (sigismember(&sigset, SIGKSTOP)) dp8390_stop(); - break; - } - case SYN_ALARM: - printf("dp8390: strange, got SYN_ALARM\n"); - break; - case PROC_EVENT: - break; default: panic("", "dp8390: illegal message", m.m_type); } diff --git a/drivers/dpeth/dp.c b/drivers/dpeth/dp.c index e569fd17a..efde4943f 100644 --- a/drivers/dpeth/dp.c +++ b/drivers/dpeth/dp.c @@ -15,14 +15,10 @@ ** ** m_type DL_PORT DL_PROC DL_COUNT DL_MODE DL_ADDR ** +------------+---------+---------+--------+-------+---------+ -** | HARD_INT | | | | | | -** +------------+---------+---------+--------+-------+---------+ -** | SYN_ALARM | | | | | | +** | NOTIFY from HARDWARE, CLOCK, TTY, RS, PM, SYSTEM | ** +------------+---------+---------+--------+-------+---------+ ** | HARD_STOP | | | | | | ** +------------+---------+---------+--------+-------+---------+ -** | FKEY_PRESSED | | | | | (99) -** +------------+---------+---------+--------+-------+---------+ ** | DL_WRITE | port nr | proc nr | count | mode | address | (3) ** +------------+---------+---------+--------+-------+---------+ ** | DL_WRITEV | port nr | proc nr | count | mode | address | (4) @@ -60,6 +56,7 @@ #include "drivers.h" #include +#include #include #include #include @@ -545,6 +542,39 @@ static void do_watchdog(void *message) return; } +PRIVATE void handle_system_signal(message *m) +{ + sigset_t sigset = m->NOTIFY_ARG; + int port; + + if (sigismember(&sigset, SIGKSTOP)) { /* Shut down */ + for (port = 0; port < DE_PORT_NR; port += 1) { + if (de_table[port].de_mode == DEM_ENABLED) { + m->m_type = DL_STOP; + m->DL_PORT = port; + do_stop(m); + } + } + } +} + +PRIVATE void handle_hw_intr(void) +{ + dpeth_t *dep; + + for (dep = de_table; dep < &de_table[DE_PORT_NR]; dep += 1) { + /* If device is enabled and interrupt pending */ + if (dep->de_mode == DEM_ENABLED) { + dep->de_int_pending = TRUE; + (*dep->de_interruptf) (dep); + if (dep->de_flags & (DEF_ACK_SEND | DEF_ACK_RECV)) + reply(dep, !OK, DL_TASK_REPLY); + dep->de_int_pending = FALSE; + sys_irqenable(&dep->de_hook); + } + } +} + /* ** Name: int dpeth_task(void) ** Function: Main entry for dp task @@ -584,10 +614,39 @@ PUBLIC int main(int argc, char **argv) DEBUG(printf("eth: got message %d, ", m.m_type)); - switch (m.m_type) { - case DEV_PING: /* Status request from RS */ - notify(m.m_source); + if (is_notify(m.m_type)) { + switch(_ENDPOINT_P(m.m_source)) { + case CLOCK: + /* to be defined */ + do_watchdog(&m); + break; + case RS_PROC_NR: + /* Status request from RS */ + notify(m.m_source); + break; + case SYSTEM: + handle_system_signal(&m); + break; + case HARDWARE: + /* Interrupt from device */ + handle_hw_intr(); + break; + case TTY_PROC_NR: + /* Function key pressed */ + do_dump(&m); + break; + case PM_PROC_NR: + break; + default: + /* Invalid message type */ + panic(DevName, TypeErrMsg, m.m_type); + break; + } + /* message processed, get another one */ continue; + } + + switch (m.m_type) { case DL_WRITEV_S: /* Write message to device */ do_vwrite_s(&m); break; @@ -603,43 +662,9 @@ PUBLIC int main(int argc, char **argv) case DL_GETNAME: do_getname(&m); break; - case SYN_ALARM: /* to be defined */ - do_watchdog(&m); - break; case DL_STOP: /* Stop device */ do_stop(&m); break; - case SYS_SIG: { - sigset_t sigset = m.NOTIFY_ARG; - if (sigismember(&sigset, SIGKSTOP)) { /* Shut down */ - for (rc = 0; rc < DE_PORT_NR; rc += 1) { - if (de_table[rc].de_mode == DEM_ENABLED) { - m.m_type = DL_STOP; - m.DL_PORT = rc; - do_stop(&m); - } - } - } - break; - } - case HARD_INT: /* Interrupt from device */ - for (dep = de_table; dep < &de_table[DE_PORT_NR]; dep += 1) { - /* If device is enabled and interrupt pending */ - if (dep->de_mode == DEM_ENABLED) { - dep->de_int_pending = TRUE; - (*dep->de_interruptf) (dep); - if (dep->de_flags & (DEF_ACK_SEND | DEF_ACK_RECV)) - reply(dep, !OK, DL_TASK_REPLY); - dep->de_int_pending = FALSE; - sys_irqenable(&dep->de_hook); - } - } - break; - case FKEY_PRESSED: /* Function key pressed */ - do_dump(&m); - break; - case PROC_EVENT: - break; default: /* Invalid message type */ panic(DevName, TypeErrMsg, m.m_type); break; diff --git a/drivers/floppy/floppy.c b/drivers/floppy/floppy.c index 5e9d9a79f..1354cfd4c 100644 --- a/drivers/floppy/floppy.c +++ b/drivers/floppy/floppy.c @@ -28,6 +28,7 @@ #include #include #include +#include /* I/O Ports used by floppy disk task. */ #define DOR 0x3F2 /* motor drive control bits */ @@ -760,16 +761,25 @@ PRIVATE void start_motor() if (running) return; /* motor was already running */ /* Set an alarm timer to force a timeout if the hardware does not interrupt - * in time. Expect HARD_INT message, but check for SYN_ALARM timeout. + * in time. Expect an interrupt, but check for a timeout. */ f_set_timer(&f_tmr_timeout, f_dp->start_ms * system_hz / 1000, f_timeout); f_busy = BSY_IO; do { 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); + + if (is_notify(mess.m_type)) { + switch (_ENDPOINT_P(mess.m_source)) { + case CLOCK: + f_expire_tmrs(NULL, NULL); + break; + case RS_PROC_NR: + notify(mess.m_source); + break; + default : + f_busy = BSY_IDLE; + break; + } } else { f_busy = BSY_IDLE; } @@ -844,16 +854,25 @@ PRIVATE int seek() /* Give head time to settle on a format, no retrying here! */ if (f_device & FORMAT_DEV_BIT) { /* Set a synchronous alarm to force a timeout if the hardware does - * not interrupt. Expect HARD_INT, but check for SYN_ALARM timeout. + * not interrupt. */ f_set_timer(&f_tmr_timeout, system_hz/30, f_timeout); f_busy = BSY_IO; do { 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); + + if (is_notify(mess.m_type)) { + switch (_ENDPOINT_P(mess.m_source)) { + case CLOCK: + f_expire_tmrs(NULL, NULL); + break; + case RS_PROC_NR: + notify(mess.m_source); + break; + default : + f_busy = BSY_IDLE; + break; + } } else { f_busy = BSY_IDLE; } @@ -998,7 +1017,7 @@ int len; /* command length */ /* Output a command to the controller. */ /* Set a synchronous alarm to force a timeout if the hardware does - * not interrupt. Expect HARD_INT, but check for SYN_ALARM timeout. + * not interrupt. * Note that the actual check is done by the code that issued the * fdc_command() call. */ @@ -1118,17 +1137,24 @@ PRIVATE void f_reset() if ((s=sys_voutb(byte_out, 2)) != OK) panic("FLOPPY", "Sys_voutb in f_reset() failed", s); - /* A synchronous alarm timer was set in fdc_command. Expect a HARD_INT - * message to collect the reset interrupt, but be prepared to handle the - * SYN_ALARM message on a timeout. + /* A synchronous alarm timer was set in fdc_command. Expect an interrupt, + * but be prepared to handle a timeout. */ do { 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 */ + if (is_notify(mess.m_type)) { + switch (_ENDPOINT_P(mess.m_source)) { + case CLOCK: + f_expire_tmrs(NULL, NULL); + break; + case RS_PROC_NR: + notify(mess.m_source); + break; + default : + f_busy = BSY_IDLE; + break; + } + } else { /* expect hw interrupt */ f_busy = BSY_IDLE; } } while (f_busy == BSY_IO); @@ -1165,16 +1191,21 @@ PRIVATE int f_intr_wait() */ message mess; - /* We expect a HARD_INT message from the interrupt handler, but if there is - * a timeout, a SYN_ALARM notification is received instead. If a timeout - * occurs, report an error. - */ + /* We expect an interrupt, but if a timeout, occurs, report an error. */ do { 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); + if (is_notify(mess.m_type)) { + switch (_ENDPOINT_P(mess.m_source)) { + case CLOCK: + f_expire_tmrs(NULL, NULL); + break; + case RS_PROC_NR: + notify(mess.m_source); + break; + default : + f_busy = BSY_IDLE; + break; + } } else { f_busy = BSY_IDLE; } diff --git a/drivers/fxp/fxp.c b/drivers/fxp/fxp.c index 25f3b7c58..f733aef5c 100644 --- a/drivers/fxp/fxp.c +++ b/drivers/fxp/fxp.c @@ -60,6 +60,7 @@ #include #include #include +#include #include @@ -277,6 +278,29 @@ _PROTOTYPE( static void do_outl, (port_t port, u32_t v) ); _PROTOTYPE( static void tell_dev, (vir_bytes start, size_t size, int pci_bus, int pci_dev, int pci_func) ); +PRIVATE void handle_hw_intr(void) +{ + int i, r; + fxp_t *fp; + + for (i= 0, fp= &fxp_table[0]; ifxp_mode != FM_ENABLED) + return; + fxp_handler(fp); + + r= sys_irqenable(&fp->fxp_hook); + if (r != OK) { + panic("FXP", "unable enable interrupts", r); + } + + if (!fp->fxp_got_int) + return; + fp->fxp_got_int= 0; + assert(fp->fxp_flags & FF_ENABLED); + fxp_check_ints(fp); + } +} + /*===========================================================================* * main * *===========================================================================*/ @@ -285,7 +309,6 @@ int main(int argc, char *argv[]) message m; int i, r; u32_t tasknr; - fxp_t *fp; long v; vir_bytes ft = sizeof(*fxp_table)*FXP_PORT_NR; @@ -322,9 +345,33 @@ int main(int argc, char *argv[]) if ((r= receive(ANY, &m)) != OK) panic("FXP","receive failed", r); + if (is_notify(m.m_type)) { + switch (_ENDPOINT_P(m.m_source)) { + case RS_PROC_NR: + notify(m.m_source); + break; + case HARDWARE: + handle_hw_intr(); + break; + case SYSTEM: + if (sigismember((sigset_t *)&m.NOTIFY_ARG, SIGKSTOP)) + fxp_stop(); + break; + case PM_PROC_NR: + break; + case CLOCK: + fxp_expire_timers(); + break; + default: + panic("FXP"," illegal notify from", m.m_source); + } + + /* get new message */ + continue; + } + switch (m.m_type) { - case DEV_PING: notify(m.m_source); continue; case DL_WRITEV: fxp_writev(&m, FALSE, TRUE); break; case DL_WRITE: fxp_writev(&m, FALSE, FALSE); break; case DL_WRITEV_S: fxp_writev_s(&m, FALSE); break; @@ -335,34 +382,6 @@ int main(int argc, char *argv[]) case DL_GETSTAT: fxp_getstat(&m); break; case DL_GETSTAT_S: fxp_getstat_s(&m); break; case DL_GETNAME: fxp_getname(&m); break; - case HARD_INT: - for (i= 0, fp= &fxp_table[0]; ifxp_mode != FM_ENABLED) - continue; - fxp_handler(fp); - - r= sys_irqenable(&fp->fxp_hook); - if (r != OK) - { - panic("FXP", - "unable enable interrupts", r); - } - - if (!fp->fxp_got_int) - continue; - fp->fxp_got_int= 0; - assert(fp->fxp_flags & FF_ENABLED); - fxp_check_ints(fp); - } - break; - case SYS_SIG: { - sigset_t sigset = m.NOTIFY_ARG; - if (sigismember(&sigset, SIGKSTOP)) fxp_stop(); - break; - } - case PROC_EVENT: break; - case SYN_ALARM: fxp_expire_timers(); break; default: panic("FXP"," illegal message", m.m_type); } diff --git a/drivers/lance/lance.c b/drivers/lance/lance.c index 4919f725b..3c8adea6f 100644 --- a/drivers/lance/lance.c +++ b/drivers/lance/lance.c @@ -49,6 +49,7 @@ #include #include +#include #include #include @@ -318,11 +319,46 @@ void main( int argc, char **argv ) if (ec->ec_irq != 0) sys_irqdisable(&ec->ec_hook); } + + if (is_notify(m.m_type)) { + switch(_ENDPOINT_P(m.m_source)) { + case RS_PROC_NR: + notify(m.m_source); + break; + case TTY_PROC_NR: + lance_dump(); + break; + case SYSTEM: + if (sigismember((sigset_t*)&m.NOTIFY_ARG, SIGKSTOP)) + lance_stop(); + break; + case HARDWARE: + for (i=0;imode != EC_ENABLED) + continue; + + irq=ec->ec_irq; + { + ec->ec_int_pending = 0; + ec_check_ints(ec); + do_int(ec); + } + } + break; + case PM_PROC_NR: + break; + default: + panic( "lance", "illegal notify source", m.m_source); + } + + /* get next message */ + continue; + } + switch (m.m_type) { - case DEV_PING: - notify(m.m_source); - continue; case DL_WRITEV_S: do_vwrite_s(&m, FALSE); break; @@ -341,32 +377,6 @@ void main( int argc, char **argv ) case DL_GETNAME: do_getname(&m); break; - case FKEY_PRESSED: - lance_dump(); - break; - case SYS_SIG: - { - sigset_t set = m.NOTIFY_ARG; - if ( sigismember( &set, SIGKSTOP ) ) - lance_stop(); - } - break; - case HARD_INT: - for (i=0;imode != EC_ENABLED) - continue; - { - ec->ec_int_pending = 0; - ec_check_ints(ec); - do_int(ec); - } - } - break; - case PROC_EVENT: - /* ignore event */ - break; default: panic( "lance", "illegal message", m.m_type); } diff --git a/drivers/libdriver/driver.c b/drivers/libdriver/driver.c index 4a661ad1f..079444614 100644 --- a/drivers/libdriver/driver.c +++ b/drivers/libdriver/driver.c @@ -41,6 +41,7 @@ #include "../drivers.h" #include #include +#include #include "driver.h" /* Claim space for variables. */ @@ -94,6 +95,35 @@ struct driver *dp; /* Device dependent entry points. */ proc_nr = mess.IO_ENDPT; /* Now carry out the work. */ + if (is_notify(mess.m_type)) { + switch (_ENDPOINT_P(mess.m_source)) { + case HARDWARE: + /* leftover interrupt or expired timer. */ + if(dp->dr_hw_int) { + (*dp->dr_hw_int)(dp, &mess); + } + break; + case PM_PROC_NR: + case SYSTEM: + (*dp->dr_signal)(dp, &mess); + break; + case CLOCK: + (*dp->dr_alarm)(dp, &mess); + break; + case RS_PROC_NR: + notify(mess.m_source); + break; + default: + if(dp->dr_other) + r = (*dp->dr_other)(dp, &mess, 0); + else + r = EINVAL; + goto send_reply; + } + + /* done, get a new message */ + continue; + } switch(mess.m_type) { case DEV_OPEN: r = (*dp->dr_open)(dp, &mess); break; case DEV_CLOSE: r = (*dp->dr_close)(dp, &mess); break; @@ -116,18 +146,6 @@ struct driver *dp; /* Device dependent entry points. */ case DEV_GATHER_S: case DEV_SCATTER_S: r = do_vrdwt(dp, &mess, 1); break; - case HARD_INT: /* leftover interrupt or expired timer. */ - if(dp->dr_hw_int) { - (*dp->dr_hw_int)(dp, &mess); - } - continue; - case PROC_EVENT: - case SYS_SIG: (*dp->dr_signal)(dp, &mess); - 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, 0); @@ -136,6 +154,7 @@ struct driver *dp; /* Device dependent entry points. */ break; } +send_reply: /* Clean up leftover state. */ (*dp->dr_cleanup)(); diff --git a/drivers/libdriver_asyn/driver.c b/drivers/libdriver_asyn/driver.c index c000d4986..8adf5f318 100644 --- a/drivers/libdriver_asyn/driver.c +++ b/drivers/libdriver_asyn/driver.c @@ -1,6 +1,7 @@ /* This file contains device independent device driver interface. * * Changes: + * Sep 25, 2009 removed all macros depending on NOTIFY_FROM() (T. Hruby) * Jul 25, 2005 added SYS_SIG type for signals (Jorrit N. Herder) * Sep 15, 2004 added SYN_ALARM type for timeouts (Jorrit N. Herder) * Jul 23, 2004 removed kernel dependencies (Jorrit N. Herder) @@ -41,6 +42,7 @@ #include "../drivers.h" #include #include +#include #include "driver.h" /* Claim space for variables. */ @@ -91,19 +93,6 @@ struct driver *dp; /* Device dependent entry points. */ device_caller = mess.m_source; proc_nr = mess.IO_ENDPT; -#if 0 - if (mess.m_type != SYN_ALARM && mess.m_type != DEV_PING && - mess.m_type != 4105 /* notify from TTY */ && - mess.m_type != DEV_SELECT && - mess.m_type != DEV_READ_S && - mess.m_type != DIAGNOSTICS_S && - mess.m_type != CANCEL) - { - printf("libdriver_asyn`driver_task: msg %d / 0x%x from %d\n", - mess.m_type, mess.m_type, mess.m_source); - } -#endif - if (mess.m_type == DEV_SELECT) { static int first= 1; @@ -119,6 +108,36 @@ struct driver *dp; /* Device dependent entry points. */ } /* Now carry out the work. */ + if (is_notify(mess.m_type)) { + switch (_ENDPOINT_P(mess.m_source)) { + case HARDWARE: + /* leftover interrupt or expired timer. */ + if(dp->dr_hw_int) { + (*dp->dr_hw_int)(dp, &mess); + } + break; + case PM_PROC_NR: + case SYSTEM: + (*dp->dr_signal)(dp, &mess); + break; + case CLOCK: + (*dp->dr_alarm)(dp, &mess); + break; + case RS_PROC_NR: + notify(mess.m_source); + break; + default: + if(dp->dr_other) + r = (*dp->dr_other)(dp, &mess, 0); + else + r = EINVAL; + goto send_reply; + } + + /* done, get a new message */ + continue; + } + switch(mess.m_type) { case DEV_OPEN: r = (*dp->dr_open)(dp, &mess); break; case DEV_CLOSE: r = (*dp->dr_close)(dp, &mess); break; @@ -141,18 +160,6 @@ struct driver *dp; /* Device dependent entry points. */ case DEV_GATHER_S: case DEV_SCATTER_S: r = do_vrdwt(dp, &mess, 1); break; - case HARD_INT: /* leftover interrupt or expired timer. */ - if(dp->dr_hw_int) { - (*dp->dr_hw_int)(dp, &mess); - } - continue; - case PROC_EVENT: - case SYS_SIG: (*dp->dr_signal)(dp, &mess); - 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, 0); @@ -161,6 +168,7 @@ struct driver *dp; /* Device dependent entry points. */ break; } +send_reply: /* Clean up leftover state. */ (*dp->dr_cleanup)(); diff --git a/drivers/orinoco/orinoco.c b/drivers/orinoco/orinoco.c index 48183db42..282287552 100755 --- a/drivers/orinoco/orinoco.c +++ b/drivers/orinoco/orinoco.c @@ -64,6 +64,7 @@ #include #include #include +#include #include "../../kernel/const.h" #include "../../kernel/config.h" #include "../../kernel/type.h" @@ -225,7 +226,7 @@ _PROTOTYPE (static int or_handler, (t_or *orp)); _PROTOTYPE (static void or_dump, (message *m)); /* The message used in the main loop is made global, so that rl_watchdog_f() - * can change its message type to fake a HARD_INT message. + * can change its message type to fake an interrupt message. */ PRIVATE message m; PRIVATE int int_event_check; /* set to TRUE if events arrived */ @@ -271,10 +272,40 @@ int main(int argc, char *argv[]) { if ((r = receive (ANY, &m)) != OK) panic(__FILE__, "orinoco: receive failed", NO_NUM); + if (is_notify(m.m_type)) { + switch (_ENDPOINT_P(m.m_source)) { + case RS_PROC_NR: + notify(m.m_source); + break; + case CLOCK: + or_watchdog_f(NULL); + break; + case SYSTEM: + if (sigismember((sigset_t*)&m.NOTIFY_ARG, + SIGKSTOP)) + orinoco_stop(); + break; + case HARDWARE: + do_hard_int(); + if (int_event_check) + check_int_events(); + break ; + case TTY_PROC_NR: + or_dump(&m); + break; + case PM_PROC_NR: + break; + default: + panic(__FILE__, + "orinoco: illegal notify from:", + m.m_source); + } + + /* done, get new message */ + continue; + } + switch (m.m_type) { - case DEV_PING: - notify(m.m_source); - break; case DL_WRITEV: or_writev (&m, FALSE, TRUE); break; @@ -305,26 +336,6 @@ int main(int argc, char *argv[]) { case DL_GETNAME: or_getname(&m); break; - case SYN_ALARM: - or_watchdog_f(NULL); - break; - case SYS_SIG: - { - sigset_t sigset = m.NOTIFY_ARG; - if ( sigismember( &sigset, SIGKSTOP ) ) - orinoco_stop(); - } - break; - case HARD_INT: - do_hard_int(); - if (int_event_check) - check_int_events(); - break ; - case FKEY_PRESSED: - or_dump(&m); - break; - case PROC_EVENT: - break; default: panic(__FILE__,"orinoco: illegal message:", m.m_type); } @@ -341,8 +352,8 @@ static void check_int_events(void) { int i; t_or *orp; - /* the HARD_INT message doesn't contain information about the port, try - * to find it */ + /* the interrupt message doesn't contain information about the port, try + * to find it */ for (orp = or_table; orp < or_table + OR_PORT_NR; orp++) { if (orp->or_mode != OR_M_ENABLED) diff --git a/drivers/pci/main.c b/drivers/pci/main.c index fba9440fe..2e2bdb06e 100644 --- a/drivers/pci/main.c +++ b/drivers/pci/main.c @@ -6,6 +6,7 @@ main.c #include #include +#include #include "pci.h" @@ -55,6 +56,21 @@ int main(void) printf("PCI: receive from ANY failed: %d\n", r); break; } + + if (is_notify(m.m_type)) { + switch (_ENDPOINT_P(m.m_source)) { + case PM_PROC_NR: + break; + default: + printf("PCI: got notify from %d\n", + m.m_source); + break; + } + + /* done, get a new message */ + continue; + } + switch(m.m_type) { case BUSC_PCI_INIT: do_init(&m); break; @@ -75,7 +91,6 @@ int main(void) case BUSC_PCI_SLOT_NAME_S: do_slot_name_s(&m); break; case BUSC_PCI_SET_ACL: do_set_acl(&m); break; case BUSC_PCI_DEL_ACL: do_del_acl(&m); break; - case PROC_EVENT: break; default: printf("PCI: got message from %d, type %d\n", m.m_source, m.m_type); diff --git a/drivers/printer/printer.c b/drivers/printer/printer.c index d815f0dd7..4dc9815f4 100644 --- a/drivers/printer/printer.c +++ b/drivers/printer/printer.c @@ -32,6 +32,7 @@ * Note: since only 1 printer is supported, minor dev is not used at present. */ +#include #include "../drivers.h" /* Control bits (in port_base + 2). "+" means positive logic and "-" means @@ -133,6 +134,27 @@ PUBLIC void main(void) while (TRUE) { receive(ANY, &pr_mess); + + if (is_notify(pr_mess.m_type)) { + switch (_ENDPOINT_P(pr_mess.m_source)) { + case HARDWARE: + do_printer_output(); + break; + case SYSTEM: + do_signal(&pr_mess); + break; + case RS_PROC_NR: + notify(pr_mess.m_source); + break; + case PM_PROC_NR: + break; + default: + reply(TASK_REPLY, pr_mess.m_source, + pr_mess.IO_ENDPT, EINVAL); + } + continue; + } + switch(pr_mess.m_type) { case DEV_OPEN: do_initialize(); /* initialize */ @@ -143,10 +165,6 @@ PUBLIC void main(void) case DEV_WRITE_S: do_write(&pr_mess, 1); break; case DEV_STATUS: do_status(&pr_mess); break; case CANCEL: do_cancel(&pr_mess); break; - case HARD_INT: do_printer_output(); break; - case SYS_SIG: do_signal(&pr_mess); break; - case DEV_PING: notify(pr_mess.m_source); break; - case PROC_EVENT: break; default: reply(TASK_REPLY, pr_mess.m_source, pr_mess.IO_ENDPT, EINVAL); } @@ -385,10 +403,10 @@ PRIVATE void prepare_output() *===========================================================================*/ PRIVATE void do_printer_output() { -/* This function does the actual output to the printer. This is called on - * a HARD_INT message sent from the generic interrupt handler that 'forwards' - * interrupts to this driver. The generic handler did not reenable the - * printer IRQ yet! +/* This function does the actual output to the printer. This is called on an + * interrupt message sent from the generic interrupt handler that 'forwards' + * interrupts to this driver. The generic handler did not reenable the printer + * IRQ yet! */ unsigned long status; diff --git a/drivers/rtl8139/rtl8139.c b/drivers/rtl8139/rtl8139.c index 1d8c924bb..15e974e07 100755 --- a/drivers/rtl8139/rtl8139.c +++ b/drivers/rtl8139/rtl8139.c @@ -67,6 +67,7 @@ #include #include #include +#include #include #include #include @@ -293,7 +294,7 @@ _PROTOTYPE( static void tell_dev, (vir_bytes start, size_t size, int pci_bus, int pci_dev, int pci_func) ); /* The message used in the main loop is made global, so that rl_watchdog_f() - * can change its message type to fake a HARD_INT message. + * can change its message type to fake an interrupt message. */ PRIVATE message m; PRIVATE int int_event_check; /* set to TRUE if events arrived */ @@ -347,9 +348,53 @@ int main(int argc, char *argv[]) if ((r= receive(ANY, &m)) != OK) panic("rtl8139","receive failed", r); + if (is_notify(m.m_type)) { + switch (_ENDPOINT_P(m.m_source)) { + case RS_PROC_NR: + notify(m.m_source); + break; + case CLOCK: + /* + * Under MINIX, synchronous alarms are + * used instead of watchdog functions. + * The approach is very different: MINIX + * VMD timeouts are handled within the + * kernel (the watchdog is executed by + * CLOCK), and notify() the driver in + * some cases. MINIX timeouts result in + * a SYN_ALARM message to the driver and + * thus are handled where they should be + * handled. Locally, watchdog functions + * are used again. + */ + rl_watchdog_f(NULL); + break; + case SYSTEM: + if (sigismember((sigset_t*)&m.NOTIFY_ARG, + SIGKSTOP)) + rtl8139_stop(); + break; + case HARDWARE: + do_hard_int(); + if (int_event_check) + check_int_events(); + break ; + case TTY_PROC_NR: + rtl8139_dump(&m); + break; + case PM_PROC_NR: + break; + default: + panic("rtl8139","illegal notify from", + m.m_source); + } + + /* done, get nwe message */ + continue; + } + switch (m.m_type) { - case DEV_PING: notify(m.m_source); break; case DL_WRITE: rl_writev(&m, FALSE, FALSE); break; case DL_WRITEV: rl_writev(&m, FALSE, TRUE); break; case DL_WRITEV_S: rl_writev_s(&m, FALSE); break; @@ -363,33 +408,6 @@ int main(int argc, char *argv[]) #if 0 case DL_STOP: do_stop(&m); break; #endif - case SYN_ALARM: - /* Under MINIX, synchronous alarms are used instead of - * watchdog functions. The approach is very different: - * MINIX VMD timeouts are handled within the kernel - * (the watchdog is executed by CLOCK), and notify() - * the driver in some cases. - * MINIX timeouts result in a SYN_ALARM message to the - * driver and thus are handled where they should be - * handled. Locally, watchdog functions are used again. - */ - rl_watchdog_f(NULL); - break; - case SYS_SIG: - { - sigset_t sigset = m.NOTIFY_ARG; - if ( sigismember( &sigset, SIGKSTOP ) ) - rtl8139_stop(); - } - break; - case HARD_INT: - do_hard_int(); - if (int_event_check) - check_int_events(); - break ; - case FKEY_PRESSED: rtl8139_dump(&m); break; - case PROC_EVENT: - break; default: panic("rtl8139","illegal message", m.m_type); } diff --git a/drivers/sb16/sb16_dsp.c b/drivers/sb16/sb16_dsp.c index b05be18c7..893248170 100644 --- a/drivers/sb16/sb16_dsp.c +++ b/drivers/sb16/sb16_dsp.c @@ -24,6 +24,7 @@ * May 20 1995 Author: Michel R. Prevenier */ +#include #include "sb16.h" @@ -97,6 +98,21 @@ PUBLIC void main() caller = mess.m_source; proc_nr = mess.IO_ENDPT; + if (is_notify(mess.m_type)) { + switch (_ENDPOINT_P(mess.m_source)) { + case HARDWARE: + dsp_hardware_msg(); + continue; /* don't reply */ + case SYSTEM: + continue; /* don't reply */ + default: + r = EINVAL; + } + + /* dont with this message */ + goto send_reply; + } + /* Now carry out the work. */ switch(mess.m_type) { case DEV_OPEN: r = dsp_open(); break; @@ -111,11 +127,10 @@ PUBLIC void main() #endif case DEV_STATUS: dsp_status(&mess); continue; /* don't reply */ - case HARD_INT: dsp_hardware_msg(); continue; /* don't reply */ - case SYS_SIG: continue; /* don't reply */ default: r = EINVAL; } +send_reply: /* Finally, prepare and send the reply message. */ reply(TASK_REPLY, caller, proc_nr, r); } diff --git a/drivers/tty/keyboard.c b/drivers/tty/keyboard.c index bdc27770d..db1a70614 100644 --- a/drivers/tty/keyboard.c +++ b/drivers/tty/keyboard.c @@ -1176,7 +1176,6 @@ int scode; /* scan code for a function key */ /* See if an observer is registered and send it a message. */ if (proc_nr != NONE) { - m.NOTIFY_TYPE = FKEY_PRESSED; notify(proc_nr); } return(TRUE); diff --git a/drivers/tty/tty.c b/drivers/tty/tty.c index c87301fa3..784c77ca1 100644 --- a/drivers/tty/tty.c +++ b/drivers/tty/tty.c @@ -18,8 +18,9 @@ * * The valid messages and their parameters are: * - * HARD_INT: output has been completed or input has arrived - * SYS_SIG: e.g., MINIX wants to shutdown; run code to cleanly stop + * notify from HARDWARE: output has been completed or input has arrived + * notify from SYSTEM : e.g., MINIX wants to shutdown; run code to + * cleanly stop * DEV_READ: a process wants to read from a terminal * DEV_WRITE: a process wants to write on a terminal * DEV_IOCTL: a process wants to change a terminal's parameters @@ -64,6 +65,7 @@ #include #include #include +#include #include "tty.h" #include @@ -190,32 +192,50 @@ PUBLIC int main(void) * request and should be handled separately. These extra functions * do not operate on a device, in constrast to the driver requests. */ - switch (tty_mess.m_type) { - 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 */ + + if (is_notify(tty_mess.m_type)) { + switch (_ENDPOINT_P(tty_mess.m_source)) { + case CLOCK: + /* run watchdogs of expired timers */ + expire_timers(); + break; + case RS_PROC_NR: + notify(tty_mess.m_source); + break; + case HARDWARE: + /* hardware interrupt notification */ + + /* fetch chars from keyboard */ + if (tty_mess.NOTIFY_ARG & kbd_irq_set) + kbd_interrupt(&tty_mess); #if NR_RS_LINES > 0 - if (tty_mess.NOTIFY_ARG & rs_irq_set) - rs_interrupt(&tty_mess);/* serial I/O */ + /* serial I/O */ + if (tty_mess.NOTIFY_ARG & rs_irq_set) + rs_interrupt(&tty_mess); #endif - expire_timers(); /* run watchdogs of expired timers */ - continue; /* contine to check for events */ - } - case PROC_EVENT: { - cons_stop(); /* switch to primary console */ - continue; - } - case SYS_SIG: { /* system signal */ - sigset_t sigset = (sigset_t) tty_mess.NOTIFY_ARG; - if (sigismember(&sigset, SIGKMESS)) do_new_kmess(&tty_mess); + /* run watchdogs of expired timers */ + expire_timers(); + break; + case PM_PROC_NR: + /* switch to primary console */ + cons_stop(); + break; + case SYSTEM: + /* system signal */ + if (sigismember((sigset_t*)&tty_mess.NOTIFY_ARG, + SIGKMESS)) + do_new_kmess(&tty_mess); + break; + default: + /* do nothing */ + break; + } + + /* done, get new message */ continue; } + + switch (tty_mess.m_type) { case DIAGNOSTICS_OLD: /* a server wants to print some */ #if 0 if (tty_mess.m_source != LOG_PROC_NR) diff --git a/servers/ds/main.c b/servers/ds/main.c index 86faf18a5..60bf2d51b 100644 --- a/servers/ds/main.c +++ b/servers/ds/main.c @@ -9,9 +9,10 @@ */ #include "inc.h" /* include master header file */ +#include /* Allocate space for the global variables. */ -int who_e; /* caller's proc number */ +endpoint_t who_e; /* caller's proc number */ int callnr; /* system call number */ int sys_panic; /* flag to indicate system-wide panic */ @@ -46,10 +47,22 @@ PUBLIC int main(int argc, char **argv) /* Wait for incoming message, sets 'callnr' and 'who'. */ get_work(&m); + if (is_notify(callnr)) { + switch (_ENDPOINT_P(who_e)) { + case PM_PROC_NR: + sig_handler(); + break; + default: + report("DS","warning, got illegal notify from:", + m.m_source); + result = EINVAL; + goto send_reply; + } + + /* done, get a new message */ + } + switch (callnr) { - case PROC_EVENT: - sig_handler(); - continue; case DS_PUBLISH: result = do_publish(&m); break; @@ -70,6 +83,7 @@ PUBLIC int main(int argc, char **argv) result = EINVAL; } +send_reply: /* Finally send reply message, unless disabled. */ if (result != EDONTREPLY) { m.m_type = result; /* build reply message */ diff --git a/servers/inet/inet.c b/servers/inet/inet.c index 9ccbfad14..a6a59e2c4 100644 --- a/servers/inet/inet.c +++ b/servers/inet/inet.c @@ -51,6 +51,7 @@ from DL_ETH: #include #include #include +#include #include "mq.h" #include "qp.h" @@ -253,22 +254,25 @@ PUBLIC void main() mq_free(mq); } #else /* Minix 3 */ - else if (m_type == SYN_ALARM) + else if (is_notify(m_type)) { - clck_tick(&mq->mq_mess); - mq_free(mq); - } - else if (m_type == PROC_EVENT) - { - /* signaled */ - /* probably SIGTERM */ - mq_free(mq); - } - else if (m_type & NOTIFY_MESSAGE) - { - /* A driver is (re)started. */ - eth_check_drivers(&mq->mq_mess); - mq_free(mq); + if (_ENDPOINT_P(source) == CLOCK) + { + clck_tick(&mq->mq_mess); + mq_free(mq); + } + else if (_ENDPOINT_P(source) == PM_PROC_NR) + { + /* signaled */ + /* probably SIGTERM */ + mq_free(mq); + } + else + { + /* A driver is (re)started. */ + eth_check_drivers(&mq->mq_mess); + mq_free(mq); + } } #endif else if (m_type == DL_CONF_REPLY || m_type == DL_TASK_REPLY || diff --git a/servers/is/main.c b/servers/is/main.c index f36762fbf..63996e502 100644 --- a/servers/is/main.c +++ b/servers/is/main.c @@ -8,6 +8,7 @@ */ #include "inc.h" +#include /* Allocate space for the global variables. */ message m_in; /* the input message itself */ @@ -42,25 +43,28 @@ PUBLIC int main(int argc, char **argv) /* Wait for incoming message, sets 'callnr' and 'who'. */ get_work(); - switch (callnr) { - case SYS_SIG: - printf("got SYS_SIG message\n"); - sigset = m_in.NOTIFY_ARG; - for ( result=0; result< _NSIG; result++) { - if (sigismember(&sigset, result)) - printf("signal %d found\n", result); - } - continue; - case PROC_EVENT: - result = EDONTREPLY; - break; - case FKEY_PRESSED: - result = do_fkey_pressed(&m_in); - break; - case DEV_PING: - notify(m_in.m_source); - continue; - default: + if (is_notify(callnr)) { + switch (_ENDPOINT_P(who_e)) { + case SYSTEM: + printf("got message from SYSTEM\n"); + sigset = m_in.NOTIFY_ARG; + for ( result=0; result< _NSIG; result++) { + if (sigismember(&sigset, result)) + printf("signal %d found\n", result); + } + continue; + case PM_PROC_NR: + result = EDONTREPLY; + break; + case TTY_PROC_NR: + result = do_fkey_pressed(&m_in); + break; + case RS_PROC_NR: + notify(m_in.m_source); + continue; + } + } + else { printf("IS: warning, got illegal request %d from %d\n", callnr, m_in.m_source); result = EDONTREPLY; diff --git a/servers/mfs/main.c b/servers/mfs/main.c index 6d37a1247..5fba16e6c 100644 --- a/servers/mfs/main.c +++ b/servers/mfs/main.c @@ -127,7 +127,7 @@ message *m_in; /* pointer to message */ if (src != FS_PROC_NR) { if(src == PM_PROC_NR) { - if(fs_m_in.m_type == PROC_EVENT) + if(is_notify(fs_m_in.m_type)) srcok = 1; /* Normal exit request. */ else printf("MFS: unexpected message from PM\n"); @@ -145,7 +145,7 @@ message *m_in; /* pointer to message */ } while(!srcok); assert((src == FS_PROC_NR && !unmountdone) || - (src == PM_PROC_NR && fs_m_in.m_type == PROC_EVENT)); + (src == PM_PROC_NR && is_notify(fs_m_in.m_type))); } diff --git a/servers/pm/main.c b/servers/pm/main.c index 586c21e4b..80de21707 100644 --- a/servers/pm/main.c +++ b/servers/pm/main.c @@ -67,19 +67,29 @@ PUBLIC int main() get_work(); /* wait for an PM system call */ /* Check for system notifications first. Special cases. */ + if (is_notify(call_nr)) { + switch(who_p) { + case CLOCK: + pm_expire_timers(m_in.NOTIFY_TIMESTAMP); + result = SUSPEND; /* don't reply */ + break; + case SYSTEM: /* signals pending */ + sigset = m_in.NOTIFY_ARG; + if (sigismember(&sigset, SIGKSIG)) { + (void) ksig_pending(); + } + result = SUSPEND; /* don't reply */ + break; + default : + result = ENOSYS; + } + + /* done, send reply and continue */ + goto send_reply; + } + switch(call_nr) { - case SYN_ALARM: - pm_expire_timers(m_in.NOTIFY_TIMESTAMP); - result = SUSPEND; /* don't reply */ - break; - case SYS_SIG: /* signals pending */ - sigset = m_in.NOTIFY_ARG; - if (sigismember(&sigset, SIGKSIG)) { - (void) ksig_pending(); - } - result = SUSPEND; /* don't reply */ - break; case PM_GET_WORK: if (who_e == FS_PROC_NR) { @@ -139,6 +149,7 @@ PUBLIC int main() break; } +send_reply: /* Send the results back to the user to indicate completion. */ if (result != SUSPEND) setreply(who_p, result); diff --git a/servers/rs/main.c b/servers/rs/main.c index 638065504..55d909d85 100644 --- a/servers/rs/main.c +++ b/servers/rs/main.c @@ -64,12 +64,12 @@ PUBLIC int main(void) /* Notification messages are control messages and do not need a reply. * These include heartbeat messages and system notifications. */ - if (m.m_type & NOTIFY_MESSAGE) { - switch (call_nr) { - case SYN_ALARM: + if (is_notify(m.m_type)) { + switch (who_p) { + case CLOCK: do_period(&m); /* check drivers status */ continue; - case PROC_EVENT: + case PM_PROC_NR: sig_handler(); continue; default: /* heartbeat notification */