Commit 0b375cdb authored by David Mosberger's avatar David Mosberger

ia64: Prevent GCC from clobbering r13. Found by Luming You.

Without this change, GCC thinks it's OK to clobber r13.  It doesn't do it
very often, but it's enough if it does it once and it turns out
acpi_bus_receive_event() had code that would trigger this issue.
Fix by declaring r13 as a global register variable.
parent 1b811d97
......@@ -23,6 +23,8 @@
extern void ia64_bad_param_for_setreg (void);
extern void ia64_bad_param_for_getreg (void);
register unsigned long ia64_r13 asm ("r13");
#define ia64_setreg(regnum, val) \
({ \
switch (regnum) { \
......@@ -67,10 +69,7 @@ extern void ia64_bad_param_for_getreg (void);
asm volatile ("mov %0=psr" : "=r"(ia64_intri_res)); \
break; \
case _IA64_REG_TP: /* for current() */ \
{ \
register __u64 ia64_r13 asm ("r13"); \
ia64_intri_res = ia64_r13; \
} \
break; \
case _IA64_REG_AR_KR0 ... _IA64_REG_AR_EC: \
asm volatile ("mov %0=ar%1" : "=r" (ia64_intri_res) \
......
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