acrn-hypervisor/hypervisor/common
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
..
hv_main.c HV: timer: keep TSC frequency in KHz 2018-07-03 10:18:06 +08:00
hypercall.c HV:treewide:Update return type of function ffs64 and ffz64 2018-07-02 15:11:22 +08:00
io_request.c HV: treewide: drop debug-only helpers in release build 2018-07-02 14:35:39 +08:00
ptdev.c HV:common:fix "expression is not Boolean" 2018-06-20 14:19:47 +08:00
schedule.c HV:treewide:Update return type of function ffs64 and ffz64 2018-07-02 15:11:22 +08:00
stack_protector.c HV:common:fix "expression is not Boolean" 2018-06-20 14:19:47 +08:00
trusty_hypercall.c HV:common:transfer local variable type 2018-06-29 09:49:29 +08:00
vm_load.c HV:common:transfer local variable type 2018-06-29 09:49:29 +08:00