From: Jorrit Herder Date: Fri, 29 Jul 2005 15:00:22 +0000 (+0000) Subject: Updated drivers according to syslib interface changes. X-Git-Tag: v3.1.0~496 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/Bv9ARM.ch09.html?a=commitdiff_plain;h=aec394a330aa5151850e02f374c6f5b53c93b408;p=minix.git Updated drivers according to syslib interface changes. --- diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index 479037539..1e32d32cb 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -696,7 +696,7 @@ struct command *cmd; /* Command block */ * controller was not able to execute the command. Leftover timeouts are * simply ignored by the main loop. */ - sys_syncalrm(SELF, wakeup_ticks, 0); + sys_setalarm(wakeup_ticks, 0); w_status = STATUS_ADMBSY; w_command = cmd->command; @@ -1114,7 +1114,7 @@ unsigned cnt; * controller was not able to execute the command. Leftover timeouts are * simply ignored by the main loop. */ - sys_syncalrm(SELF, wakeup_ticks, 0); + sys_setalarm(wakeup_ticks, 0); #if _WORD_SIZE > 2 if (cnt > 0xFFFE) cnt = 0xFFFE; /* Max data per interrupt. */ diff --git a/drivers/floppy/floppy.c b/drivers/floppy/floppy.c index eb6b83992..829d0317d 100644 --- a/drivers/floppy/floppy.c +++ b/drivers/floppy/floppy.c @@ -339,7 +339,7 @@ PRIVATE void f_expire_tmrs(struct driver *dp, message *m_ptr) f_next_timeout = TMR_NEVER; } else { /* set new sync alarm */ f_next_timeout = f_timers->tmr_exp_time; - if ((s=sys_syncalrm(SELF, f_next_timeout, 1)) != OK) + if ((s=sys_setalarm(f_next_timeout, 1)) != OK) panic("FLOPPY","Couldn't set synchronous alarm.", s); } } @@ -368,7 +368,7 @@ tmr_func_t watchdog; /* watchdog function to be called */ */ if (f_timers->tmr_exp_time != f_next_timeout) { f_next_timeout = f_timers->tmr_exp_time; - if ((s=sys_syncalrm(SELF, f_next_timeout, 1)) != OK) + if ((s=sys_setalarm(f_next_timeout, 1)) != OK) panic("FLOPPY","Couldn't set synchronous alarm.", s); } } diff --git a/drivers/fxp/fxp.c b/drivers/fxp/fxp.c index bf411560c..3e46c7d1d 100644 --- a/drivers/fxp/fxp.c +++ b/drivers/fxp/fxp.c @@ -2385,9 +2385,9 @@ tmr_func_t watchdog; /* watchdog function to be called */ fxp_timers->tmr_exp_time < fxp_next_timeout) { fxp_next_timeout= fxp_timers->tmr_exp_time; - printf("fxp_set_timer: calling sys_syncalrm for %d (now+%d)\n", + printf("fxp_set_timer: calling sys_setalarm for %d (now+%d)\n", fxp_next_timeout, fxp_next_timeout-now); - r= sys_syncalrm(SELF, fxp_next_timeout, 1); + r= sys_setalarm(fxp_next_timeout, 1); if (r != OK) panic("FXP","unable to set synchronous alarm", r); } @@ -2420,7 +2420,7 @@ PRIVATE void fxp_expire_timers() else { /* set new alarm */ fxp_next_timeout = fxp_timers->tmr_exp_time; - r= sys_syncalrm(SELF, fxp_next_timeout, 1); + r= sys_setalarm(fxp_next_timeout, 1); if (r != OK) panic("FXP","Unable to set synchronous alarm.", r); } diff --git a/drivers/log/log.c b/drivers/log/log.c index fb890af90..9052c5159 100644 --- a/drivers/log/log.c +++ b/drivers/log/log.c @@ -137,7 +137,7 @@ subwrite(struct logdevice *log, int count, int proc_nr, vir_bytes user_vir) log->log_status = subread(log, log->log_iosize, log->log_proc_nr, log->log_user_vir); printf("alert for revive %d..\n", log->log_source); - alert(log->log_source); + notify(log->log_source); printf("alert for revive done..\n"); log->log_revive_alerted = 1; } @@ -153,7 +153,7 @@ subwrite(struct logdevice *log, int count, int proc_nr, vir_bytes user_vir) * swallow all the data (log_size > 0). */ if(log->log_selected & SEL_RD) { - alert(log->log_select_proc); + notify(log->log_select_proc); log->log_select_alerted = 1; #if LOG_DEBUG printf("log notified %d\n", log->log_select_proc); diff --git a/drivers/memory/memory.c b/drivers/memory/memory.c index 98f1b1317..fd6f0073a 100644 --- a/drivers/memory/memory.c +++ b/drivers/memory/memory.c @@ -396,8 +396,8 @@ message *m_ptr; /* pointer to alarm message */ } /* Schedule new alarm for next m_random call. */ - if (OK != (s=sys_syncalrm(SELF, KRANDOM_PERIOD, 0))) - report("MEM", "sys_syncalarm failed", s); + if (OK != (s=sys_setalarm(KRANDOM_PERIOD, 0))) + report("MEM", "sys_setalarm failed", s); } /*============================================================================* diff --git a/drivers/printer/printer.c b/drivers/printer/printer.c index 81b0538dd..9d570f478 100644 --- a/drivers/printer/printer.c +++ b/drivers/printer/printer.c @@ -258,7 +258,7 @@ PRIVATE void output_done() #else revive_pending = TRUE; revive_status = status; - alert(caller); + notify(caller); #endif } diff --git a/drivers/rtl8139/rtl8139.c b/drivers/rtl8139/rtl8139.c index 337bda7d7..1616bd26e 100755 --- a/drivers/rtl8139/rtl8139.c +++ b/drivers/rtl8139/rtl8139.c @@ -459,7 +459,7 @@ message *mp; tmra_inittimer(&rl_watchdog); /* Use a synchronous alarm instead of a watchdog timer. */ - sys_syncalrm(SELF, HZ, 0); + sys_setalarm(HZ, 0); } port = mp->DL_PORT; @@ -2352,7 +2352,7 @@ timer_t *tp; int i; re_t *rep; /* Use a synchronous alarm instead of a watchdog timer. */ - sys_setalarm(SELF, HZ, 0); + sys_setalarm(HZ, 0); for (i= 0, rep = &re_table[0]; itmr_exp_time != tty_next_timeout) { tty_next_timeout = tty_timers->tmr_exp_time; - if ((s=sys_syncalrm(SELF, tty_next_timeout, 1)) != OK) - panic("TTY","Console couldn't set syn alarm.", s); + if ((s=sys_setalarm(tty_next_timeout, 1)) != OK) + panic("TTY","Console couldn't set alarm.", s); } } diff --git a/drivers/tty/keyboard.c b/drivers/tty/keyboard.c index 215ffa32d..4b8485018 100644 --- a/drivers/tty/keyboard.c +++ b/drivers/tty/keyboard.c @@ -539,7 +539,7 @@ 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; - alert(proc_nr); + notify(proc_nr); } return(TRUE); } diff --git a/drivers/tty/tty.c b/drivers/tty/tty.c index 26dcbad7b..3998c4e5b 100644 --- a/drivers/tty/tty.c +++ b/drivers/tty/tty.c @@ -213,12 +213,10 @@ PUBLIC void main(void) if (sigismember(&sigset, SIGKSTOP)) { cons_stop(); /* switch to primary console */ -#if DEAD_CODE if (irq_hook_id != -1) { sys_irqdisable(&irq_hook_id); sys_irqrmpolicy(KEYBOARD_IRQ, &irq_hook_id); } -#endif } if (sigismember(&sigset, SIGTERM)) cons_stop(); if (sigismember(&sigset, SIGKMESS)) do_new_kmess(&tty_mess); @@ -847,7 +845,7 @@ PUBLIC int select_retry(struct tty *tp) } #else if (select_try(tp, tp->tty_select_ops)) - alert(tp->tty_select_proc); + notify(tp->tty_select_proc); #endif return OK; @@ -896,7 +894,7 @@ tty_t *tp; /* TTY to check for events. */ if (tp->tty_incum >= tp->tty_min && tp->tty_inleft > 0) { #if NEW_REVIVE if (tp->tty_inrepcode == REVIVE) { - alert(tp->tty_incaller); + notify(tp->tty_incaller); tp->tty_inrevived = 1; } else { tty_reply(tp->tty_inrepcode, tp->tty_incaller, @@ -973,7 +971,7 @@ register tty_t *tp; /* pointer to terminal to read from */ if (tp->tty_inleft == 0) { #if NEW_REVIVE if (tp->tty_inrepcode == REVIVE) { - alert(tp->tty_incaller); + notify(tp->tty_incaller); tp->tty_inrevived = 1; } else { tty_reply(tp->tty_inrepcode, tp->tty_incaller, @@ -1605,7 +1603,7 @@ PRIVATE void expire_timers(void) if (tty_timers == NULL) tty_next_timeout = TMR_NEVER; else { /* set new sync alarm */ tty_next_timeout = tty_timers->tmr_exp_time; - if ((s=sys_syncalrm(SELF, tty_next_timeout, 1)) != OK) + if ((s=sys_setalarm(tty_next_timeout, 1)) != OK) panic("TTY","Couldn't set synchronous alarm.", s); } } @@ -1641,7 +1639,7 @@ int enable; /* set timer if true, otherwise unset */ if (tty_timers == NULL) tty_next_timeout = TMR_NEVER; else if (tty_timers->tmr_exp_time != tty_next_timeout) { tty_next_timeout = tty_timers->tmr_exp_time; - if ((s=sys_syncalrm(SELF, tty_next_timeout, 1)) != OK) + if ((s=sys_setalarm(tty_next_timeout, 1)) != OK) panic("TTY","Couldn't set synchronous alarm.", s); } }