Date: Thu, 6 Sep 2001 19:14:04 -0700 (PDT) From: Julian Elischer <julian@elischer.org> To: John Baldwin <jhb@FreeBSD.org> Cc: Julian Elischer <julian@vicor-nb.com>, current@FreeBSD.org Subject: RE: RFC: hack volatile bzero and bcopy Message-ID: <Pine.BSF.4.21.0109061911410.24154-100000@InterJet.elischer.org> In-Reply-To: <XFMail.010906183557.jhb@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <jhb@FreeBSD.org> -- 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0109061911410.24154-100000>