Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arc Use TAILQ_* macro.



details:   https://anonhg.NetBSD.org/src/rev/e429f06cdab9
branches:  trunk
changeset: 573217:e429f06cdab9
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Jan 22 11:08:18 2005 +0000

description:
Use TAILQ_* macro.

diffstat:

 sys/arch/arc/arc/bus_dma.c |  10 +++++-----
 sys/arch/arc/jazz/fd.c     |  17 +++++++++--------
 2 files changed, 14 insertions(+), 13 deletions(-)

diffs (109 lines):

diff -r 09d6545b9917 -r e429f06cdab9 sys/arch/arc/arc/bus_dma.c
--- a/sys/arch/arc/arc/bus_dma.c        Sat Jan 22 08:43:02 2005 +0000
+++ b/sys/arch/arc/arc/bus_dma.c        Sat Jan 22 11:08:18 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma.c,v 1.21 2005/01/22 07:44:08 tsutsui Exp $     */
+/*     $NetBSD: bus_dma.c,v 1.22 2005/01/22 11:08:18 tsutsui Exp $     */
 /*     NetBSD: bus_dma.c,v 1.20 2000/01/10 03:24:36 simonb Exp         */
 
 /*-
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.21 2005/01/22 07:44:08 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.22 2005/01/22 11:08:18 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -592,14 +592,14 @@
         * Compute the location, size, and number of segments actually
         * returned by the VM code.
         */
-       m = mlist.tqh_first;
+       m = TAILQ_FIRST(&mlist);
        curseg = 0;
        lastaddr = segs[curseg]._ds_paddr = VM_PAGE_TO_PHYS(m);
        segs[curseg].ds_addr = segs[curseg]._ds_paddr + t->dma_offset;
        segs[curseg].ds_len = PAGE_SIZE;
-       m = m->pageq.tqe_next;
+       m = TAILQ_NEXT(m, pageq);
 
-       for (; m != NULL; m = m->pageq.tqe_next) {
+       for (; m != NULL; m = TAILQ_NEXT(m, pageq)) {
                curaddr = VM_PAGE_TO_PHYS(m);
 #ifdef DIAGNOSTIC
                if (curaddr < avail_start || curaddr >= high) {
diff -r 09d6545b9917 -r e429f06cdab9 sys/arch/arc/jazz/fd.c
--- a/sys/arch/arc/jazz/fd.c    Sat Jan 22 08:43:02 2005 +0000
+++ b/sys/arch/arc/jazz/fd.c    Sat Jan 22 11:08:18 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fd.c,v 1.19 2005/01/22 07:35:34 tsutsui Exp $  */
+/*     $NetBSD: fd.c,v 1.20 2005/01/22 11:08:18 tsutsui Exp $  */
 /*     $OpenBSD: fd.c,v 1.6 1998/10/03 21:18:57 millert Exp $  */
 /*     NetBSD: fd.c,v 1.78 1995/07/04 07:23:09 mycroft Exp     */
 
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.19 2005/01/22 07:35:34 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.20 2005/01/22 11:08:18 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -489,7 +489,7 @@
 fdstart(struct fd_softc *fd)
 {
        struct fdc_softc *fdc = (void *)fd->sc_dev.dv_parent;
-       int active = fdc->sc_drives.tqh_first != 0;
+       int active = TAILQ_FIRST(&fdc->sc_drives) != 0;
 
        /* Link into controller queue. */
        fd->sc_active = 1;
@@ -549,7 +549,7 @@
        u_char status;
        int n;
 
-       if ((fd = fdc->sc_drives.tqh_first) != NULL)
+       if ((fd = TAILQ_FIRST(&fdc->sc_drives)) != NULL)
                status = fd->sc_drive;
        else
                status = 0;
@@ -582,7 +582,8 @@
 
        s = splbio();
        fd->sc_flags &= ~FD_MOTOR_WAIT;
-       if ((fdc->sc_drives.tqh_first == fd) && (fdc->sc_state == MOTORWAIT))
+       if ((TAILQ_FIRST(&fdc->sc_drives) == fd) &&
+           (fdc->sc_state == MOTORWAIT))
                (void) fdcintr(fdc);
        splx(s);
 }
@@ -725,7 +726,7 @@
 fdctimeout(void *arg)
 {
        struct fdc_softc *fdc = arg;
-       struct fd_softc *fd = fdc->sc_drives.tqh_first;
+       struct fd_softc *fd = TAILQ_FIRST(&fdc->sc_drives);
        int s;
 
        s = splbio();
@@ -769,7 +770,7 @@
 
 loop:
        /* Is there a drive for the controller to do a transfer with? */
-       fd = fdc->sc_drives.tqh_first;
+       fd = TAILQ_FIRST(&fdc->sc_drives);
        if (fd == NULL) {
                fdc->sc_state = DEVIDLE;
                return 1;
@@ -1024,7 +1025,7 @@
        struct buf *bp;
        char bits[64];
 
-       fd = fdc->sc_drives.tqh_first;
+       fd = TAILQ_FIRST(&fdc->sc_drives);
        bp = BUFQ_PEEK(&fd->sc_q);
 
        switch (fdc->sc_errors) {



Home | Main Index | Thread Index | Old Index