A compiler patch for scsi driver

H.J. Lu (hjl@varesearch.com)
Fri, 27 Aug 1999 12:38:59 -0700 (PDT)


Hi,

Here is a compiler asm statement patch for some scsi drivers. It is
for Linux 2.2.7 and above.

-- 
H.J. Lu (hjl@gnu.org)
--
--- linux-2.2.7/drivers/scsi/in2000.h.orig	Sat Jun 26 12:10:11 1999
+++ linux-2.2.7/drivers/scsi/in2000.h	Sat Jun 26 12:11:16 1999
@@ -62,6 +62,8 @@
  */
 
 #define FAST_READ2_IO()    \
+ { \
+   int dummy_edx, dummy_ecx; \
    __asm__ __volatile__ ("\n \
    cld                    \n \
    orl %%ecx, %%ecx       \n \
@@ -69,11 +71,14 @@
    rep                    \n \
    insw %%dx              \n \
 1: "                       \
-   : "=D" (sp)                   /* output */   \
-   : "d" (f), "D" (sp), "c" (i)  /* input */    \
-   : "edx", "ecx", "edi" )       /* trashed */
+   : "=D" (sp), "=d" (dummy_edx), "=c"(dummy_ecx) /* output */   \
+   : "1" (f), "0" (sp), "2" (i)  /* input */    \
+   ); \
+ }
 
 #define FAST_WRITE2_IO()   \
+ { \
+   int dummy_edx, dummy_ecx; \
    __asm__ __volatile__ ("\n \
    cld                    \n \
    orl %%ecx, %%ecx       \n \
@@ -81,10 +86,10 @@
    rep                    \n \
    outsw %%dx             \n \
 1: "                       \
-   : "=S" (sp)                   /* output */   \
-   : "d" (f), "S" (sp), "c" (i)  /* input */    \
-   : "edx", "ecx", "esi" )       /* trashed */
-
+   : "=S" (sp), "=d" (dummy_edx), "=c"(dummy_ecx) /* output */   \
+   : "1" (f), "0" (sp), "2" (i)  /* input */    \
+   ); \
+ }
 
 /* IN2000 io_port offsets */
 #define IO_WD_ASR       0x00     /* R - 3393 auxstat reg */
--- linux-2.2.7/drivers/scsi/seagate.c.orig	Tue Dec 29 11:40:35 1998
+++ linux-2.2.7/drivers/scsi/seagate.c	Sat Jun 26 12:12:07 1999
@@ -1223,7 +1223,9 @@ static int internal_command (unsigned ch
 /* Local variables : len = ecx , data = esi, 
                      st0x_cr_sr = ebx, st0x_dr =  edi
 */
-            __asm__ (
+	  {
+	    int dummy_eax, dummy_ebx, dummy_edi;
+            __asm__ __volatile__ (
             /* Test for any data here at all. */
                     "orl %%ecx, %%ecx\n\t"
                     "jz 2f\n\t"
@@ -1246,9 +1248,9 @@ static int internal_command (unsigned ch
                     "movb %%al, (%%edi)\n\t"
                     "loop 1b\n\t"
                 "2:\n"
-/* output */    : "=S" (data), "=c" (len) 
-/* input */     : "0" (data), "1" (len), "b" (phys_to_virt(st0x_cr_sr)), "D" (phys_to_virt(st0x_dr)) 
-/* clobbered */ : "eax", "ebx", "edi"); 
+/* output */    : "=S" (data), "=c" (len), "=a" (dummy_eax), "=b" (dummy_ebx), "=D" (dummy_edi)
+/* input */     : "0" (data), "1" (len), "3" (phys_to_virt(st0x_cr_sr)), "4" (phys_to_virt(st0x_dr)));
+	  }
 #else /* SEAGATE_USE_ASM */
             while (len)
             {
@@ -1380,7 +1382,9 @@ static int internal_command (unsigned ch
  */
             /* Local variables : ecx = len, edi = data
                                  esi = st0x_cr_sr, ebx = st0x_dr */
-            __asm__ (
+	  {
+	    int dummy_eax, dummy_ebx, dummy_esi;
+            __asm__ __volatile__ (
             /* Test for room to read */
                 "orl %%ecx, %%ecx\n\t"
                 "jz 2f\n\t"
@@ -1405,9 +1409,9 @@ static int internal_command (unsigned ch
                 "stosb\n\t"   
                 "loop 1b\n\t"
             "2:\n"
-/* output */    : "=D" (data), "=c" (len) 
-/* input */     : "0" (data), "1" (len), "S" (phys_to_virt(st0x_cr_sr)), "b" (phys_to_virt(st0x_dr)) 
-/* clobbered */ : "eax","ebx", "esi"); 
+/* output */    : "=D" (data), "=c" (len), "=a" (dummy_eax), "=b" (dummy_ebx), "=S" (dummy_esi)
+/* input */     : "0" (data), "1" (len), "4" (phys_to_virt(st0x_cr_sr)), "3" (phys_to_virt(st0x_dr)));
+	  }
 #else /* SEAGATE_USE_ASM */
             while (len)
             {

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/