kernel/x86: rework get_frequency_for

we don't sample if the last sample is too recent and use the cached result.

Change-Id: I17ed29bda7fe7276f1a4148b3e1985c9d32ae032
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4101
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Jérôme Duval
2021-11-22 07:21:04 +00:00
parent 7c2c355f17
commit 4106e3f146
3 changed files with 26 additions and 6 deletions
@@ -518,6 +518,11 @@ typedef struct arch_cpu_info {
uint32 logical_apic_id;
uint64 mperf_prev;
uint64 aperf_prev;
bigtime_t perf_timestamp;
uint64 frequency;
struct X86PagingStructures* active_paging_structures;
size_t dr6; // temporary storage for debug registers (cf.