diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-04-11 17:03:03 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-04-11 17:03:03 +0000 |
commit | de26253715b91e7fd4a9854fe836baef86dbc7af (patch) | |
tree | fad01a7fbfc9ebc7121551e0d8877c3fed149011 /linuxthreads/sysdeps/alpha | |
parent | e7c036b39ef12abc7ff131982df75e3ec35c0f31 (diff) | |
download | glibc-de26253715b91e7fd4a9854fe836baef86dbc7af.tar glibc-de26253715b91e7fd4a9854fe836baef86dbc7af.tar.gz glibc-de26253715b91e7fd4a9854fe836baef86dbc7af.tar.bz2 glibc-de26253715b91e7fd4a9854fe836baef86dbc7af.zip |
Upadte.
2000-04-11 Ulrich Drepper <drepper@redhat.com>
* internals.h: Define MEMORY_BARRIER as empty if not defined already.
* spinlock.c (__pthread_lock): Add memory barriers.
(__pthread_unlock): Likewise.
* sysdeps/alpha/pt-machine.h (MEMORY_BARRIER): Define using mb
instruction.
(RELEASE): Not needed anymore.
(__compare_and_swap): Mark asm as modifying memory.
* sysdeps/powerpc/pt-machine.h (sync): Remove. Replace with definition
of MEMORY_BARRIER.
(__compare_and_swap): Use MEMORY_BARRIER instead of sync.
* sysdeps/sparc/sparc32/pt-machine.h (RELEASE): Not needed anymore.
(MEMORY_BARRIER): Define using stbar.
* sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Define using
stbar.
(__compare_and_swap): Use MEMORY_BARRIER to ensure ordering.
Patch by Xavier Leroy <Xavier.Leroy@inria.fr> based on comments by
Mike Burrows <m3b@pa.dec.com>.
Diffstat (limited to 'linuxthreads/sysdeps/alpha')
-rw-r--r-- | linuxthreads/sysdeps/alpha/pt-machine.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/linuxthreads/sysdeps/alpha/pt-machine.h b/linuxthreads/sysdeps/alpha/pt-machine.h index e59c6906c8..25ba634528 100644 --- a/linuxthreads/sysdeps/alpha/pt-machine.h +++ b/linuxthreads/sysdeps/alpha/pt-machine.h @@ -32,6 +32,10 @@ register char *stack_pointer __asm__("$30"); +/* Memory barrier; default is to do nothing */ +#define MEMORY_BARRIER() __asm__ __volatile__("mb" : : : "memory") + + /* Spinlock implementation; required. */ PT_EI long int testandset (int *spinlock) @@ -55,11 +59,6 @@ testandset (int *spinlock) return ret; } -/* Spinlock release; default is just set to zero. */ -#define RELEASE(spinlock) \ - __asm__ __volatile__("mb" : : : "memory"); \ - *spinlock = 0 - /* Begin allocating thread stacks at this address. Default is to allocate them just below the initial program stack. */ @@ -102,7 +101,8 @@ __compare_and_swap (long int *p, long int oldval, long int newval) "2:\tmb\n" "/* End compare & swap */" : "=&r"(ret), "=m"(*p) - : "r"(oldval), "r"(newval), "m"(*p)); + : "r"(oldval), "r"(newval), "m"(*p) + : "memory"); return ret; } |