diff options
author | Vladislav Vaintroub <wlad@sun.com> | 2009-12-19 03:39:02 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@sun.com> | 2009-12-19 03:39:02 +0000 |
commit | 4f233c43b11b6f4f159350a192fa3fb3e3ce6c9a (patch) | |
tree | 4f8d7b78c02c5c326ca71cb845f759b66cab3723 | |
parent | 106bb1652ed8918ee580e0aa83d59bf46053f7e9 (diff) | |
download | mariadb-git-4f233c43b11b6f4f159350a192fa3fb3e3ce6c9a.tar.gz |
Fix missing 64 bit Solaris atomic prototypes
-rw-r--r-- | include/atomic/solaris.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/include/atomic/solaris.h b/include/atomic/solaris.h index 45efd9faaba..f8845a16bae 100644 --- a/include/atomic/solaris.h +++ b/include/atomic/solaris.h @@ -61,6 +61,18 @@ my_atomic_cas32(int32 volatile *a, int32 *cmp, int32 set) } STATIC_INLINE int +my_atomic_cas64(int64 volatile *a, int64 *cmp, int64 set) +{ + int ret; + int64 sav; + sav = (int64) atomic_cas_64((volatile uint64_t *)a, (uint64_t)*cmp, + (uint64_t)set); + if (! (ret = (sav == *cmp))) + *cmp = sav; + return ret; +} + +STATIC_INLINE int my_atomic_casptr(void * volatile *a, void **cmp, void *set) { int ret; @@ -97,6 +109,14 @@ my_atomic_add32(int32 volatile *a, int32 v) return (nv - v); } +STATIC_INLINE int64 +my_atomic_add64(int64 volatile *a, int64 v) +{ + int64 nv; + nv = atomic_add_64_nv((volatile uint64_t *)a, v); + return (nv - v); +} + /* ------------------------------------------------------------------------ */ #ifdef MY_ATOMIC_MODE_DUMMY @@ -110,6 +130,9 @@ my_atomic_load16(int16 volatile *a) { return (*a); } STATIC_INLINE int32 my_atomic_load32(int32 volatile *a) { return (*a); } +STATIC_INLINE int64 +my_atomic_load64(int64 volatile *a) { return (*a); } + STATIC_INLINE void * my_atomic_loadptr(void * volatile *a) { return (*a); } @@ -125,6 +148,9 @@ STATIC_INLINE void my_atomic_store32(int32 volatile *a, int32 v) { *a = v; } STATIC_INLINE void +my_atomic_store64(int64 volatile *a, int64 v) { *a = v; } + +STATIC_INLINE void my_atomic_storeptr(void * volatile *a, void *v) { *a = v; } /* ------------------------------------------------------------------------ */ @@ -149,6 +175,12 @@ my_atomic_load32(int32 volatile *a) return ((int32) atomic_or_32_nv((volatile uint32_t *)a, 0)); } +STATIC_INLINE int64 +my_atomic_load64(int64 volatile *a) +{ + return ((int64) atomic_or_64_nv((volatile uint64_t *)a, 0)); +} + STATIC_INLINE void * my_atomic_loadptr(void * volatile *a) { @@ -176,6 +208,12 @@ my_atomic_store32(int32 volatile *a, int32 v) } STATIC_INLINE void +my_atomic_store64(int64 volatile *a, int64 v) +{ + (void) atomic_swap_64((volatile uint64_t *)a, (uint64_t)v); +} + +STATIC_INLINE void my_atomic_storeptr(void * volatile *a, void *v) { (void) atomic_swap_ptr(a, v); @@ -203,6 +241,12 @@ my_atomic_fas32(int32 volatile *a, int32 v) return ((int32) atomic_swap_32((volatile uint32_t *)a, (uint32_t)v)); } +STATIC_INLINE int64 +my_atomic_fas64(int64 volatile *a, int64 v) +{ + return ((int64) atomic_swap_64((volatile uint64_t *)a, (uint64_t)v)); +} + STATIC_INLINE void * my_atomic_fasptr(void * volatile *a, void *v) { |