summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1996-05-03 14:57:27 +0000
committerphk <phk@FreeBSD.org>1996-05-03 14:57:27 +0000
commit0e9ca345407e1cf074c1b9f705b0113449bf5315 (patch)
treeb13d0dfcde55a10a9fa26328d1206db32729183a /sys/dev
parent50f75723854dcb4ccc7c14b49e8717b10a29f99c (diff)
downloadFreeBSD-src-0e9ca345407e1cf074c1b9f705b0113449bf5315.zip
FreeBSD-src-0e9ca345407e1cf074c1b9f705b0113449bf5315.tar.gz
Move from the old buf.b_actf to the new TAILQ(buf.b_act).
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/fdc/fdc.c29
-rw-r--r--sys/dev/mcd/mcd.c16
-rw-r--r--sys/dev/scd/scd.c15
3 files changed, 27 insertions, 33 deletions
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index 10e38f9..5879733 100644
--- a/sys/dev/fdc/fdc.c
+++ b/sys/dev/fdc/fdc.c
@@ -43,7 +43,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fd.c,v 1.86 1996/04/07 17:32:12 bde Exp $
+ * $Id: fd.c,v 1.87 1996/04/08 19:40:56 smpatel Exp $
*
*/
@@ -581,6 +581,7 @@ fdattach(struct isa_device *dev)
fdc->state = DEVIDLE;
/* reset controller, turn motor off, clear fdout mirror reg */
outb(fdc->baseport + FDOUT, ((fdc->fdout = 0)));
+ TAILQ_INIT(&fdc->head);
/* check for each floppy drive */
for (fdup = isa_biotab_fdc; fdup->id_driver != 0; fdup++) {
@@ -1126,7 +1127,6 @@ fdclose(dev_t dev, int flags, int mode, struct proc *p)
void
fdstrategy(struct buf *bp)
{
- register struct buf *dp;
long nblocks, blknum;
int s;
fdcu_t fdcu;
@@ -1187,9 +1187,8 @@ fdstrategy(struct buf *bp)
}
bp->b_cylin = blknum / (fd->ft->sectrac * fd->ft->heads);
bp->b_pblkno = bp->b_blkno;
- dp = &(fdc->head);
s = splbio();
- disksort(dp, bp);
+ tqdisksort(&fdc->head, bp);
untimeout(fd_turnoff, (caddr_t)fdu); /* a good idea */
fdstart(fdcu);
splx(s);
@@ -1227,11 +1226,10 @@ fd_timeout(void *arg1)
fdcu_t fdcu = (fdcu_t)arg1;
fdu_t fdu = fdc_data[fdcu].fdu;
int baseport = fdc_data[fdcu].baseport;
- struct buf *dp, *bp;
+ struct buf *bp;
int s;
- dp = &fdc_data[fdcu].head;
- bp = dp->b_actf;
+ bp = TAILQ_FIRST(&fdc_data[fdcu].head);
/*
* Due to IBM's brain-dead design, the FDC has a faked ready
@@ -1314,14 +1312,12 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
unsigned long blknum;
fdu_t fdu = fdc->fdu;
fd_p fd;
- register struct buf *dp, *bp;
+ register struct buf *bp;
struct fd_formb *finfo = NULL;
size_t fdblk;
- dp = &(fdc->head);
- bp = dp->b_actf;
- if(!bp)
- {
+ bp = TAILQ_EMPTY(&fdc->head);
+ if(!bp) {
/***********************************************\
* nothing left for this controller to do *
* Force into the IDLE state, *
@@ -1619,7 +1615,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
/* ALL DONE */
fd->skip = 0;
bp->b_resid = 0;
- dp->b_actf = bp->b_actf;
+ TAILQ_REMOVE(&fdc->head, bp, b_act);
biodone(bp);
fdc->fd = (fd_p) 0;
fdc->fdu = -1;
@@ -1727,10 +1723,9 @@ retrier(fdcu)
fdcu_t fdcu;
{
fdc_p fdc = fdc_data + fdcu;
- register struct buf *dp, *bp;
+ register struct buf *bp;
- dp = &(fdc->head);
- bp = dp->b_actf;
+ bp = TAILQ_FIRST(&fdc->head);
if(fd_data[FDUNIT(minor(bp->b_dev))].options & FDOPT_NORETRY)
goto fail;
@@ -1774,7 +1769,7 @@ retrier(fdcu)
bp->b_flags |= B_ERROR;
bp->b_error = EIO;
bp->b_resid = bp->b_bcount - fdc->fd->skip;
- dp->b_actf = bp->b_actf;
+ TAILQ_REMOVE(&fdc->head, bp, b_act);
fdc->fd->skip = 0;
biodone(bp);
fdc->state = FINDWORK;
diff --git a/sys/dev/mcd/mcd.c b/sys/dev/mcd/mcd.c
index 903f5c7..355b911 100644
--- a/sys/dev/mcd/mcd.c
+++ b/sys/dev/mcd/mcd.c
@@ -40,7 +40,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: mcd.c,v 1.75 1996/03/28 14:28:45 scrappy Exp $
+ * $Id: mcd.c,v 1.76 1996/04/07 17:32:14 bde Exp $
*/
static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
@@ -66,6 +66,7 @@ static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
#include <sys/devfsext.h>
#endif /*DEVFS*/
+#include <machine/spl.h>
#include <machine/clock.h>
#include <i386/i386/cons.h>
@@ -157,7 +158,7 @@ static struct mcd_data {
short curr_mode;
struct mcd_read2 lastpb;
short debug;
- struct buf head; /* head of buf queue */
+ struct buf_queue_head head; /* head of buf queue */
struct mcd_mbx mbx;
#ifdef DEVFS
void *ra_devfs_token; /* store the devfs handle here */
@@ -427,7 +428,6 @@ void
mcdstrategy(struct buf *bp)
{
struct mcd_data *cd;
- struct buf *qp;
int s;
int unit = mcd_unit(bp->b_dev);
@@ -479,9 +479,8 @@ MCD_TRACE("strategy: drive not valid\n");
}
/* queue it */
- qp = &cd->head;
s = splbio();
- disksort(qp,bp);
+ tqdisksort(&cd->head, bp);
splx(s);
/* now check whether we can perform processing */
@@ -499,8 +498,8 @@ done:
static void mcd_start(int unit)
{
struct mcd_data *cd = mcd_data + unit;
- struct buf *bp, *qp = &cd->head;
struct partition *p;
+ struct buf *bp;
register s = splbio();
if (cd->flags & MCDMBXBSY) {
@@ -508,10 +507,11 @@ static void mcd_start(int unit)
return;
}
- if ((bp = qp->b_actf) != 0) {
+ bp = TAILQ_FIRST(&cd->head);
+ if (bp != 0) {
/* block found to process, dequeue */
/*MCD_TRACE("mcd_start: found block bp=0x%x\n",bp,0,0,0);*/
- qp->b_actf = bp->b_actf; /* changed from: bp->av_forw <se> */
+ TAILQ_REMOVE(&cd->head, bp, b_act);
splx(s);
} else {
/* nothing to do */
diff --git a/sys/dev/scd/scd.c b/sys/dev/scd/scd.c
index e8a6982..8532c66 100644
--- a/sys/dev/scd/scd.c
+++ b/sys/dev/scd/scd.c
@@ -41,7 +41,7 @@
*/
-/* $Id: scd.c,v 1.17 1996/01/15 10:28:32 phk Exp $ */
+/* $Id: scd.c,v 1.18 1996/03/28 14:28:50 scrappy Exp $ */
/* Please send any comments to micke@dynas.se */
@@ -142,7 +142,7 @@ static struct scd_data {
struct ioc_play_msf last_play;
short audio_status;
- struct buf head; /* head of buf queue */
+ struct buf_queue_head head; /* head of buf queue */
struct scd_mbx mbx;
#ifdef DEVFS
void *ra_devfs_token;
@@ -351,7 +351,6 @@ static void
scdstrategy(struct buf *bp)
{
struct scd_data *cd;
- struct buf *qp;
int s;
int unit = scd_unit(bp->b_dev);
@@ -396,9 +395,8 @@ scdstrategy(struct buf *bp)
bp->b_resid = 0;
/* queue it */
- qp = &cd->head;
s = splbio();
- disksort(qp,bp);
+ tqdisksort(&cd->head, bp);
splx(s);
/* now check whether we can perform processing */
@@ -417,7 +415,7 @@ static void
scd_start(int unit)
{
struct scd_data *cd = scd_data + unit;
- struct buf *bp, *qp = &cd->head;
+ struct buf *bp;
struct partition *p;
register s = splbio();
@@ -426,9 +424,10 @@ scd_start(int unit)
return;
}
- if ((bp = qp->b_actf) != 0) {
+ bp = TAILQ_FIRST(&cd->head);
+ if (bp != 0) {
/* block found to process, dequeue */
- qp->b_actf = bp->b_actf;
+ TAILQ_REMOVE(&cd->head, bp, b_act);
cd->flags |= SCDMBXBSY;
splx(s);
} else {
OpenPOWER on IntegriCloud