Subject: Re: Undeclared BUFQ_INSERT_HEAD in pmax and amiga kernels
To: Simon Burge <simonb@NetBSD.ORG>
From: NetBSD Mailing list <netbsd@mrynet.com>
List: current-users
Date: 01/23/2000 19:03:38
> Simon Burge wrote:
> 
> > NetBSD Mailing list wrote:
> > 
> > > The following occurs in the pmax port when building the GENERIC kernel:
> > > 
> > > /usr/src/sys/arch/pmax/dev/tz.c
> > > 	cc1: warnings being treated as errors
> > > 	/usr/src/sys/arch/pmax/dev/tz.c: In function `tzprobe':
> > > 	/usr/src/sys/arch/pmax/dev/tz.c:231: warning: implicit declaration of function `BUFQ_INSERT_HEAD'
> > > 	*** Error code 1
> > > 
> > >  [[ ... ]]
> > > 
> > > The lack of a declaration anywhere suggests that the amiga port would be 
> > > exhibiting the same failure with fd.c.
> > 
> > Ahh, the wrath of the uncompiled commit!  BUFQ_INSERT_HEAD is defined
> > in <sys/queue.h>.  rz.c works because it includes <sys/disk.h> which
> > includes <sys/queue.h>.  I'll fix this in the next few minutes (when
> > my cvs update finishes) by adding <sys/queue.h> to includes for both,
> > although I can only test for pmax.
> 
...
> The following
> at least allows me to compile tz.c - I haven't finished building
> a complete kernel to see if it works yet.

> Index: buf.h
> ===================================================================
> RCS file: /cvsroot/syssrc/sys/sys/buf.h,v
> retrieving revision 1.36
> diff -p -u -r1.36 buf.h
> --- buf.h	2000/01/21 23:20:51	1.36
> +++ buf.h	2000/01/23 23:31:56
> @@ -107,6 +107,13 @@ do {									\
>  	(bufq)->bq_barrier = NULL;					\
>  } while (/*CONSTCOND*/0)
>  
> +#define	BUFQ_INSERT_HEAD(bufq, bp)					\
> +do {									\
> +	TAILQ_INSERT_HEAD(&(bufq)->bq_head, (bp), b_actq);		\
> +	if (((bp)->b_flags & B_ORDERED) != 0)				\
> +		(bufq)->bq_barrier = (bp);				\
> +} while (/*CONSTCOND*/0)
> +
>  #define	BUFQ_INSERT_TAIL(bufq, bp)					\
>  do {									\
>  	TAILQ_INSERT_TAIL(&(bufq)->bq_head, (bp), b_actq);		\


The patch worked fine here on pmax.  Thanks, Simon.

Regards,
-skots
--
Scott G. Akmentins-Taylor     InterNet: staylor@mrynet.com
MRY Systems			        staylor@mrynet.lv
    (Skots Gregorijs Akmentins-Teilors -- just call me "Skots")
		----- Labak miris neka sarkans -----