From c4b689f10af0284bf66260bcbee105712438abc0 Mon Sep 17 00:00:00 2001 From: Jeff Roberson Date: Wed, 8 May 2002 05:19:56 +0000 Subject: [PATCH] zapnot the signed bits in atomic_cmpset_32. Previously this did not work with negative values because the original value was sign extended but the compared value was not. --- sys/alpha/include/atomic.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/alpha/include/atomic.h b/sys/alpha/include/atomic.h index 889b7e24862..93cdbf6b16a 100644 --- a/sys/alpha/include/atomic.h +++ b/sys/alpha/include/atomic.h @@ -356,6 +356,7 @@ 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 */ + "zapnot %0,0xf,%0\n\t" /* Chop of signed bits */ "cmpeq %0, %2, %0\n\t" /* compare */ "beq %0, 2f\n\t" /* exit if not equal */ "mov %3, %0\n\t" /* value to store */ -- 2.45.2