diff options
author | jhb <jhb@FreeBSD.org> | 2001-10-08 20:58:24 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-10-08 20:58:24 +0000 |
commit | ea70c6700861a03619a32c505dbcd8a2d0cba415 (patch) | |
tree | 7a930f31a6170373f1da0e34040e7441f9a58f59 /sys/amd64/include | |
parent | efbb61ecafa43ad7cd83ab2a86375b721536a2a9 (diff) | |
download | FreeBSD-src-ea70c6700861a03619a32c505dbcd8a2d0cba415.zip FreeBSD-src-ea70c6700861a03619a32c505dbcd8a2d0cba415.tar.gz |
Allow atomic ops to be somewhat safely used in userland. We always use
lock prefixes in the userland case so that the binaries will work on both
SMP and UP systems.
Diffstat (limited to 'sys/amd64/include')
-rw-r--r-- | sys/amd64/include/atomic.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/amd64/include/atomic.h b/sys/amd64/include/atomic.h index cb899a6..17ef468 100644 --- a/sys/amd64/include/atomic.h +++ b/sys/amd64/include/atomic.h @@ -75,15 +75,19 @@ void atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v); #else /* !KLD_MODULE */ -#if defined(SMP) +/* + * For userland, assume the SMP case and use lock prefixes so that + * the binaries will run on both types of systems. + */ +#if defined(SMP) || !defined(_KERNEL) #if defined(LOCORE) #define MPLOCKED lock ; #else /* !LOCORE */ #define MPLOCKED "lock ; " #endif /* LOCORE */ -#else /* !SMP */ +#else /* SMP || !_KERNEL */ #define MPLOCKED -#endif /* SMP */ +#endif /* SMP || !_KERNEL */ #if !defined(LOCORE) /* |