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.
This commit is contained in:
mmacy 2018-07-06 10:10:00 +00:00
parent 8baf738e84
commit c8354314f3

View File

@ -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__ */