]> Devoid-pointer.net GitWeb - omnibook.git/commitdiff
Use eax for function in inline-assembly instead of using a general register and
authorHolger Nelson <hnelson@hnelson.de>
Wed, 20 Sep 2006 20:40:18 +0000 (20:40 +0000)
committerHolger Nelson <hnelson@hnelson.de>
Wed, 20 Sep 2006 20:40:18 +0000 (20:40 +0000)
copying that to ax.

nbsmi.c

diff --git a/nbsmi.c b/nbsmi.c
index 6cefb6a3c56083ab8857e0a6346e1bdadaf4dd21..91d829264ec0d87c3a414fcd0a4b281eb8baa525 100644 (file)
--- 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);