diff options
author | Jim Bos <jim876@xs4all.nl> | 2010-11-13 12:13:53 +0100 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2012-02-11 15:40:50 +0100 |
commit | ac7024a240022c51fb1f184d59f366c092212d0f (patch) | |
tree | 65a812b1dec2aeccb47cb30d4efe1dc2bd3ff538 | |
parent | ad6e2b74568f82e902aa066982f22a3723929bb4 (diff) | |
download | lwn-ac7024a240022c51fb1f184d59f366c092212d0f.tar.gz lwn-ac7024a240022c51fb1f184d59f366c092212d0f.zip |
i8k: Tell gcc that *regs gets clobbered
commit 6b4e81db2552bad04100e7d5ddeed7e848f53b48 upstream.
More recent GCC caused the i8k driver to stop working, on Slackware
compiler was upgraded from gcc-4.4.4 to gcc-4.5.1 after which it didn't
work anymore, meaning the driver didn't load or gave total nonsensical
output.
As it turned out the asm(..) statement forgot to mention it modifies the
*regs variable.
Credits to Andi Kleen and Andreas Schwab for providing the fix.
Signed-off-by: Jim Bos <jim876@xs4all.nl>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Willy Tarreau <w@1wt.eu>
-rw-r--r-- | drivers/char/i8k.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c index b60d425ce8d1..e389a0f5f386 100644 --- a/drivers/char/i8k.c +++ b/drivers/char/i8k.c @@ -141,7 +141,7 @@ static int i8k_smm(struct smm_regs *regs) "lahf\n\t" "shrl $8,%%eax\n\t" "andl $1,%%eax\n" - :"=a"(rc) + :"=a"(rc), "+m" (*regs) : "a"(regs) : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); #else @@ -166,7 +166,8 @@ static int i8k_smm(struct smm_regs *regs) "movl %%edx,0(%%eax)\n\t" "lahf\n\t" "shrl $8,%%eax\n\t" - "andl $1,%%eax\n":"=a"(rc) + "andl $1,%%eax\n" + :"=a"(rc), "+m" (*regs) : "a"(regs) : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); #endif |