Commit cc19d58d authored by David Mosberger's avatar David Mosberger

ia64: Fix __delay() even more: it's just not safe to inline the delay-

	loop because, e.g., the compiler might decide to unroll the
	loop when passed a constant, etc.
parent cdbb8f93
...@@ -797,6 +797,25 @@ GLOBAL_ENTRY(ia64_switch_mode_virt) ...@@ -797,6 +797,25 @@ GLOBAL_ENTRY(ia64_switch_mode_virt)
br.ret.sptk.many rp br.ret.sptk.many rp
END(ia64_switch_mode_virt) END(ia64_switch_mode_virt)
GLOBAL_ENTRY(ia64_delay_loop)
.prologue
{ nop 0 // work around GAS unwind info generation bug...
.save ar.lc,r2
mov r2=ar.lc
.body
;;
mov ar.lc=r32
}
;;
// force loop to be 32-byte aligned (GAS bug means we cannot use .align
// inside function body without corrupting unwind info).
{ nop 0 }
1: br.cloop.sptk.few 1b
;;
mov ar.lc=r2
br.ret.sptk.many rp
END(ia64_delay_loop)
#ifdef CONFIG_IA64_BRL_EMU #ifdef CONFIG_IA64_BRL_EMU
/* /*
......
...@@ -67,14 +67,15 @@ ia64_get_itc (void) ...@@ -67,14 +67,15 @@ ia64_get_itc (void)
return result; return result;
} }
extern void ia64_delay_loop (unsigned long loops);
static __inline__ void static __inline__ void
__delay (unsigned long loops) __delay (unsigned long loops)
{ {
if (loops < 1) if (unlikely(loops < 1))
return; return;
while (loops--) ia64_delay_loop (loops - 1);
barrier();
} }
static __inline__ void static __inline__ void
......
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