diff options
| author | thorpej <thorpej@NetBSD.org> | 2000-03-23 07:01:25 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2000-03-23 07:01:25 +0000 |
| commit | fc96443d15841c054ada325a7591d905aade4ae2 (patch) | |
| tree | d86394c3673309d14fbe1847d8b277e71a9e05ee /sys/dev/sequencer.c | |
| parent | 7b918b40885e9e3be8055683d3749a90e5d131f9 (diff) | |
New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.
The old timeout()/untimeout() API has been removed from the kernel.
Diffstat (limited to 'sys/dev/sequencer.c')
| -rw-r--r-- | sys/dev/sequencer.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/sequencer.c b/sys/dev/sequencer.c index d0a9a6902c8..0ad2ef6a525 100644 --- a/sys/dev/sequencer.c +++ b/sys/dev/sequencer.c @@ -1,4 +1,4 @@ -/* $NetBSD: sequencer.c,v 1.14 1999/10/11 12:53:14 augustss Exp $ */ +/* $NetBSD: sequencer.c,v 1.15 2000/03/23 07:01:27 thorpej Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -151,6 +151,9 @@ void sequencerattach(n) int n; { + + for (n = 0; n < NSEQUENCER; n++) + callout_init(&seqdevs[n].sc_callout); } int @@ -315,7 +318,7 @@ sequencerclose(dev, flags, ifmt, p) seq_drain(sc); s = splaudio(); if (sc->timeout) { - untimeout(seq_timeout, sc); + callout_stop(&sc->sc_callout); sc->timeout = 0; } splx(s); @@ -891,7 +894,8 @@ seq_timer(sc, cmd, parm, b) } #endif sc->timeout = 1; - timeout(seq_timeout, sc, ticks); + callout_reset(&sc->sc_callout, ticks, + seq_timeout, sc); } #ifdef SEQUENCER_DEBUG else if (tick < 0) |
