arch/x86: Remove weak tsc_freq_mhz() implementation
Build with TSC_CONSTANT_RATE must fail when this function is not implemented for the platform. Weak implementation causes division by zero in timer_monotonic_get() and turns udelay() into no delay. Change-Id: Id3b105ea3aac37cd0cba18ce2fb06d87a055486f Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/30762 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
6390c50703
commit
6c19cb53ee
|
@ -21,15 +21,14 @@ uint64_t timestamp_get(void)
|
||||||
return rdtscll();
|
return rdtscll();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long __weak tsc_freq_mhz(void)
|
|
||||||
{
|
|
||||||
/* Default to not knowing TSC frequency. cbmem will have to fallback
|
|
||||||
* on trying to determine it in userspace. */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int timestamp_tick_freq_mhz(void)
|
int timestamp_tick_freq_mhz(void)
|
||||||
{
|
{
|
||||||
/* Chipsets that have a constant TSC provide this value correctly. */
|
/* Chipsets that have a constant TSC provide this value correctly. */
|
||||||
return tsc_freq_mhz();
|
if (IS_ENABLED(CONFIG_TSC_CONSTANT_RATE))
|
||||||
|
return tsc_freq_mhz();
|
||||||
|
|
||||||
|
/* Filling tick_freq_mhz = 0 in timestamps-table will trigger
|
||||||
|
* userspace utility to try deduce it from the running system.
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue