From owner-cvs-all Sat Jul 29 22: 6:35 2000 Delivered-To: cvs-all@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 6E14337B8F6; Sat, 29 Jul 2000 22:06:26 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.8.7/8.8.7) with ESMTP id PAA06549; Sun, 30 Jul 2000 15:05:51 +1000 Date: Sun, 30 Jul 2000 15:05:47 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Matthew Jacob Cc: Archie Cobbs , Peter Wemm , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/pci if_fxp.c In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, 29 Jul 2000, Matthew Jacob wrote: > Not a dumb question, but I'd suggest that bcopies from a volatile source at > leat should be discouraged. They are just broken, since bcopy() may do optimizations that aren't valid for volatile data. E.g., the i586 bcopy sometimes reads the source twice (to prefetch it the first time). The data may be copied out of order or written more than once. > On Sat, 29 Jul 2000, Archie Cobbs wrote: > > > Peter Wemm writes: > > > Log: > > > "Fix" cast qualifier warnings using the uintptr_t intermediate trick. This seems to just hide the problem in if_fxp.c. > > Dumb question. Why don't we just have a vbcopy()? I.e.: > > > > void vbcopy __P((const volatile void *from, volatile void *to, size_t len)); Most volatile memory is device memory so it should be copied using bus_space_{read,write}*. If you have volatile variables in a struct, then accessing the struct (or the variables) using bcopy is simplistic. The variables can normally only be accessed safely using atomic instructions or after acquiring a lock. If things are locked, then the variables aren't really volatile. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message