From owner-freebsd-current Thu Sep 6 18:46:41 2001 Delivered-To: freebsd-current@freebsd.org Received: from InterJet.elischer.org (c421509-a.pinol1.sfba.home.com [24.7.86.9]) by hub.freebsd.org (Postfix) with ESMTP id DED7B37B407; Thu, 6 Sep 2001 18:46:33 -0700 (PDT) Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id TAA31446; Thu, 6 Sep 2001 19:14:05 -0700 (PDT) Date: Thu, 6 Sep 2001 19:14:04 -0700 (PDT) From: Julian Elischer To: John Baldwin Cc: Julian Elischer , current@FreeBSD.org Subject: RE: RFC: hack volatile bzero and bcopy In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Actually I just discoverd that you can do: int function (volatile const *); (I guess you say you will not writ eto it, but that it may change of its own volition at times) anyhow setting this in bcopy would remove a heck of a lot of warnings in the kernel. On Thu, 6 Sep 2001, John Baldwin wrote: > > On 07-Sep-01 Julian Elischer wrote: > > > > Here is a hack to remove the 20 or so warning messages from if_ie.c > > > > Most of them are due to the supply of volatile pointers to bcopy and > > bzero. > > > > I do the following to produce macros that call bzero and bcopy, but > > don't produce > > warning messages when called with volatile arguments. > > > > > > typedef void Xcopy( void volatile *, void volatile *, int); > >#define VBCOPY(A,B,L) (*(Xcopy *)&bcopy)((A),(B),(L)) > > typedef void Xzero( void volatile *, int); > >#define VBZERO(A,L) (*(Xzero *)&bzero)((A),(L)) > > sys/cdef.h already has some rather general purpose macros for thsi sort of > thing in the form of __DEVOLATILE(), __DECONST(), and __DEQUALIFY(). thanks, I'll go look at them. > > -- > > John Baldwin -- http://www.FreeBSD.org/~jhb/ > PGP Key: http://www.baldwin.cx/~john/pgpkey.asc > "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-current" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message