HomeFreeBSD

clock: Add a long ticks variable, ticksl

Description

clock: Add a long ticks variable, ticksl

For compatibility with Linux, it's useful to have a tick counter of
width sizeof(long), but our tick counter is an int. Currently the
linuxkpi tries paper over this difference, but this cannot really be
done reliably, so it's desirable to have a wider tick counter. This
change introduces ticksl, keeping the existing ticks variable.

Follow a suggestion from kib to avoid having to maintain two separate
counters and to avoid converting existing code to use ticksl: change
hardclock() to update ticksl instead of ticks, and then use assembler
directives to make ticks and ticksl overlap such that loading ticks
gives the bottom 32 bits. This makes it possible to use ticksl in the
linuxkpi without having to convert any native code, and without making
hardclock() more complicated or expensive. Then, the linuxkpi can be
modified to use ticksl instead of ticks.

Reviewed by: olce, kib, emaste
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D48383

Details

Provenance
markjAuthored on Fri, Jan 10, 3:37 PM
Reviewer
olce
Differential Revision
D48383: clock: Add a long ticks variable
Parents
rGc15b847b183b: share/man/man7/simd.7: document SIMD-enhanced timingsafe_{b,mem}cmp
Branches
Unknown
Tags
Unknown