Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Apr 2013 17:55:40 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r249314 - head/sys/i386/include
Message-ID:  <201304091755.r39HtegX091016@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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");
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304091755.r39HtegX091016>