diff options
Diffstat (limited to 'linux/src/drivers')
-rw-r--r-- | linux/src/drivers/scsi/in2000.h | 23 | ||||
-rw-r--r-- | linux/src/drivers/scsi/ppa.c | 129 |
2 files changed, 36 insertions, 116 deletions
diff --git a/linux/src/drivers/scsi/in2000.h b/linux/src/drivers/scsi/in2000.h index 2a6ad29..52a86e0 100644 --- a/linux/src/drivers/scsi/in2000.h +++ b/linux/src/drivers/scsi/in2000.h @@ -62,29 +62,34 @@ */ #define FAST_READ2_IO() \ +({ \ +int __dummy_1,__dummy_2; \ __asm__ __volatile__ ("\n \ cld \n \ orl %%ecx, %%ecx \n \ jz 1f \n \ rep \n \ - insw %%dx \n \ + insw (%%dx),%%es:(%%edi) \n \ 1: " \ - : "=D" (sp) /* output */ \ - : "d" (f), "D" (sp), "c" (i) /* input */ \ - : "edx", "ecx", "edi" ) /* trashed */ + : "=D" (sp) ,"=c" (__dummy_1) ,"=d" (__dummy_2) /* output */ \ + : "2" (f), "0" (sp), "1" (i) /* input */ \ + ); /* trashed */ \ +}) #define FAST_WRITE2_IO() \ +({ \ +int __dummy_1,__dummy_2; \ __asm__ __volatile__ ("\n \ cld \n \ orl %%ecx, %%ecx \n \ jz 1f \n \ rep \n \ - outsw %%dx \n \ + outsw %%ds:(%%esi),(%%dx) \n \ 1: " \ - : "=S" (sp) /* output */ \ - : "d" (f), "S" (sp), "c" (i) /* input */ \ - : "edx", "ecx", "esi" ) /* trashed */ - + : "=S" (sp) ,"=c" (__dummy_1) ,"=d" (__dummy_2)/* output */ \ + : "2" (f), "0" (sp), "1" (i) /* input */ \ + ); /* trashed */ \ +}) /* IN2000 io_port offsets */ #define IO_WD_ASR 0x00 /* R - 3393 auxstat reg */ diff --git a/linux/src/drivers/scsi/ppa.c b/linux/src/drivers/scsi/ppa.c index 98749dd..5063a67 100644 --- a/linux/src/drivers/scsi/ppa.c +++ b/linux/src/drivers/scsi/ppa.c @@ -470,41 +470,13 @@ static inline void ecp_sync(unsigned short ppb) static inline int ppa_byte_out(unsigned short base, char *buffer, unsigned int len) { - /* - * %eax scratch - * %ebx Data to transfer - * %ecx Counter (Don't touch!!) - * %edx Port - * %esi Source buffer (mem pointer) - * - * In case you are wondering what the last line of the asm does... - * <output allocation> : <input allocation> : <trashed registers> - */ - asm("shr $2,%%ecx\n" \ - " jz .no_more_bulk_bo\n" \ - " .align 4\n" \ - ".loop_bulk_bo:\n" \ - " movl (%%esi),%%ebx\n" \ - BYTE_OUT(%%bl) \ - BYTE_OUT(%%bh) \ - " rorl $16,%%ebx\n" \ - BYTE_OUT(%%bl) \ - BYTE_OUT(%%bh) \ - " addl $4,%%esi\n" \ - " loop .loop_bulk_bo\n" \ - " .align 4\n" \ - ".no_more_bulk_bo:" \ - : "=S"(buffer): "c"(len), "d"(base), "S"(buffer):"eax", "ebx", "ecx"); - - asm("andl $3,%%ecx\n" \ - " jz .no_more_loose_bo\n" \ - " .align 4\n" \ - ".loop_loose_bo:\n" \ - BYTE_OUT((%%esi)) \ - " incl %%esi\n" \ - " loop .loop_loose_bo\n" \ - ".no_more_loose_bo:\n" \ - : /* no output */ : "c"(len), "d"(base), "S"(buffer):"eax", "ebx", "ecx"); + int i; + + for (i = len; i; i--) { + w_dtr(base, *buffer++); + w_ctr(base, 0xe); + w_ctr(base, 0xc); + } return 1; /* All went well - we hope! */ } @@ -520,42 +492,13 @@ static inline int ppa_byte_out(unsigned short base, char *buffer, unsigned int l static inline int ppa_byte_in(unsigned short base, char *buffer, int len) { - /* - * %eax scratch - * %ebx Data to transfer - * %ecx Counter (Don't touch!!) - * %edx Port - * %esi Source buffer (mem pointer) - * - * In case you are wondering what the last line of the asm does... - * <output allocation> : <input allocation> : <trashed registers> - */ - asm("shr $2,%%ecx\n" \ - " jz .no_more_bulk_bi\n" \ - " .align 4\n" \ - ".loop_bulk_bi:\n" \ - BYTE_IN(%%bl) \ - BYTE_IN(%%bh) \ - " rorl $16,%%ebx\n" \ - BYTE_IN(%%bl) \ - BYTE_IN(%%bh) \ - " rorl $16,%%ebx\n" \ - " movl %%ebx,(%%esi)\n" \ - " addl $4,%%esi\n" \ - " loop .loop_bulk_bi\n" \ - " .align 4\n" \ - ".no_more_bulk_bi:" \ - : "=S"(buffer): "c"(len), "d"(base), "S"(buffer):"eax", "ebx", "ecx"); - - asm("andl $3,%%ecx\n" \ - " jz .no_more_loose_bi\n" \ - " .align 4\n" \ - ".loop_loose_bi:\n" \ - BYTE_IN((%%esi)) \ - " incl %%esi\n" \ - " loop .loop_loose_bi\n" \ - ".no_more_loose_bi:\n" \ - : /* no output */ : "c"(len), "d"(base), "S"(buffer):"eax", "ebx", "ecx"); + int i; + + for (i = len; i; i--) { + *buffer++ = r_dtr(base); + w_ctr(base, 0x27); + w_ctr(base, 0x25); + } return 1; /* All went well - we hope! */ } @@ -577,42 +520,14 @@ static inline int ppa_byte_in(unsigned short base, char *buffer, int len) static inline int ppa_nibble_in(unsigned short str_p, char *buffer, int len) { - /* - * %eax scratch - * %ebx Data to transfer - * %ecx Counter (Don't touch!!) - * %edx Port - * %esi Source buffer (mem pointer) - * - * In case you are wondering what the last line of the asm does... - * <output allocation> : <input allocation> : <trashed registers> - */ - asm("shr $2,%%ecx\n" \ - " jz .no_more_bulk_ni\n" \ - " .align 4\n" \ - ".loop_bulk_ni:\n" \ - NIBBLE_IN(%%bl) \ - NIBBLE_IN(%%bh) \ - " rorl $16,%%ebx\n" \ - NIBBLE_IN(%%bl) \ - NIBBLE_IN(%%bh) \ - " rorl $16,%%ebx\n" \ - " movl %%ebx,(%%esi)\n" \ - " addl $4,%%esi\n" \ - " loop .loop_bulk_ni\n" \ - " .align 4\n" \ - ".no_more_bulk_ni:" \ - : "=S"(buffer): "c"(len), "d"(str_p), "S"(buffer):"eax", "ebx", "ecx"); - - asm("andl $3,%%ecx\n" \ - " jz .no_more_loose_ni\n" \ - " .align 4\n" \ - ".loop_loose_ni:\n" \ - NIBBLE_IN((%%esi)) \ - " incl %%esi\n" \ - " loop .loop_loose_ni\n" \ - ".no_more_loose_ni:\n" \ - : /* no output */ : "c"(len), "d"(str_p), "S"(buffer):"eax", "ebx", "ecx"); + for (; len; len--) { + unsigned char h; + + w_ctr(base, 0x4); + h = r_str(base) & 0xf0; + w_ctr(base, 0x6); + *buffer++ = h | ((r_str(base) & 0xf0) >> 4); + } return 1; /* All went well - we hope! */ } #else /* Old style C routines */ |