Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

I8K: allow i8k driver to be built on x86_64 systems

Adds #if clause and additional inline assembly so that the driver
builds on x86_64 systems.

Signed-off-by: Bradley Smith <bradjsmith@btinternet.com>
Cc: Frank Sorenson <frank@tuxrocks.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Bradley Smith and committed by
Linus Torvalds
fe04f22f 9a7744f9

+28 -1
+28 -1
drivers/char/i8k.c
··· 113 113 int rc; 114 114 int eax = regs->eax; 115 115 116 + #if defined(CONFIG_X86_64) 117 + asm("pushq %%rax\n\t" 118 + "movl 0(%%rax),%%edx\n\t" 119 + "pushq %%rdx\n\t" 120 + "movl 4(%%rax),%%ebx\n\t" 121 + "movl 8(%%rax),%%ecx\n\t" 122 + "movl 12(%%rax),%%edx\n\t" 123 + "movl 16(%%rax),%%esi\n\t" 124 + "movl 20(%%rax),%%edi\n\t" 125 + "popq %%rax\n\t" 126 + "out %%al,$0xb2\n\t" 127 + "out %%al,$0x84\n\t" 128 + "xchgq %%rax,(%%rsp)\n\t" 129 + "movl %%ebx,4(%%rax)\n\t" 130 + "movl %%ecx,8(%%rax)\n\t" 131 + "movl %%edx,12(%%rax)\n\t" 132 + "movl %%esi,16(%%rax)\n\t" 133 + "movl %%edi,20(%%rax)\n\t" 134 + "popq %%rdx\n\t" 135 + "movl %%edx,0(%%rax)\n\t" 136 + "lahf\n\t" 137 + "shrl $8,%%eax\n\t" 138 + "andl $1,%%eax\n" 139 + :"=a"(rc) 140 + : "a"(regs) 141 + : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); 142 + #else 116 143 asm("pushl %%eax\n\t" 117 144 "movl 0(%%eax),%%edx\n\t" 118 145 "push %%edx\n\t" ··· 164 137 "andl $1,%%eax\n":"=a"(rc) 165 138 : "a"(regs) 166 139 : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); 167 - 140 + #endif 168 141 if (rc != 0 || (regs->eax & 0xffff) == 0xffff || regs->eax == eax) 169 142 return -EINVAL; 170 143