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.
This commit is contained in:
John Baldwin 2001-10-08 20:58:24 +00:00
parent 275d9b59d3
commit 2a89a48fbd
2 changed files with 14 additions and 6 deletions

View File

@ -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)
/*

View File

@ -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)
/*