summaryrefslogtreecommitdiff
path: root/sys/arch/atari/dev
diff options
context:
space:
mode:
authoryamt <yamt@NetBSD.org>2005-10-15 17:29:10 +0000
committeryamt <yamt@NetBSD.org>2005-10-15 17:29:10 +0000
commitaec75b1cc6f7fcd41709ce0aa7e7ade322def5a3 (patch)
tree3d8326f9f2afd0eaa46aa8ff839b0971179ffb68 /sys/arch/atari/dev
parent9a9aac907941a0004579a71d85ffbe3d7c4c4b1c (diff)
- change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc, have a pointer to the former. - move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c. - rename method to strategy for consistency. - move some definitions which don't need to be exposed to the rest of kernel from sys/bufq.h to sys/bufq_impl.h. (is it better to move it to kern/ or somewhere?) - fix some obvious breakage in dev/qbus/ts.c. (not tested)
Diffstat (limited to 'sys/arch/atari/dev')
-rw-r--r--sys/arch/atari/dev/fd.c18
-rw-r--r--sys/arch/atari/dev/hdfd.c20
2 files changed, 19 insertions, 19 deletions
diff --git a/sys/arch/atari/dev/fd.c b/sys/arch/atari/dev/fd.c
index 582d80ca38b..91f937be135 100644
--- a/sys/arch/atari/dev/fd.c
+++ b/sys/arch/atari/dev/fd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fd.c,v 1.50 2005/06/04 14:42:36 he Exp $ */
+/* $NetBSD: fd.c,v 1.51 2005/10/15 17:29:10 yamt Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman.
@@ -49,7 +49,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.50 2005/06/04 14:42:36 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.51 2005/10/15 17:29:10 yamt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -136,7 +136,7 @@ static const char *fd_error= NULL; /* error from fd_xfer_ok() */
struct fd_softc {
struct device sc_dv; /* generic device info */
struct disk dkdev; /* generic disk info */
- struct bufq_state bufq; /* queue of buf's */
+ struct bufq_state *bufq; /* queue of buf's */
struct callout sc_motor_ch;
int unit; /* unit for atari controlling hw*/
int nheads; /* number of heads in use */
@@ -512,7 +512,7 @@ struct proc *proc;
type = FLP_TYPE(dev);
- bufq_alloc(&sc->bufq, BUFQ_DISKSORT|BUFQ_SORT_RAWBLOCK);
+ bufq_alloc(&sc->bufq, "disksort", BUFQ_SORT_RAWBLOCK);
sc->unit = DISKUNIT(dev);
sc->part = RAW_PART;
sc->nheads = fdtypes[type].nheads;
@@ -635,7 +635,7 @@ struct buf *bp;
* queue the buf and kick the low level code
*/
sps = splbio();
- BUFQ_PUT(&sc->bufq, bp); /* XXX disksort_cylinder */
+ BUFQ_PUT(sc->bufq, bp); /* XXX disksort_cylinder */
if (!lock_stat) {
if (fd_state & FLP_MON)
callout_stop(&sc->sc_motor_ch);
@@ -698,7 +698,7 @@ struct fd_softc *sc;
{
struct buf *bp;
- bp = BUFQ_PEEK(&sc->bufq);
+ bp = BUFQ_PEEK(sc->bufq);
sc->sector = bp->b_blkno; /* Start sector for I/O */
sc->io_data = bp->b_data; /* KVA base for I/O */
sc->io_bytes = bp->b_bcount; /* Transfer size in bytes */
@@ -736,7 +736,7 @@ register struct fd_softc *sc;
* Finish current transaction.
*/
sps = splbio();
- bp = BUFQ_GET(&sc->bufq);
+ bp = BUFQ_GET(sc->bufq);
if (bp == NULL)
panic("fddone");
splx(sps);
@@ -765,7 +765,7 @@ register struct fd_softc *sc;
i = 0;
if((sc1 = fd_cd.cd_devs[i]) == NULL)
continue;
- if (BUFQ_PEEK(&sc1->bufq) != NULL)
+ if (BUFQ_PEEK(sc1->bufq) != NULL)
break;
if(i == sc->unit) {
callout_reset(&sc->sc_motor_ch, FLP_MONDELAY,
@@ -1006,7 +1006,7 @@ struct fd_softc *sc;
return;
}
- bp = BUFQ_PEEK(&sc->bufq);
+ bp = BUFQ_PEEK(sc->bufq);
bp->b_error = EIO;
bp->b_flags |= B_ERROR;
diff --git a/sys/arch/atari/dev/hdfd.c b/sys/arch/atari/dev/hdfd.c
index 108ad69ddc8..c24a6e07b1d 100644
--- a/sys/arch/atari/dev/hdfd.c
+++ b/sys/arch/atari/dev/hdfd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hdfd.c,v 1.45 2005/06/04 14:42:36 he Exp $ */
+/* $NetBSD: hdfd.c,v 1.46 2005/10/15 17:29:10 yamt Exp $ */
/*-
* Copyright (c) 1996 Leo Weppelman
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdfd.c,v 1.45 2005/06/04 14:42:36 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdfd.c,v 1.46 2005/10/15 17:29:10 yamt Exp $");
#include "opt_ddb.h"
@@ -274,7 +274,7 @@ struct fd_softc {
TAILQ_ENTRY(fd_softc) sc_drivechain;
int sc_ops; /* I/O ops since last switch */
- struct bufq_state sc_q; /* pending I/O requests */
+ struct bufq_state *sc_q; /* pending I/O requests */
int sc_active; /* number of active I/O operations */
};
@@ -537,7 +537,7 @@ fdattach(parent, self, aux)
else
printf(": density unknown\n");
- bufq_alloc(&fd->sc_q, BUFQ_DISKSORT|BUFQ_SORT_CYLINDER);
+ bufq_alloc(&fd->sc_q, "disksort", BUFQ_SORT_CYLINDER);
fd->sc_cylin = -1;
fd->sc_drive = drive;
fd->sc_deftype = type;
@@ -650,7 +650,7 @@ fdstrategy(bp)
/* Queue transfer on drive, activate drive and controller if idle. */
s = splbio();
- BUFQ_PUT(&fd->sc_q, bp);
+ BUFQ_PUT(fd->sc_q, bp);
callout_stop(&fd->sc_motoroff_ch); /* a good idea */
if (fd->sc_active == 0)
fdstart(fd);
@@ -703,11 +703,11 @@ fdfinish(fd, bp)
* another drive is waiting to be serviced, since there is a long motor
* startup delay whenever we switch.
*/
- (void)BUFQ_GET(&fd->sc_q);
+ (void)BUFQ_GET(fd->sc_q);
if (fd->sc_drivechain.tqe_next && ++fd->sc_ops >= 8) {
fd->sc_ops = 0;
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
- if (BUFQ_PEEK(&fd->sc_q) != NULL)
+ if (BUFQ_PEEK(fd->sc_q) != NULL)
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
else
fd->sc_active = 0;
@@ -945,7 +945,7 @@ fdctimeout(arg)
s = splbio();
fdcstatus(&fd->sc_dev, 0, "timeout");
- if (BUFQ_PEEK(&fd->sc_q) != NULL)
+ if (BUFQ_PEEK(fd->sc_q) != NULL)
fdc->sc_state++;
else
fdc->sc_state = DEVIDLE;
@@ -990,7 +990,7 @@ loop:
}
/* Is there a transfer to this drive? If not, deactivate drive. */
- bp = BUFQ_PEEK(&fd->sc_q);
+ bp = BUFQ_PEEK(fd->sc_q);
if (bp == NULL) {
fd->sc_ops = 0;
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
@@ -1280,7 +1280,7 @@ fdcretry(fdc)
struct buf *bp;
fd = fdc->sc_drives.tqh_first;
- bp = BUFQ_PEEK(&fd->sc_q);
+ bp = BUFQ_PEEK(fd->sc_q);
if (fd->sc_opts & FDOPT_NORETRY)
goto fail;