From owner-freebsd-current Thu Sep 6 18:36:12 2001 Delivered-To: freebsd-current@freebsd.org Received: from mail.wrs.com (unknown-1-11.windriver.com [147.11.1.11]) by hub.freebsd.org (Postfix) with ESMTP id 3886D37B403 for ; Thu, 6 Sep 2001 18:36:07 -0700 (PDT) Received: from laptop.baldwin.cx (john@[147.11.46.201]) by mail.wrs.com (8.9.3/8.9.1) with ESMTP id SAA01961; Thu, 6 Sep 2001 18:36:00 -0700 (PDT) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <3B981982.4E939CDF@vicor-nb.com> Date: Thu, 06 Sep 2001 18:35:57 -0700 (PDT) From: John Baldwin To: Julian Elischer Subject: RE: RFC: hack volatile bzero and bcopy Cc: current@FreeBSD.org 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 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(). -- 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