diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-08-04 03:26:15 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-08-04 03:26:15 +0000 |
commit | c38f9b5354e77fd43d369da905bc0d18753dd743 (patch) | |
tree | 48fbfdc7d7a95b3d57c29b83bd75b07238e29d85 /boehm-gc | |
parent | 36ac427b08f326f2df8122794e47b7d7e8233aee (diff) | |
download | gcc-c38f9b5354e77fd43d369da905bc0d18753dd743.tar.gz |
* gc_priv.h (GC_test_and_set): Implementation for Linux PPC from
Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28480 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'boehm-gc')
-rw-r--r-- | boehm-gc/ChangeLog | 5 | ||||
-rw-r--r-- | boehm-gc/gc_priv.h | 23 |
2 files changed, 28 insertions, 0 deletions
diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index ba41a45dcf3..1ddff1cf906 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,8 @@ +1999-08-03 Tom Tromey <tromey@cygnus.com> + + * gc_priv.h (GC_test_and_set): Implementation for Linux PPC from + Franz Sirl <Franz.Sirl-kernel@lauterbach.com>. + 1999-08-02 Tom Tromey <tromey@cygnus.com> * aclocal.m4, configure: Rebuilt for new libtool. diff --git a/boehm-gc/gc_priv.h b/boehm-gc/gc_priv.h index cc8b1476ddc..29035336f62 100644 --- a/boehm-gc/gc_priv.h +++ b/boehm-gc/gc_priv.h @@ -465,6 +465,29 @@ void GC_print_callers (/* struct callinfo info[NFRAMES] */); __asm__ __volatile__("mb": : :"memory"); *(addr) = 0; } +# elif defined(__powerpc__) + inline static int GC_test_and_set(volatile unsigned int *addr) { + int ret, oldval=0, newval=1; + + __asm__ __volatile__("sync" : : : "memory"); + __asm__ __volatile__( + "0: lwarx %0,0,%1 ;" + " xor. %0,%3,%0;" + " bne 1f;" + " stwcx. %2,0,%1;" + " bne- 0b;" + "1: " + : "=&r"(ret) + : "r"(addr), "r"(newval), "r"(oldval) + : "cr0", "memory"); + __asm__ __volatile__("sync" : : : "memory"); + return ret == 0; + } + inline static void GC_clear(volatile unsigned int *addr) { + __asm__ __volatile__("sync": : :"memory"); + *(addr) = 0; + } + # else -- > Need implementation of GC_test_and_set() # endif |