summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/counter.h
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-04-09 17:55:39 +0000
committerkib <kib@FreeBSD.org>2013-04-09 17:55:39 +0000
commit4eacc6be7b9d078e160e4c2fb1f13d33849eba65 (patch)
tree867947327ff89839505091df5519e2c5abb22f5f /sys/i386/include/counter.h
parent204e3efd776da6c7944c99514ef256e1f350be8e (diff)
downloadFreeBSD-src-4eacc6be7b9d078e160e4c2fb1f13d33849eba65.zip
FreeBSD-src-4eacc6be7b9d078e160e4c2fb1f13d33849eba65.tar.gz
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.
Diffstat (limited to 'sys/i386/include/counter.h')
-rw-r--r--sys/i386/include/counter.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/i386/include/counter.h b/sys/i386/include/counter.h
index f45d953..3e93b36 100644
--- a/sys/i386/include/counter.h
+++ b/sys/i386/include/counter.h
@@ -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 inc)
"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");
}
OpenPOWER on IntegriCloud