From owner-p4-projects@FreeBSD.ORG Mon Feb 21 20:25:21 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E373216A4D0; Mon, 21 Feb 2005 20:25:20 +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 BC89216A4CE for ; Mon, 21 Feb 2005 20:25:20 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A232243D49 for ; Mon, 21 Feb 2005 20:25:20 +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 j1LKPK9P060549 for ; Mon, 21 Feb 2005 20:25:20 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j1LKPKm5060546 for perforce@freebsd.org; Mon, 21 Feb 2005 20:25:20 GMT (envelope-from jhb@freebsd.org) Date: Mon, 21 Feb 2005 20:25:20 GMT Message-Id: <200502212025.j1LKPKm5060546@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 71492 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: Mon, 21 Feb 2005 20:25:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=71492 Change 71492 by jhb@jhb_slimer on 2005/02/21 20:25:13 MFi386: Don't use fences at all for UP kernels. Affected files ... .. //depot/projects/smpng/sys/amd64/include/atomic.h#6 edit Differences ... ==== //depot/projects/smpng/sys/amd64/include/atomic.h#6 (text+ko) ==== @@ -162,6 +162,8 @@ #if defined(__GNUC__) +#if defined(_KERNEL) && !defined(SMP) + #define ATOMIC_STORE_LOAD(TYPE) \ static __inline u_##TYPE \ atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ @@ -169,6 +171,25 @@ u_##TYPE v; \ \ v = *p; \ + return (v); \ +} \ + \ +static __inline void \ +atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\ +{ \ + *p = v; \ +} \ +struct __hack + +#else /* defined(SMP) */ + +#define ATOMIC_STORE_LOAD(TYPE) \ +static __inline u_##TYPE \ +atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ +{ \ + u_##TYPE v; \ + \ + v = *p; \ __asm __volatile("lfence" ::: "memory"); \ return (v); \ } \ @@ -181,6 +202,8 @@ } \ struct __hack +#endif /* !define(SMP) */ + #else /* !defined(__GNUC__) */ extern int atomic_cmpset_int(volatile u_int *, u_int, u_int);