diff options
author | Stuart Menefy <stuart.menefy@st.com> | 2009-08-24 05:18:50 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-08-24 05:18:50 -0400 |
commit | bd4fb4d4c1e4a5a2ffbf57a83817a749df1339dd (patch) | |
tree | 994804b9290aeaea3113842e486c22fbec30cdc1 /arch/sh/lib | |
parent | 6d243dd37002bcee54841852ab1b8606fd457851 (diff) |
sh: Fix underflow in SH udelay() code.
Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/lib')
-rw-r--r-- | arch/sh/lib/delay.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/sh/lib/delay.c b/arch/sh/lib/delay.c index f3ddd2133e6f..faa8f86c0db4 100644 --- a/arch/sh/lib/delay.c +++ b/arch/sh/lib/delay.c | |||
@@ -21,13 +21,14 @@ void __delay(unsigned long loops) | |||
21 | 21 | ||
22 | inline void __const_udelay(unsigned long xloops) | 22 | inline void __const_udelay(unsigned long xloops) |
23 | { | 23 | { |
24 | xloops *= 4; | ||
24 | __asm__("dmulu.l %0, %2\n\t" | 25 | __asm__("dmulu.l %0, %2\n\t" |
25 | "sts mach, %0" | 26 | "sts mach, %0" |
26 | : "=r" (xloops) | 27 | : "=r" (xloops) |
27 | : "0" (xloops), | 28 | : "0" (xloops), |
28 | "r" (HZ * cpu_data[raw_smp_processor_id()].loops_per_jiffy) | 29 | "r" (cpu_data[raw_smp_processor_id()].loops_per_jiffy * (HZ/4)) |
29 | : "macl", "mach"); | 30 | : "macl", "mach"); |
30 | __delay(xloops); | 31 | __delay(++xloops); |
31 | } | 32 | } |
32 | 33 | ||
33 | void __udelay(unsigned long usecs) | 34 | void __udelay(unsigned long usecs) |