Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions opal/mca/timer/linux/timer_linux_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,21 @@ static int opal_timer_linux_find_freq(void)
}
}

#if ((OPAL_ASSEMBLY_ARCH == OPAL_IA32) || (OPAL_ASSEMBLY_ARCH == OPAL_X86_64))
if (0 == opal_timer_linux_freq && opal_sys_timer_is_monotonic()) {
/* tsc is exposed through bogomips ~> loops_per_jiffy ~> tsc_khz */
loc = find_info(fp, "bogomips", buf, 1024);
if (NULL != loc) {
ret = sscanf(loc, "%f", &cpu_f);
if (1 == ret) {
/* number is in MHz * 2 and has 2 decimal digits
convert to Hz and make an integer */
opal_timer_linux_freq = (opal_timer_t) (cpu_f * 100.0f) * 5000;
}
}
}
#endif

if (0 == opal_timer_linux_freq) {
/* find the CPU speed - most timers are 1:1 with CPU speed */
loc = find_info(fp, "cpu MHz", buf, 1024);
Expand Down