diff options
author | alc <alc@FreeBSD.org> | 1999-07-23 23:45:50 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 1999-07-23 23:45:50 +0000 |
commit | c9e1b9416b60e2e9e3dd7b383a46837c3736dd4a (patch) | |
tree | 04247262d3efa498d2cc5d67a1964ba8549f0fe8 /sys/amd64 | |
parent | 65200072445496b0e9fc1ccec1519a4eb8c1643a (diff) | |
download | FreeBSD-src-c9e1b9416b60e2e9e3dd7b383a46837c3736dd4a.zip FreeBSD-src-c9e1b9416b60e2e9e3dd7b383a46837c3736dd4a.tar.gz |
atomic.h:
Change "void *" to "volatile TYPE *", improving type safety
and eliminating some warnings (e.g., mp_machdep.c rev 1.106).
cpufunc.h:
Eliminate setbits. As defined, it's not precisely correct;
and it's redundant. (Use atomic_set_int instead.)
ipl_funcs.c:
Use atomic_set_int instead of setbits.
systm.h:
Include atomic.h.
Reviewed by: bde
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/include/atomic.h | 8 | ||||
-rw-r--r-- | sys/amd64/include/cpufunc.h | 13 |
2 files changed, 5 insertions, 16 deletions
diff --git a/sys/amd64/include/atomic.h b/sys/amd64/include/atomic.h index c8f65c6..d4e371b 100644 --- a/sys/amd64/include/atomic.h +++ b/sys/amd64/include/atomic.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: atomic.h,v 1.2 1999/07/13 03:32:17 alc Exp $ + * $Id: atomic.h,v 1.3 1999/07/13 06:35:25 alc Exp $ */ #ifndef _MACHINE_ATOMIC_H_ #define _MACHINE_ATOMIC_H_ @@ -68,11 +68,11 @@ */ #define ATOMIC_ASM(NAME, TYPE, OP, V) \ static __inline void \ -atomic_##NAME##_##TYPE(void *p, u_##TYPE v) \ +atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\ { \ __asm __volatile(MPLOCKED OP \ - : "=m" (*(u_##TYPE *)p) \ - : "0" (*(u_##TYPE *)p), "ir" (V)); \ + : "=m" (*p) \ + : "0" (*p), "ir" (V)); \ } ATOMIC_ASM(set, char, "orb %2,%0", v) diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 2733e72..c5ba2de 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cpufunc.h,v 1.86 1999/04/28 01:03:58 luoqi Exp $ + * $Id: cpufunc.h,v 1.87 1999/05/09 23:30:01 peter Exp $ */ /* @@ -399,16 +399,6 @@ rdtsc(void) } static __inline void -setbits(volatile u_int *addr, u_int bits) -{ - __asm __volatile( -#ifdef SMP - "lock; " -#endif - "orl %1,%0" : "=m" (*addr) : "ir" (bits)); -} - -static __inline void wbinvd(void) { __asm __volatile("wbinvd"); @@ -480,7 +470,6 @@ u_int64_t rdmsr __P((u_int msr)); u_int64_t rdpmc __P((u_int pmc)); u_int64_t rdtsc __P((void)); u_int read_eflags __P((void)); -void setbits __P((volatile u_int *addr, u_int bits)); void wbinvd __P((void)); void write_eflags __P((u_int ef)); void wrmsr __P((u_int msr, u_int64_t newval)); |