[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libunwind-devel] [PATCH 07/57] Remove unneeded `cmpxchg_ptr()' from inc
From: |
Tommi Rantala |
Subject: |
[Libunwind-devel] [PATCH 07/57] Remove unneeded `cmpxchg_ptr()' from include/libunwind_i.h |
Date: |
Fri, 21 Sep 2012 14:11:08 +0300 |
With the new `sos_alloc()' implementation in place, we no longer use
`cmpxchg_ptr()' anywhere.
---
include/libunwind_i.h | 31 -------------------------------
1 file changed, 31 deletions(-)
diff --git a/include/libunwind_i.h b/include/libunwind_i.h
index 15a7973..f015365 100644
--- a/include/libunwind_i.h
+++ b/include/libunwind_i.h
@@ -96,45 +96,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. */
#ifdef HAVE_ATOMIC_OPS_H
# include <atomic_ops.h>
-static inline int
-cmpxchg_ptr (void *addr, void *old, void *new)
-{
- union
- {
- void *vp;
- AO_t *aop;
- }
- u;
-
- u.vp = addr;
- return AO_compare_and_swap(u.aop, (AO_t) old, (AO_t) new);
-}
# define fetch_and_add1(_ptr) AO_fetch_and_add1(_ptr)
# define fetch_and_add(_ptr, value) AO_fetch_and_add(_ptr, value)
- /* GCC 3.2.0 on HP-UX crashes on cmpxchg_ptr() */
-# if !(defined(__hpux) && __GNUC__ == 3 && __GNUC_MINOR__ == 2)
-# define HAVE_CMPXCHG
-# endif
# define HAVE_FETCH_AND_ADD
#else
# ifdef HAVE_IA64INTRIN_H
# include <ia64intrin.h>
-static inline int
-cmpxchg_ptr (void *addr, void *old, void *new)
-{
- union
- {
- void *vp;
- long *vlp;
- }
- u;
-
- u.vp = addr;
- return __sync_bool_compare_and_swap(u.vlp, (long) old, (long) new);
-}
# define fetch_and_add1(_ptr) __sync_fetch_and_add(_ptr, 1)
# define fetch_and_add(_ptr, value) __sync_fetch_and_add(_ptr, value)
-# define HAVE_CMPXCHG
# define HAVE_FETCH_AND_ADD
# endif
#endif
--
1.7.9.5
- [Libunwind-devel] [PATCH 00/57] patchset v2, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 02/57] Remove unneeded `atomic_ops.h' inclusion in `dwarf.h', Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 03/57] Use GCC __BIGGEST_ALIGNMENT__ for sos-pool MAX_ALIGN, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 08/57] Use __sync builtin atomics on all architectures if available, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 01/57] Pull attribute macros from `libunwind_i.h' to new header `compiler.h', Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 07/57] Remove unneeded `cmpxchg_ptr()' from include/libunwind_i.h,
Tommi Rantala <=
- [Libunwind-devel] [PATCH 06/57] Simplify `sos_alloc()' implementation, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 04/57] Workaround non-power-of-two i386 sizeof(long double) in src/mi/mempool.c, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 15/57] HPPA: kludge out unused variable in unw_get_save_loc() stub, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 05/57] Align `sos_memory' to MAX_ALIGN, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 10/57] Apply UNW_ALIGN more in src/mi/mempool.c, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 13/57] PPC: remove unused `PAGE_START' macro from Ginit.c, Tommi Rantala, 2012/09/21