diff options
author | John Baldwin <jhb@FreeBSD.org> | 2002-05-17 05:45:39 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2002-05-17 05:45:39 +0000 |
commit | ae3f633bae373644db1ecd18f88c2446274949e2 (patch) | |
tree | 5c09508581c4412c0cd99e0571cfa82cb5d21a49 /sys/alpha | |
parent | cf45dcc8e6021b24bbf1584358905d36fb59cd48 (diff) | |
download | src-ae3f633bae373644db1ecd18f88c2446274949e2.tar.gz src-ae3f633bae373644db1ecd18f88c2446274949e2.zip |
- Apparently, the Alpha ABI mandates that arguments be passed sign-extended
regardless of if they are signed or unsigned since it is easier to work
with sign-extended values. Thus, remove the disabled zapnot to
zero-extend the sign-extended value we read from *p in atomic_cmpset_32()
since the cmpval we are comparing against should already be
sign-extended.
- To ensure that the compiler knows to sign-extend the upper 32 bits of
cmpval rather than leaving garbage in there, cast the appropriately in
the constraints section.
Help from: Richard Henderson <rth@redhat.com>
Notes
Notes:
svn path=/head/; revision=96791
Diffstat (limited to 'sys/alpha')
-rw-r--r-- | sys/alpha/include/atomic.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/alpha/include/atomic.h b/sys/alpha/include/atomic.h index f5dd718d8661..af9c39714091 100644 --- a/sys/alpha/include/atomic.h +++ b/sys/alpha/include/atomic.h @@ -356,9 +356,6 @@ atomic_cmpset_32(volatile u_int32_t* p, u_int32_t cmpval, u_int32_t newval) __asm __volatile ( "1:\tldl_l %0, %4\n\t" /* load old value */ -#ifdef notyet - "zapnot %0,0xf,%0\n\t" /* Chop of signed bits */ -#endif "cmpeq %0, %2, %0\n\t" /* compare */ "beq %0, 2f\n\t" /* exit if not equal */ "mov %3, %0\n\t" /* value to store */ @@ -370,7 +367,7 @@ atomic_cmpset_32(volatile u_int32_t* p, u_int32_t cmpval, u_int32_t newval) "3:\tbr 1b\n" /* try again */ ".previous\n" : "=&r" (ret), "=m" (*p) - : "r" (cmpval), "r" (newval), "m" (*p) + : "r" ((long)(int)cmpval), "r" (newval), "m" (*p) : "memory"); return ret; |