diff options
author | Florian Fainelli <florian@openwrt.org> | 2010-07-28 18:13:07 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2010-08-05 08:25:39 -0400 |
commit | 5c8974538afd97990d3730ef6fea731a34ef1f85 (patch) | |
tree | 9cacc2300cf71e45e5a868ac561f5a1e66bef19c /arch/mips/cavium-octeon | |
parent | e10c53a5f31ae1535e13ef51d6615662c36d36c6 (diff) |
MIPS: Octeon: Workaround link failures with gcc-4.4.x 32-bits toolchains
When building with a gcc-4.4.x toolchain that is configured to produce
32-bits executables by default, we will produce __lshrti3 in sched_clock()
which is never resolved so the kernel fails to link. Unconditionally use
the inline assembly version as suggested by David Daney, which works around
the issue.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
To: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/1514/
Acked-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/cavium-octeon')
-rw-r--r-- | arch/mips/cavium-octeon/csrc-octeon.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/arch/mips/cavium-octeon/csrc-octeon.c b/arch/mips/cavium-octeon/csrc-octeon.c index 0bf4bbe04ae2..36400d23ff59 100644 --- a/arch/mips/cavium-octeon/csrc-octeon.c +++ b/arch/mips/cavium-octeon/csrc-octeon.c | |||
@@ -53,7 +53,6 @@ static struct clocksource clocksource_mips = { | |||
53 | unsigned long long notrace sched_clock(void) | 53 | unsigned long long notrace sched_clock(void) |
54 | { | 54 | { |
55 | /* 64-bit arithmatic can overflow, so use 128-bit. */ | 55 | /* 64-bit arithmatic can overflow, so use 128-bit. */ |
56 | #if (__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ <= 3)) | ||
57 | u64 t1, t2, t3; | 56 | u64 t1, t2, t3; |
58 | unsigned long long rv; | 57 | unsigned long long rv; |
59 | u64 mult = clocksource_mips.mult; | 58 | u64 mult = clocksource_mips.mult; |
@@ -73,13 +72,6 @@ unsigned long long notrace sched_clock(void) | |||
73 | : [cnt] "r" (cnt), [mult] "r" (mult), [shift] "r" (shift) | 72 | : [cnt] "r" (cnt), [mult] "r" (mult), [shift] "r" (shift) |
74 | : "hi", "lo"); | 73 | : "hi", "lo"); |
75 | return rv; | 74 | return rv; |
76 | #else | ||
77 | /* GCC > 4.3 do it the easy way. */ | ||
78 | unsigned int __attribute__((mode(TI))) t; | ||
79 | t = read_c0_cvmcount(); | ||
80 | t = t * clocksource_mips.mult; | ||
81 | return (unsigned long long)(t >> clocksource_mips.shift); | ||
82 | #endif | ||
83 | } | 75 | } |
84 | 76 | ||
85 | void __init plat_time_init(void) | 77 | void __init plat_time_init(void) |