39,8 → 39,8 |
unsigned long long init_tsc; |
unsigned long long * ptr_init_tsc = &init_tsc; |
|
unsigned long long init_nsec; |
unsigned long long * ptr_init_nsec = &init_nsec; |
struct timespec init_time; |
struct timespec * ptr_init_time = &init_time; |
|
unsigned int clk_per_msec = 0; |
unsigned int apic_clk_per_msec = 0; |
443,7 → 443,8 |
#endif |
|
rdtscll(init_tsc); // Read start TSC |
init_nsec = 0; |
init_time.tv_sec = 0; |
init_time.tv_nsec = 0; |
|
if (use_apic) { |
rdmsr(APIC_BASE_MSR, msr_low_orig, tmp); |
485,17 → 486,22 |
unsigned long temp; |
SYS_FLAGS f; |
|
f = ll_fsave(); |
if (use_tsc) { |
f = ll_fsave(); |
|
mul32div32to32(clk_per_msec,new_f,old_f,temp); /* TODO */ |
clk_per_msec = temp; |
dtsc = clk_per_msec * 500; |
clk_opt_0 = (unsigned int)(dtsc); |
clk_opt_1 = (unsigned int)((unsigned long long)(dtsc << 1)); |
clk_opt_2 = (unsigned int)((unsigned long long)(dtsc << 33) / 1000000000L); |
clk_opt_3 = (unsigned int)((unsigned long long)(dtsc << 32) / 1000000000L); |
clk_opt_4 = (unsigned int)((unsigned long long)(dtsc << 31) / 1000000000L); |
clk_opt_5 = (unsigned int)((unsigned long long)(dtsc << 30) / 1000000000L); |
rdtscll(init_tsc); // Set new start TSC |
ll_read_timespec(&init_time); // Set new start TimeSpec |
|
mul32div32to32(clk_per_msec,new_f,old_f,temp); |
clk_per_msec = temp; |
dtsc = (unsigned long long)(clk_per_msec) * 500; |
clk_opt_0 = (unsigned int)(dtsc); |
clk_opt_1 = (unsigned int)((unsigned long long)(dtsc << 1)); |
clk_opt_2 = (unsigned int)((unsigned long long)(dtsc << 33) / 1000000000L); |
clk_opt_3 = (unsigned int)((unsigned long long)(dtsc << 32) / 1000000000L); |
clk_opt_4 = (unsigned int)((unsigned long long)(dtsc << 31) / 1000000000L); |
clk_opt_5 = (unsigned int)((unsigned long long)(dtsc << 30) / 1000000000L); |
|
ll_frestore(f); |
ll_frestore(f); |
} |
} |