UINT vpn_GetTickCount (void) { u64 d[2], q[2]; d[0] = get_time (); d[1] = 0; mpudiv_128_32 (d, 1000, q); return (UINT)q[0]; }
static u64 tsc_to_time (u64 tsc, u64 hz) { u64 tmp[2]; while (hz > 0xFFFFFFFFULL) { tsc >>= 1; hz >>= 1; } mpumul_64_64 (tsc, 1000000ULL, tmp); /* tmp = tsc * 1000000 */ mpudiv_128_32 (tmp, (u32)hz, tmp); /* tmp = tmp / hz */ return tmp[0]; }