Commit bd4fb4d4 authored by Stuart Menefy's avatar Stuart Menefy Committed by Paul Mundt

sh: Fix underflow in SH udelay() code.

Signed-off-by: default avatarStuart Menefy <stuart.menefy@st.com>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 6d243dd3
...@@ -21,13 +21,14 @@ void __delay(unsigned long loops) ...@@ -21,13 +21,14 @@ void __delay(unsigned long loops)
inline void __const_udelay(unsigned long xloops) inline void __const_udelay(unsigned long xloops)
{ {
xloops *= 4;
__asm__("dmulu.l %0, %2\n\t" __asm__("dmulu.l %0, %2\n\t"
"sts mach, %0" "sts mach, %0"
: "=r" (xloops) : "=r" (xloops)
: "0" (xloops), : "0" (xloops),
"r" (HZ * cpu_data[raw_smp_processor_id()].loops_per_jiffy) "r" (cpu_data[raw_smp_processor_id()].loops_per_jiffy * (HZ/4))
: "macl", "mach"); : "macl", "mach");
__delay(xloops); __delay(++xloops);
} }
void __udelay(unsigned long usecs) void __udelay(unsigned long usecs)
......
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