summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev
diff options
context:
space:
mode:
authorHakan Olsson <ho@cvs.openbsd.org>2001-03-24 10:07:23 +0000
committerHakan Olsson <ho@cvs.openbsd.org>2001-03-24 10:07:23 +0000
commit6de216085ab8baff396ad6b8f06f42f2b1b48f84 (patch)
treeb6aafde7cc67d626e34bfbff22bebdea07ee3210 /sys/arch/sparc/dev
parentb4abc688700e5c5a9842fa842a03a43986a37ed6 (diff)
Convert to new timeout API. art@ ok.
Diffstat (limited to 'sys/arch/sparc/dev')
-rw-r--r--sys/arch/sparc/dev/if_ie.c8
-rw-r--r--sys/arch/sparc/dev/kbd.c12
-rw-r--r--sys/arch/sparc/dev/magma.c13
-rw-r--r--sys/arch/sparc/dev/magmareg.h7
-rw-r--r--sys/arch/sparc/dev/scf.c9
-rw-r--r--sys/arch/sparc/dev/xd.c8
-rw-r--r--sys/arch/sparc/dev/xdvar.h3
-rw-r--r--sys/arch/sparc/dev/xy.c8
-rw-r--r--sys/arch/sparc/dev/xyvar.h3
9 files changed, 46 insertions, 25 deletions
diff --git a/sys/arch/sparc/dev/if_ie.c b/sys/arch/sparc/dev/if_ie.c
index b166443f10d..8cb358ef6ae 100644
--- a/sys/arch/sparc/dev/if_ie.c
+++ b/sys/arch/sparc/dev/if_ie.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ie.c,v 1.13 2001/02/20 19:39:33 mickey Exp $ */
+/* $OpenBSD: if_ie.c,v 1.14 2001/03/24 10:07:18 ho Exp $ */
/* $NetBSD: if_ie.c,v 1.33 1997/07/29 17:55:38 fair Exp $ */
/*-
@@ -1584,6 +1584,7 @@ command_and_wait(sc, cmd, pcmd, mask)
volatile struct ie_cmd_common *cc = pcmd;
volatile struct ie_sys_ctl_block *scb = sc->scb;
volatile int timedout = 0;
+ struct timeout chan_tmo;
extern int hz;
scb->ie_command = (u_short)cmd;
@@ -1602,7 +1603,8 @@ command_and_wait(sc, cmd, pcmd, mask)
* According to the packet driver, the minimum timeout should
* be .369 seconds, which we round up to .4.
*/
- timeout(chan_attn_timeout, (caddr_t)&timedout, 2 * hz / 5);
+ timeout_set(&chan_tmo, chan_attn_timeout, (caddr_t)&timedout);
+ timeout_add(&chan_tmo, 2 * hz / 5);
/*
* Now spin-lock waiting for status. This is not a very nice
@@ -1615,7 +1617,7 @@ command_and_wait(sc, cmd, pcmd, mask)
if ((cc->ie_cmd_status & mask) || timedout)
break;
- untimeout(chan_attn_timeout, (caddr_t)&timedout);
+ timeout_del(&chan_tmo);
return timedout;
} else {
diff --git a/sys/arch/sparc/dev/kbd.c b/sys/arch/sparc/dev/kbd.c
index bf2ddb1b33f..a787fc69fa5 100644
--- a/sys/arch/sparc/dev/kbd.c
+++ b/sys/arch/sparc/dev/kbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kbd.c,v 1.11 1999/07/20 07:38:33 maja Exp $ */
+/* $OpenBSD: kbd.c,v 1.12 2001/03/24 10:07:19 ho Exp $ */
/* $NetBSD: kbd.c,v 1.28 1997/09/13 19:12:18 pk Exp $ */
/*
@@ -61,6 +61,7 @@
#include <sys/tty.h>
#include <sys/signalvar.h>
#include <sys/conf.h>
+#include <sys/timeout.h>
#include <machine/autoconf.h>
#include <machine/conf.h>
@@ -383,6 +384,7 @@ struct kbd_softc {
struct evvar k_events; /* event queue state */
int k_repeatc; /* repeated character */
int k_repeating; /* we've called timeout() */
+ struct timeout k_repeat_tmo; /* for kbd_repeat() timeouts */
} kbd_softc;
/* Prototypes */
@@ -471,6 +473,8 @@ kbdattach(kbd)
printf("kbd: type = %d, layout = 0x%x\n",
kbd_softc.k_state.kbd_id, kbd_softc.k_state.kbd_layout);
}
+
+ timeout_set(&k->k_repeat_tmo, kbd_repeat, k);
}
void
@@ -660,7 +664,7 @@ kbd_repeat(arg)
if (k->k_repeating && k->k_repeatc >= 0 && k->k_cons != NULL) {
ttyinput(k->k_repeatc, k->k_cons);
- timeout(kbd_repeat, k, kbd_repeat_step);
+ timeout_add(&k->k_repeat_tmo, kbd_repeat_step);
}
splx(s);
}
@@ -675,7 +679,7 @@ kbd_rint(c)
if (k->k_repeating) {
k->k_repeating = 0;
- untimeout(kbd_repeat, k);
+ timeout_del(&k->k_repeat_tmo);
}
/*
@@ -736,7 +740,7 @@ kbd_rint(c)
ttyinput(c, k->k_cons);
k->k_repeating = 1;
k->k_repeatc = c;
- timeout(kbd_repeat, k, kbd_repeat_start);
+ timeout_add(&k->k_repeat_tmo, kbd_repeat_start);
}
return;
}
diff --git a/sys/arch/sparc/dev/magma.c b/sys/arch/sparc/dev/magma.c
index b88584543a3..dca22b6734c 100644
--- a/sys/arch/sparc/dev/magma.c
+++ b/sys/arch/sparc/dev/magma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: magma.c,v 1.6 2000/07/05 13:13:20 art Exp $ */
+/* $OpenBSD: magma.c,v 1.7 2001/03/24 10:07:19 ho Exp $ */
/*
* magma.c
*
@@ -1409,6 +1409,9 @@ int port;
mp->mp_cd1190 = &sc->ms_cd1190[port];
else
mp->mp_cd1400 = &sc->ms_cd1400[0];
+
+ timeout_set(&mp->mp_timeout_tmo, mbpp_timeout, mp);
+ timeout_set(&mp->mp_start_tmo, mbpp_start, mp);
}
ms->ms_nports = port;
@@ -1598,7 +1601,7 @@ int gotdata = 0;
*/
if( mp->mp_timeout > 0 ) {
SET(mp->mp_flags, MBPPF_TIMEOUT);
- timeout(mbpp_timeout, mp, mp->mp_timeout);
+ timeout_add(&mp->mp_timeout_tmo, mp->mp_timeout);
}
len = cnt = 0;
@@ -1644,7 +1647,7 @@ again: /* goto bad */
if( mp->mp_delay > 0 ) {
s = spltty(); /* XXX */
SET(mp->mp_flags, MBPPF_DELAY);
- timeout(mbpp_start, mp, mp->mp_delay);
+ timeout_add(&mp->mp_start_tmo, mp->mp_delay);
error = tsleep(mp, PCATCH | PZERO, "mbppdelay", 0);
splx(s);
if( error ) break;
@@ -1666,11 +1669,11 @@ again: /* goto bad */
*/
s = spltty(); /* XXX */
if( ISSET(mp->mp_flags, MBPPF_TIMEOUT) ) {
- untimeout(mbpp_timeout, mp);
+ timeout_del(&mp->mp_timeout_tmo);
CLR(mp->mp_flags, MBPPF_TIMEOUT);
}
if( ISSET(mp->mp_flags, MBPPF_DELAY) ) {
- untimeout(mbpp_start, mp);
+ timeout_del(&mp->mp_start_tmo);
CLR(mp->mp_flags, MBPPF_DELAY);
}
splx(s);
diff --git a/sys/arch/sparc/dev/magmareg.h b/sys/arch/sparc/dev/magmareg.h
index 94d9d0a6ecb..4025e50a081 100644
--- a/sys/arch/sparc/dev/magmareg.h
+++ b/sys/arch/sparc/dev/magmareg.h
@@ -171,8 +171,11 @@ struct mbpp_port {
#define mp_timeout mp_param.bp_timeout
#define mp_delay mp_param.bp_delay
- u_char *mp_ptr; /* pointer to io data */
- int mp_cnt; /* count of io chars */
+ u_char *mp_ptr; /* pointer to io data */
+ int mp_cnt; /* count of io chars */
+
+ struct timeout mp_timeout_tmo; /* for mbpp_timeout() */
+ struct timeout mp_start_tmo; /* for mbpp_start() */
};
#define MBPPF_OPEN (1<<0)
diff --git a/sys/arch/sparc/dev/scf.c b/sys/arch/sparc/dev/scf.c
index 677839fb145..3955015fdfc 100644
--- a/sys/arch/sparc/dev/scf.c
+++ b/sys/arch/sparc/dev/scf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scf.c,v 1.2 1999/07/25 23:49:37 jason Exp $ */
+/* $OpenBSD: scf.c,v 1.3 2001/03/24 10:07:20 ho Exp $ */
/*
* Copyright (c) 1999 Jason L. Wright (jason@thought.net)
@@ -69,6 +69,7 @@ struct scf_softc {
struct scf_regs *sc_regs; /* our registers */
int sc_open;
int sc_tick;
+ struct timeout sc_blink_tmo; /* for scfblink() */
};
struct cfattach scf_ca = {
@@ -139,8 +140,10 @@ scfattach(parent, self, aux)
sc->sc_regs->led1 &= ~LED_MASK;
sc->sc_regs->ssldcr = 0;
- if (sparc_led_blink)
+ if (sparc_led_blink) {
+ timeout_set(&sc->sc_blink_tmo, scfblink, 0);
scfblink(0);
+ }
}
int
@@ -293,5 +296,5 @@ scfblink(v)
sc->sc_tick++;
s = ((averunnable.ldavg[0] + FSCALE) * hz) >> (FSHIFT + 1);
- timeout(scfblink, 0, s);
+ timeout_add(&sc->sc_blink_tmo, s);
}
diff --git a/sys/arch/sparc/dev/xd.c b/sys/arch/sparc/dev/xd.c
index 0e3f99c1629..4fdfda47c24 100644
--- a/sys/arch/sparc/dev/xd.c
+++ b/sys/arch/sparc/dev/xd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xd.c,v 1.17 2001/02/22 22:11:46 art Exp $ */
+/* $OpenBSD: xd.c,v 1.18 2001/03/24 10:07:20 ho Exp $ */
/* $NetBSD: xd.c,v 1.37 1997/07/29 09:58:16 fair Exp $ */
/*
@@ -74,6 +74,7 @@
#include <sys/syslog.h>
#include <sys/dkbad.h>
#include <sys/conf.h>
+#include <sys/timeout.h>
#include <vm/vm.h>
#include <vm/vm_kern.h>
@@ -509,7 +510,8 @@ xdcattach(parent, self, aux)
bootpath_store(1, NULL);
/* start the watchdog clock */
- timeout(xdc_tick, xdc, XDC_TICKCNT);
+ timeout_set(&xdc->xdc_tick_tmo, xdc_tick, xdc);
+ timeout_add(&xdc->xdc_tick_tmo, XDC_TICKCNT);
}
@@ -2156,7 +2158,7 @@ xdc_tick(arg)
/* until next time */
- timeout(xdc_tick, xdcsc, XDC_TICKCNT);
+ timeout_add(&xdcsc->xdc_tick_tmo, XDC_TICKCNT);
}
/*
diff --git a/sys/arch/sparc/dev/xdvar.h b/sys/arch/sparc/dev/xdvar.h
index c3e35672ba4..c1396427cab 100644
--- a/sys/arch/sparc/dev/xdvar.h
+++ b/sys/arch/sparc/dev/xdvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdvar.h,v 1.4 1997/08/08 08:25:37 downsj Exp $ */
+/* $OpenBSD: xdvar.h,v 1.5 2001/03/24 10:07:21 ho Exp $ */
/* $NetBSD: xdvar.h,v 1.5 1996/03/31 22:38:56 pk Exp $ */
/*
@@ -158,6 +158,7 @@ struct xdc_softc {
u_char ndone; /* number of done IORQs */
u_char waithead; /* head of queue */
u_char waitend; /* end of queue */
+ struct timeout xdc_tick_tmo; /* for xdc_tick() */
};
/*
diff --git a/sys/arch/sparc/dev/xy.c b/sys/arch/sparc/dev/xy.c
index f39044c9a06..9e58757870c 100644
--- a/sys/arch/sparc/dev/xy.c
+++ b/sys/arch/sparc/dev/xy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xy.c,v 1.14 2000/11/10 15:33:07 provos Exp $ */
+/* $OpenBSD: xy.c,v 1.15 2001/03/24 10:07:21 ho Exp $ */
/* $NetBSD: xy.c,v 1.26 1997/07/19 21:43:56 pk Exp $ */
/*
@@ -74,6 +74,7 @@
#include <sys/syslog.h>
#include <sys/dkbad.h>
#include <sys/conf.h>
+#include <sys/timeout.h>
#include <vm/vm.h>
#include <vm/vm_kern.h>
@@ -452,7 +453,8 @@ xycattach(parent, self, aux)
bootpath_store(1, NULL);
/* start the watchdog clock */
- timeout(xyc_tick, xyc, XYC_TICKCNT);
+ timeout_set(&xyc->xyc_tick_tmo, xyc_tick, xyc);
+ timeout_add(&xyc->xyc_tick_tmo, XYC_TICKCNT);
}
@@ -1971,7 +1973,7 @@ xyc_tick(arg)
/* until next time */
- timeout(xyc_tick, xycsc, XYC_TICKCNT);
+ timeout_add(&xycsc->xyc_tick_tmo, XYC_TICKCNT);
}
/*
diff --git a/sys/arch/sparc/dev/xyvar.h b/sys/arch/sparc/dev/xyvar.h
index f6f80cee49d..ee61acfaca7 100644
--- a/sys/arch/sparc/dev/xyvar.h
+++ b/sys/arch/sparc/dev/xyvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: xyvar.h,v 1.4 1997/08/08 08:25:41 downsj Exp $ */
+/* $OpenBSD: xyvar.h,v 1.5 2001/03/24 10:07:22 ho Exp $ */
/* $NetBSD: xyvar.h,v 1.4 1996/03/31 22:39:04 pk Exp $ */
/*
@@ -160,6 +160,7 @@ struct xyc_softc {
struct xy_iorq *xy_chain[XYC_MAXIOPB];
/* current chain */
int no_ols; /* disable overlap seek for stupid 450s */
+ struct timeout xyc_tick_tmo; /* for xyc_tick() */
};
/*