diff options
-rw-r--r-- | arch/x86/machine/cpu.c | 6 | ||||
-rw-r--r-- | arch/x86/machine/cpu.h | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86/machine/cpu.c b/arch/x86/machine/cpu.c index b60bea9..6cbe168 100644 --- a/arch/x86/machine/cpu.c +++ b/arch/x86/machine/cpu.c @@ -160,6 +160,12 @@ static alignas(8) struct cpu_gate_desc cpu_idt[CPU_IDT_SIZE] __read_mostly; static unsigned long cpu_double_fault_handler; static alignas(CPU_DATA_ALIGN) char cpu_double_fault_stack[TRAP_STACK_SIZE]; +uint64_t +cpu_get_freq(void) +{ + return cpu_freq; +} + void cpu_delay(unsigned long usecs) { diff --git a/arch/x86/machine/cpu.h b/arch/x86/machine/cpu.h index 334a51c..2464117 100644 --- a/arch/x86/machine/cpu.h +++ b/arch/x86/machine/cpu.h @@ -646,6 +646,11 @@ cpu_tlb_flush_va(unsigned long va) } /* + * Get cpu frequency in Hz. + */ +uint64_t cpu_get_freq(void); + +/* * Busy-wait for a given amount of time, in microseconds. */ void cpu_delay(unsigned long usecs); |