From 7372c6cc432a5924f836ca67acc2b27d1e5953c9 Mon Sep 17 00:00:00 2001 From: "hp.com!davidm" Date: Fri, 14 Feb 2003 03:09:27 +0000 Subject: [PATCH] (unw_flush_cache): Only uses __sync_fetch_and_add() if HAVE_IA64INTRIN_H is defined. Otherwise, do non-atomic increment (and issue compile-time warning about it). (Logical change 1.46) --- src/ia64/flush_cache-ia64.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ia64/flush_cache-ia64.c b/src/ia64/flush_cache-ia64.c index 61bc8523..152a811e 100644 --- a/src/ia64/flush_cache-ia64.c +++ b/src/ia64/flush_cache-ia64.c @@ -1,5 +1,5 @@ /* libunwind - a platform-independent unwind library - Copyright (C) 2002 Hewlett-Packard Co + Copyright (C) 2002-2003 Hewlett-Packard Co Contributed by David Mosberger-Tang This file is part of libunwind. @@ -23,7 +23,9 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#ifdef HAVE_IA64INTRIN_H +# include +#endif #include "unwind_i.h" @@ -35,5 +37,10 @@ unw_flush_cache (unw_addr_space_t as, unw_word_t lo, unw_word_t hi) unw_flush_cache() is allowed to flush more than the requested range. */ +#ifdef HAVE_IA64INTRIN_H __sync_fetch_and_add(&as->cache_generation, 1); +#else +# warning unw_flush_cache(): need a way to atomically increment an integer. + ++as->cache_generation; +#endif }