From 91933a41184cd816cb8ce4d96cf8764ebd7dde8c Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Sun, 23 Jul 2000 00:34:12 +0000 Subject: 2000-07-04 Marcus Brinkmann * debian/changelog: Add entry for new Debian upload. * linux/dev/drivers/scsi/seagate.c (WRITE_CONTROL, WRITE_DATA): Added from linux 2.2.15. (__asm__ constructs): Replace with equivalent C code from linux 2.2.15 to support gcc-2.95. * linux/src/drivers/scsi/in2000.h: Update asm code to linux 2.2.15. * linux/src/drivers/scsi/ppa.c: Replace asm code with equivalent C code from linux 2.2.15. 2000-02-06 Stefan Weil * device/subrs.c: Fixed compiler warning. * ddb/db_output.c, kern/bootstrap.c, kern/debug.c, kern/printf.c: Replaced varargs.h by stdarg.h. Fixed prototypes (const char *fmt). * ddb/db_output.h: Use prototype for db_printf. * i386/Files: removed varargs.h. * i386/i386/pit.h: Fixed compiler warning. * i386/i386at/model_dep.c: Tried to fix compiler warning. * i386/include/mach/sa/sys/varargs.h: Removed. * i386/linux/Makefile.in: Removed delay.S, added delay.c. * linux/dev/include/asm-i386/segment.h: Support gcc-2.95. * linux/dev/include/asm-i386/string.h, linux/src/include/asm-i386/string.h: Update from linux-2.2.14. * linux/dev/lib/vsprintf.c: Fixed compiler warning. * linux/src/include/asm-i386/delay.h: Update from linux-2.2.14. * linux/src/arch/i386/lib/delay.c: Copy from linux-2.2.14. * linux/src/include/asm-i386/string.h: Update from linux-2.2.14. --- linux/src/drivers/scsi/in2000.h | 23 ++++--- linux/src/drivers/scsi/ppa.c | 129 +++++++--------------------------------- 2 files changed, 36 insertions(+), 116 deletions(-) (limited to 'linux/src/drivers/scsi') 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... - * : : - */ - 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... - * : : - */ - 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... - * : : - */ - 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 */ -- cgit v1.2.3