diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2019-01-08 19:14:41 +0200 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2019-01-10 09:55:45 +0000 |
commit | 6c19cb53eebdc615c86165653d68c1aa71247ce0 (patch) | |
tree | 706486b8fd7a3f0c7765d779e6606b88219fb521 /src/arch | |
parent | 6390c5070363d834443ecdfb6b77c077fc2576dd (diff) |
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>
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/x86/timestamp.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/arch/x86/timestamp.c b/src/arch/x86/timestamp.c index 928d7d7402..b5257c4c7e 100644 --- a/src/arch/x86/timestamp.c +++ b/src/arch/x86/timestamp.c @@ -21,15 +21,14 @@ uint64_t timestamp_get(void) 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) { /* 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; } |