Commit 431ceb83 authored by Thomas Gleixner's avatar Thomas Gleixner

x86: fix TSC build error on 32bit

Dave Hansen reported a build error on 32bit which went unnoticed
as newer gcc versions seem to optimize unused static functions
away before compiling them.

Make vread_tsc() depend on CONFIG_X86_64
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent b9d2252c
...@@ -358,6 +358,7 @@ static cycle_t read_tsc(void) ...@@ -358,6 +358,7 @@ static cycle_t read_tsc(void)
ret : clocksource_tsc.cycle_last; ret : clocksource_tsc.cycle_last;
} }
#ifdef CONFIG_X86_64
static cycle_t __vsyscall_fn vread_tsc(void) static cycle_t __vsyscall_fn vread_tsc(void)
{ {
cycle_t ret = (cycle_t)vget_cycles(); cycle_t ret = (cycle_t)vget_cycles();
...@@ -365,6 +366,7 @@ static cycle_t __vsyscall_fn vread_tsc(void) ...@@ -365,6 +366,7 @@ static cycle_t __vsyscall_fn vread_tsc(void)
return ret >= __vsyscall_gtod_data.clock.cycle_last ? return ret >= __vsyscall_gtod_data.clock.cycle_last ?
ret : __vsyscall_gtod_data.clock.cycle_last; ret : __vsyscall_gtod_data.clock.cycle_last;
} }
#endif
static struct clocksource clocksource_tsc = { static struct clocksource clocksource_tsc = {
.name = "tsc", .name = "tsc",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment