From: Holger Nelson Date: Wed, 20 Sep 2006 20:40:18 +0000 (+0000) Subject: Use eax for function in inline-assembly instead of using a general register and X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=8b86684229895f012228fd03c02b261935b2129d;p=omnibook.git Use eax for function in inline-assembly instead of using a general register and copying that to ax. --- diff --git a/nbsmi.c b/nbsmi.c index 6cefb6a..91d8292 100644 --- a/nbsmi.c +++ b/nbsmi.c @@ -114,8 +114,7 @@ static inline u32 ati_do_smi_call( u16 function) * out: */ - __asm__ __volatile__("movw %1, %%ax; \ - outw %%ax, %2; \ + __asm__ __volatile__("outw %%ax, %2; \ orw %%ax, %%ax; \ jz 1f; \ inw %3, %%ax; \ @@ -124,8 +123,8 @@ static inline u32 ati_do_smi_call( u16 function) movl %4, %0; \ 1:;" : "=m" (retval) - : "g"(function), "N"(ATI_SMI_PORT), "N"(ATI_SMI_PORT+1), "i"(-EIO) - : "memory", "eax", "ebx", "ecx", "edx", "esi", "edi", "cc"); + : "a"(function), "N"(ATI_SMI_PORT), "N"(ATI_SMI_PORT+1), "i"(-EIO) + : "memory", "ebx", "ecx", "edx", "esi", "edi", "cc"); spin_unlock_irqrestore(&smi_spinlock,flags); return retval; @@ -160,15 +159,14 @@ static inline u32 intel_do_smi_call(u16 function) * retval = -EIO; [too bad] * out: */ - __asm__ __volatile__("movw %1, %%ax; \ - outw %%ax, %2; \ + __asm__ __volatile__("outw %%ax, %2; \ orw %%ax, %%ax; \ jz 1f; \ movl %3, %0; \ 1:;" : "=m" (retval) - : "g"(function), "N"(INTEL_SMI_PORT), "i"(-EIO) - : "memory", "eax", "ebx", "ecx", "edx", "esi", "edi", "cc"); + : "a"(function), "N"(INTEL_SMI_PORT), "i"(-EIO) + : "memory", "ebx", "ecx", "edx", "esi", "edi", "cc"); outl( state, sci_en ); spin_unlock_irqrestore(&smi_spinlock,flags);