From owner-p4-projects@FreeBSD.ORG Thu Mar 31 16:26:48 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C8ABB16A4D0; Thu, 31 Mar 2005 16:26:47 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A1D7B16A4CE for ; Thu, 31 Mar 2005 16:26:47 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6EA5E43D4C for ; Thu, 31 Mar 2005 16:26:47 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j2VGQllS041946 for ; Thu, 31 Mar 2005 16:26:47 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j2VGQl6t041943 for perforce@freebsd.org; Thu, 31 Mar 2005 16:26:47 GMT (envelope-from jhb@freebsd.org) Date: Thu, 31 Mar 2005 16:26:47 GMT Message-Id: <200503311626.j2VGQl6t041943@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 74188 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2005 16:26:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=74188 Change 74188 by jhb@jhb_slimer on 2005/03/31 16:26:25 Put back some memory clobbers to narrow down why I now get panics. Still have a few more archs to go. Affected files ... .. //depot/projects/smpng/sys/alpha/include/atomic.h#19 edit .. //depot/projects/smpng/sys/amd64/include/atomic.h#13 edit .. //depot/projects/smpng/sys/arm/include/atomic.h#8 edit .. //depot/projects/smpng/sys/i386/include/atomic.h#29 edit Differences ... ==== //depot/projects/smpng/sys/alpha/include/atomic.h#19 (text+ko) ==== @@ -61,7 +61,8 @@ "stl_c %0, %1\n\t" /* attempt to store */ "beq %0, 1b\n" /* spin if failed */ : "=&r" (temp), "=m" (*p) - : "r" (v), "m" (*p)); + : "r" (v), "m" (*p) + : "memory"); #endif } @@ -76,7 +77,8 @@ "stl_c %0, %1\n\t" /* attempt to store */ "beq %0, 1b\n" /* spin if failed */ : "=&r" (temp), "=m" (*p) - : "r" (v), "m" (*p)); + : "r" (v), "m" (*p) + : "memory"); #endif } @@ -91,7 +93,8 @@ "stl_c %0, %1\n\t" /* attempt to store */ "beq %0, 1b\n" /* spin if failed */ : "=&r" (temp), "=m" (*p) - : "r" (v), "m" (*p)); + : "r" (v), "m" (*p) + : "memory"); #endif } @@ -106,7 +109,8 @@ "stl_c %0, %1\n\t" /* attempt to store */ "beq %0, 1b\n" /* spin if failed */ : "=&r" (temp), "=m" (*p) - : "r" (v), "m" (*p)); + : "r" (v), "m" (*p) + : "memory"); #endif } @@ -122,7 +126,8 @@ "stl_c %1,%2\n\t" /* attempt to store */ "beq %1,1b\n" /* if the store failed, spin */ : "=&r"(result), "=&r"(temp), "=m" (*addr) - : "m" (*addr)); + : "m" (*addr) + : "memory"); #endif return result; @@ -139,7 +144,8 @@ "stq_c %0, %1\n\t" /* attempt to store */ "beq %0, 1b\n" /* spin if failed */ : "=&r" (temp), "=m" (*p) - : "r" (v), "m" (*p)); + : "r" (v), "m" (*p) + : "memory"); #endif } @@ -154,7 +160,8 @@ "stq_c %0, %1\n\t" /* attempt to store */ "beq %0, 1b\n" /* spin if failed */ : "=&r" (temp), "=m" (*p) - : "r" (v), "m" (*p)); + : "r" (v), "m" (*p) + : "memory"); #endif } @@ -169,7 +176,8 @@ "stq_c %0, %1\n\t" /* attempt to store */ "beq %0, 1b\n" /* spin if failed */ : "=&r" (temp), "=m" (*p) - : "r" (v), "m" (*p)); + : "r" (v), "m" (*p) + : "memory"); #endif } @@ -184,7 +192,8 @@ "stq_c %0, %1\n\t" /* attempt to store */ "beq %0, 1b\n" /* spin if failed */ : "=&r" (temp), "=m" (*p) - : "r" (v), "m" (*p)); + : "r" (v), "m" (*p) + : "memory"); #endif } @@ -200,7 +209,8 @@ "stq_c %1,%2\n\t" /* attempt to store */ "beq %1,1b\n" /* if the store failed, spin */ : "=&r"(result), "=&r"(temp), "+m" (*addr) - : "m" (*addr)); + : "m" (*addr) + : "memory"); #endif return result; @@ -264,8 +274,6 @@ *p = v; \ } -ATOMIC_STORE_LOAD(8) -ATOMIC_STORE_LOAD(16) ATOMIC_STORE_LOAD(32) ATOMIC_STORE_LOAD(64) @@ -291,7 +299,8 @@ "beq %0, 1b\n\t" /* if it failed, spin */ "2:\n" : "=&r" (ret), "=m" (*p) - : "r" ((long)(int)cmpval), "r" (newval), "m" (*p)); + : "r" ((long)(int)cmpval), "r" (newval), "m" (*p) + : "memory"); #endif return ret; @@ -317,7 +326,8 @@ "beq %0, 1b\n\t" /* if it failed, spin */ "2:\n" : "=&r" (ret), "=m" (*p) - : "r" (cmpval), "r" (newval), "m" (*p)); + : "r" (cmpval), "r" (newval), "m" (*p) + : "memory"); #endif return ret; @@ -372,8 +382,6 @@ #define atomic_subtract_char atomic_subtract_8 #define atomic_subtract_acq_char atomic_subtract_acq_8 #define atomic_subtract_rel_char atomic_subtract_rel_8 -#define atomic_load_acq_char atomic_load_acq_8 -#define atomic_store_rel_char atomic_store_rel_8 /* Operations on shorts. */ #define atomic_set_short atomic_set_16 @@ -388,8 +396,6 @@ #define atomic_subtract_short atomic_subtract_16 #define atomic_subtract_acq_short atomic_subtract_acq_16 #define atomic_subtract_rel_short atomic_subtract_rel_16 -#define atomic_load_acq_short atomic_load_acq_16 -#define atomic_store_rel_short atomic_store_rel_16 /* Operations on ints. */ #define atomic_set_int atomic_set_32 ==== //depot/projects/smpng/sys/amd64/include/atomic.h#13 (text+ko) ==== @@ -160,7 +160,8 @@ : "+a" (res), /* 0 (result) */ "=m" (*dst) /* 1 */ : "r" (src), /* 2 */ - "m" (*dst)); /* 3 */ + "m" (*dst) /* 3 */ + : "memory"); return (res); } @@ -180,7 +181,8 @@ : "+a" (res), /* 0 (result) */ "=m" (*dst) /* 1 */ : "r" (src), /* 2 */ - "m" (*dst)); /* 3 */ + "m" (*dst) /* 3 */ + : "memory"); return (res); } ==== //depot/projects/smpng/sys/arm/include/atomic.h#8 (text+ko) ==== @@ -75,7 +75,9 @@ __swp(uint32_t val, volatile uint32_t *ptr) { __asm __volatile("swp %0, %2, [%3]" - : "=&r" (val), "=m" (*ptr) : "r" (val) , "r" (ptr), "m" (*ptr)); + : "=&r" (val), "=m" (*ptr) + : "r" (val) , "r" (ptr), "m" (*ptr) + : "memory"); return (val); } ==== //depot/projects/smpng/sys/i386/include/atomic.h#29 (text+ko) ==== @@ -143,7 +143,8 @@ : "+a" (res), /* 0 (result) */ "=m" (*dst) /* 1 */ : "r" (src), /* 2 */ - "m" (*dst)); /* 3 */ + "m" (*dst) /* 3 */ + : "memory"); return (res); } @@ -165,7 +166,8 @@ : "+a" (res), /* 0 (result) */ "=m" (*dst) /* 1 */ : "r" (src), /* 2 */ - "m" (*dst)); /* 3 */ + "m" (*dst) /* 3 */ + : "memory"); return (res); } @@ -294,15 +296,7 @@ ATOMIC_ACQ(add, int); ATOMIC_ACQ(subtract, int); -static __inline int -atomic_cmpset_acq_int(volatile u_int *dst, u_int exp, u_int src) -{ - int retval; - - retval = atomic_cmpset_int(dst, exp, src); - __asm __volatile("" ::: "memory"); - return (retval); -} +#define atomic_cmpset_acq_int atomic_cmpset_int /* Release variants are identical to the normal ones. */ #define atomic_set_rel_char atomic_set_char