]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
riscv: small counter(9) improvements
authormhorne <mhorne@FreeBSD.org>
Fri, 11 Dec 2020 20:01:45 +0000 (20:01 +0000)
committermhorne <mhorne@FreeBSD.org>
Fri, 11 Dec 2020 20:01:45 +0000 (20:01 +0000)
commit733c1b77359be8ea1927aff4ae0399cc5fed8ef0
tree5bf0665e9852130a0243c7eed7bc46e74568841b
parent348f20d914bd65385335751d92d369a341c67292
riscv: small counter(9) improvements

Prefer atomics to critical section. This reduces the cost of the
increment operation and removes the possibility of it being interrupted
by counter_u64_zero().

Use CPU_FOREACH() macro to skip absent CPUs.

Replace hand-rolled address calculation with zpcpu_get().

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D27536
sys/riscv/include/counter.h