Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jan 1999 14:01:40 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        current@FreeBSD.ORG, dillon@apollo.backplane.com
Subject:   Re: Changing bzero, bcopy, memset, memcpy, etc... prototypes
Message-ID:  <199901280301.OAA25274@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>    I would like to propose changing the prototype for the kernel memory 
>    zeroing and copying routines.
>
>    Basically, the problem is that a whole hellofalot of drivers run
>    bzero and bcopy on volatile memory.  The only way to remove the
>    warnings is to volatilize bzero and bcopy.

No.  bzero() and bcopy() are for handling ordinary memory.  There is no
proper way to volatilize them without pessimizing them.  Adding volatile
to their prototypes won't actually make them handle volatile memory; it
just breaks the warnings.  Some of the i586-optimized versions in fact
don't handle volatile memory properly - they do things like reading some
locations twice to prefetch the cache lines.  Even ordinary bcopy() via
movsl accesses memory backwards in some cases.

Drivers should use the bus access macros.

Bruce

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?199901280301.OAA25274>