acrn-hypervisor/hypervisor/include
Junjie Mao e75cca64c8 HV: timer: keep TSC frequency in KHz
This patch represents TSC freqeuency in KHz using a 32-bit unsigned integer.

The conversion macros between ticks and us/ms are changed to inline functions to
enforce the types of the input parameters. Note that us_to_ticks accepts only
uint32_t (~4K us at most) and never overflows.

Results of some unit tests on the conversion functions:

    calibrate_tsc, tsc_khz=1881600
    64us -> ticks: 120422
    64us -> ticks -> us: 63
    511us -> ticks: 961497
    511us -> ticks -> us: 510
    1280000 ticks -> us: 680
    1280000 ticks -> us -> ticks: 1279488

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-07-03 10:18:06 +08:00
..
arch/x86 hv: add ioapic reset function 2018-07-02 16:12:54 +08:00
common HV: treewide: drop debug-only helpers in release build 2018-07-02 14:35:39 +08:00
debug HV: Make all trace event prefix consist with TRACE 2018-07-02 10:46:41 +08:00
lib HV: timer: keep TSC frequency in KHz 2018-07-03 10:18:06 +08:00
public HV: treewide: enforce unsignedness of pcpu_id 2018-06-21 16:59:21 +08:00
hv_debug.h license: Replace license text with SPDX tag 2018-06-01 10:43:06 +08:00
hv_lib.h license: Replace license text with SPDX tag 2018-06-01 10:43:06 +08:00
hypervisor.h hv: refine the address used in sbl multiboot code 2018-06-22 16:12:24 +08:00