RX: No userspace atomic_ops in Solaris pre-10

The atomic_ops(3C) family of functions do not exist in userspace
before Solaris 10. So, only use them for rx_atomic operations if
we're on AFS_SUN510_ENV, or if we're in the kernel.

Also, include <sys/atomic.h> for kernel code and <atomic.h> for
userspace. Although they are currently equivalent, they are documented
as separate, and pre-10 lacks <atomic.h>.

Change-Id: Id71857efcd6460f8223302850b548754c19d076f
Reviewed-on: http://gerrit.openafs.org/3652
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Andrew Deason 2011-01-10 17:13:15 -06:00 committed by Derrick Brashear
parent 6edcb18304
commit fa3584a48f

View File

@ -137,9 +137,13 @@ typedef atomic_t rx_atomic_t;
#define rx_atomic_dec(X) atomic_dec(X) #define rx_atomic_dec(X) atomic_dec(X)
#define rx_atomic_sub(X, V) atomic_sub(V, X) #define rx_atomic_sub(X, V) atomic_sub(V, X)
#elif defined(AFS_SUN58_ENV) #elif defined(AFS_SUN510_ENV) || (defined(AFS_SUN58_ENV) && defined(KERNEL) && !defined(UKERNEL))
# if defined(KERNEL) && !defined(UKERNEL)
# include <sys/atomic.h>
# else
# include <atomic.h> # include <atomic.h>
# endif
typedef struct { typedef struct {
volatile unsigned int var; volatile unsigned int var;