HomeFreeBSD

random: Define a macro for getting the CPU cycle count

Description

random: Define a macro for getting the CPU cycle count

Entropy queue entries always include the low 32 bits of a CPU cycle
count reading. Introduce a macro for this instead of hard-coding
get_cyclecount() calls everywhere; this is handy for testing purposes
since this way, random(4)'s use of the cycle counter (e.g., the number
of bits we use) can be changed in one place.

No functional change intended.

Reviewed by: cem, delphij
MFC after: 1 week
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D51113

Details

Provenance
markjAuthored on Jul 3 2025, 5:27 PM
Reviewer
cem
Differential Revision
D51113: random: Define a macro for getting the CPU cycle count
Parents
rG4b8b872a9c55: random: Move entropy harvest queue lock macros to random_harvestq.c
Branches
Unknown
Tags
Unknown