From 4eacc6be7b9d078e160e4c2fb1f13d33849eba65 Mon Sep 17 00:00:00 2001 From: kib Date: Tue, 9 Apr 2013 17:55:39 +0000 Subject: 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. --- sys/i386/include/counter.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/i386/include/counter.h') 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"); } -- cgit v1.1