hv/mod_timer: split tsc handling code from timer.

Generalize and split basic cpu cycle/tick routines from x86/timer:
- Instead of rdstc(), use cpu_ticks() in generic code.
- Instead of get_tsc_khz(), use cpu_tickrate() in generic code.
- Include "common/ticks.h" instead of "x86/timer.h" in generic code.
- CYCLES_PER_MS is renamed to TICKS_PER_MS.

The x86 specific API rdstc() and get_tsc_khz(), as well as TSC_PER_MS
are still available in arch/x86/tsc.h but only for x86 specific usage.

Tracked-On: #5920
Signed-off-by: Rong Liu <rong2.liu@intel.com>
Signed-off-by: Yi Liang <yi.liang@intel.com>
This commit is contained in:
Liang Yi
2021-04-08 17:36:12 +08:00
committed by wenlingz
parent c2df3f7940
commit 5a2b89b0a4
23 changed files with 301 additions and 209 deletions

View File

@@ -808,6 +808,7 @@ INPUT = custom-doxygen/mainpage.md \
../hypervisor/include/arch/x86/asm/guest/assign.h \
../hypervisor/include/arch/x86/asm/guest/vcpu.h \
../hypervisor/include/arch/x86/asm/guest/virtual_cr.h \
../hypervisor/include/arch/x86/asm/tsc.h \
../hypervisor/include/arch/x86/asm/timer.h \
../hypervisor/include/arch/x86/asm/ioapic.h \
../hypervisor/include/arch/x86/asm/lapic.h \
@@ -817,6 +818,7 @@ INPUT = custom-doxygen/mainpage.md \
../hypervisor/include/dm/io_req.h \
../hypervisor/include/common/hypercall.h \
../hypervisor/include/common/irq.h \
../hypervisor/include/common/ticks.h \
../hypervisor/include/common/ptdev.h \
../hypervisor/include/public/acrn_common.h \
../hypervisor/include/public/acrn_hv_defs.h \