]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
riscv: small counter(9) improvements
authorMitchell Horne <mhorne@FreeBSD.org>
Fri, 11 Dec 2020 20:01:45 +0000 (20:01 +0000)
committerMitchell Horne <mhorne@FreeBSD.org>
Fri, 11 Dec 2020 20:01:45 +0000 (20:01 +0000)
commitf7cc0eae7ec570f27458417c044bb9a447833685
tree5bf0665e9852130a0243c7eed7bc46e74568841b
parent00492fb846a59a3ca77525c626bcd3631fb2ecc0
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