diff options
author | Matt Macy <mmacy@FreeBSD.org> | 2018-07-06 10:10:00 +0000 |
---|---|---|
committer | Matt Macy <mmacy@FreeBSD.org> | 2018-07-06 10:10:00 +0000 |
commit | 428194fed271bc910aeda7f263f4dcd661b12399 (patch) | |
tree | f1e5c8f01e04870d3f044c2b941111c51130cd7f /sys/amd64/include | |
parent | 7524b4c14bbd8e93a82d21a0abba7d423683da55 (diff) | |
download | src-428194fed271bc910aeda7f263f4dcd661b12399.tar.gz src-428194fed271bc910aeda7f263f4dcd661b12399.zip |
counter(9): unbreak amd64 following r336020
Apply temporary fix to counter until daylight hours.
The fact that the assembly for counter_u64_add relied on the sizeof(struct pcpu) was
the basis for the otherwise arbitrary offset never came up in D15933.
critical_{enter,exit} is now inline so the only real added overhead is the
added (mostly false) conditional branch in exit.
Notes
Notes:
svn path=/head/; revision=336024
Diffstat (limited to 'sys/amd64/include')
-rw-r--r-- | sys/amd64/include/counter.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/amd64/include/counter.h b/sys/amd64/include/counter.h index 2255a0575a0c..b09790fcb34e 100644 --- a/sys/amd64/include/counter.h +++ b/sys/amd64/include/counter.h @@ -83,11 +83,18 @@ counter_u64_zero_inline(counter_u64_t c) static inline void counter_u64_add(counter_u64_t c, int64_t inc) { - + int64_t *p; +#ifdef notyet __asm __volatile("addq\t%1,%%gs:(%0)" : : "r" ((char *)c - (char *)&__pcpu[0]), "ri" (inc) : "memory", "cc"); +#endif + /* temporary */ + critical_enter(); + p = zpcpu_get(c); + *p += inc; + critical_exit(); } #endif /* ! __MACHINE_COUNTER_H__ */ |