m68k: Fix assembler constraint to prevent overeager gcc optimisation
Passing the address of a variable as an operand to an asm statement doesn't mark the value of this variable as used, so gcc may optimize its initialisation away. Fix this by using the "m" constraint instead. Signed-off-by: Andreas Schwab <schwab@linux-m68k.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Cc: stable@vger.kernel.org
This commit is contained in:

committed by
Geert Uytterhoeven

vanhempi
c808d3d839
commit
2a3535069e
@@ -189,8 +189,8 @@ void flush_thread(void)
|
||||
current->thread.fs = __USER_DS;
|
||||
if (!FPU_IS_EMU)
|
||||
asm volatile (".chip 68k/68881\n\t"
|
||||
"frestore %0@\n\t"
|
||||
".chip 68k" : : "a" (&zero));
|
||||
"frestore %0\n\t"
|
||||
".chip 68k" : : "m" (zero));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -163,8 +163,8 @@ void flush_thread(void)
|
||||
#ifdef CONFIG_FPU
|
||||
if (!FPU_IS_EMU)
|
||||
asm volatile (".chip 68k/68881\n\t"
|
||||
"frestore %0@\n\t"
|
||||
".chip 68k" : : "a" (&zero));
|
||||
"frestore %0\n\t"
|
||||
".chip 68k" : : "m" (zero));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -552,13 +552,13 @@ static inline void bus_error030 (struct frame *fp)
|
||||
|
||||
#ifdef DEBUG
|
||||
asm volatile ("ptestr %3,%2@,#7,%0\n\t"
|
||||
"pmove %%psr,%1@"
|
||||
: "=a&" (desc)
|
||||
: "a" (&temp), "a" (addr), "d" (ssw));
|
||||
"pmove %%psr,%1"
|
||||
: "=a&" (desc), "=m" (temp)
|
||||
: "a" (addr), "d" (ssw));
|
||||
#else
|
||||
asm volatile ("ptestr %2,%1@,#7\n\t"
|
||||
"pmove %%psr,%0@"
|
||||
: : "a" (&temp), "a" (addr), "d" (ssw));
|
||||
"pmove %%psr,%0"
|
||||
: "=m" (temp) : "a" (addr), "d" (ssw));
|
||||
#endif
|
||||
mmusr = temp;
|
||||
|
||||
@@ -605,20 +605,18 @@ static inline void bus_error030 (struct frame *fp)
|
||||
!(ssw & RW) ? "write" : "read", addr,
|
||||
fp->ptregs.pc, ssw);
|
||||
asm volatile ("ptestr #1,%1@,#0\n\t"
|
||||
"pmove %%psr,%0@"
|
||||
: /* no outputs */
|
||||
: "a" (&temp), "a" (addr));
|
||||
"pmove %%psr,%0"
|
||||
: "=m" (temp)
|
||||
: "a" (addr));
|
||||
mmusr = temp;
|
||||
|
||||
printk ("level 0 mmusr is %#x\n", mmusr);
|
||||
#if 0
|
||||
asm volatile ("pmove %%tt0,%0@"
|
||||
: /* no outputs */
|
||||
: "a" (&tlong));
|
||||
asm volatile ("pmove %%tt0,%0"
|
||||
: "=m" (tlong));
|
||||
printk("tt0 is %#lx, ", tlong);
|
||||
asm volatile ("pmove %%tt1,%0@"
|
||||
: /* no outputs */
|
||||
: "a" (&tlong));
|
||||
asm volatile ("pmove %%tt1,%0"
|
||||
: "=m" (tlong));
|
||||
printk("tt1 is %#lx\n", tlong);
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
@@ -668,13 +666,13 @@ static inline void bus_error030 (struct frame *fp)
|
||||
|
||||
#ifdef DEBUG
|
||||
asm volatile ("ptestr #1,%2@,#7,%0\n\t"
|
||||
"pmove %%psr,%1@"
|
||||
: "=a&" (desc)
|
||||
: "a" (&temp), "a" (addr));
|
||||
"pmove %%psr,%1"
|
||||
: "=a&" (desc), "=m" (temp)
|
||||
: "a" (addr));
|
||||
#else
|
||||
asm volatile ("ptestr #1,%1@,#7\n\t"
|
||||
"pmove %%psr,%0@"
|
||||
: : "a" (&temp), "a" (addr));
|
||||
"pmove %%psr,%0"
|
||||
: "=m" (temp) : "a" (addr));
|
||||
#endif
|
||||
mmusr = temp;
|
||||
|
||||
|
Viittaa uudesa ongelmassa
Block a user