Skip to content

Commit e58c04b

Browse files
Jim BosAndi Kleen
authored andcommitted
i8k: Tell gcc that *regs gets clobbered
[ upstream commit 6b4e81d ] 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: Andi Kleen <ak@linux.intel.com>
1 parent ce8b71a commit e58c04b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/char/i8k.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static int i8k_smm(struct smm_regs *regs)
141141
"lahf\n\t"
142142
"shrl $8,%%eax\n\t"
143143
"andl $1,%%eax\n"
144-
:"=a"(rc)
144+
:"=a"(rc), "+m" (*regs)
145145
: "a"(regs)
146146
: "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory");
147147
#else
@@ -166,7 +166,8 @@ static int i8k_smm(struct smm_regs *regs)
166166
"movl %%edx,0(%%eax)\n\t"
167167
"lahf\n\t"
168168
"shrl $8,%%eax\n\t"
169-
"andl $1,%%eax\n":"=a"(rc)
169+
"andl $1,%%eax\n"
170+
:"=a"(rc), "+m" (*regs)
170171
: "a"(regs)
171172
: "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory");
172173
#endif

0 commit comments

Comments
 (0)