From owner-svn-src-head@FreeBSD.ORG Tue Apr 9 17:55:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4F9EBCB8; Tue, 9 Apr 2013 17:55:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 421B6E17; Tue, 9 Apr 2013 17:55:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r39HteUL091017; Tue, 9 Apr 2013 17:55:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r39HtegX091016; Tue, 9 Apr 2013 17:55:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304091755.r39HtegX091016@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 9 Apr 2013 17:55:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249314 - head/sys/i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Apr 2013 17:55:40 -0000 Author: kib Date: Tue Apr 9 17:55:39 2013 New Revision: 249314 URL: http://svnweb.freebsd.org/changeset/base/249314 Log: Pass the segmented address of the counter, based on %fs, i.e. offset from the pcpu[0] to the counter base, instead of the linear address. Modified: head/sys/i386/include/counter.h Modified: head/sys/i386/include/counter.h ============================================================================== --- head/sys/i386/include/counter.h Tue Apr 9 17:43:48 2013 (r249313) +++ head/sys/i386/include/counter.h Tue Apr 9 17:55:39 2013 (r249314) @@ -46,6 +46,8 @@ critical_exit(); \ } while (0) +extern struct pcpu __pcpu[MAXCPU]; + static inline void counter_64_inc_8b(uint64_t *p, int64_t inc) { @@ -61,7 +63,7 @@ counter_64_inc_8b(uint64_t *p, int64_t i "cmpxchg8b %%fs:(%%esi)\n\t" "jnz 1b" : - : "S" (p), "D" (&inc) + : "S" ((char *)p - (char *)&__pcpu[0]), "D" (&inc) : "memory", "cc", "eax", "edx", "ebx", "ecx"); }