summaryrefslogtreecommitdiff
path: root/linux/dev/drivers
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2000-07-23 00:34:12 +0000
committerMarcus Brinkmann <marcus@gnu.org>2000-07-23 00:34:12 +0000
commit91933a41184cd816cb8ce4d96cf8764ebd7dde8c (patch)
tree18d263f9e1f1a851a1cd13851a2acba48b2e1fe6 /linux/dev/drivers
parent92976e1b4ab184ff6cf70d7bd9944ae5050c4fc3 (diff)
2000-07-04 Marcus Brinkmann <marcus@gnu.org>
* 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 <stefan.weil@de.heidelberg.com> * 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.
Diffstat (limited to 'linux/dev/drivers')
-rw-r--r--linux/dev/drivers/scsi/seagate.c178
1 files changed, 48 insertions, 130 deletions
diff --git a/linux/dev/drivers/scsi/seagate.c b/linux/dev/drivers/scsi/seagate.c
index a5acbee..c7321ea 100644
--- a/linux/dev/drivers/scsi/seagate.c
+++ b/linux/dev/drivers/scsi/seagate.c
@@ -142,6 +142,8 @@ static unsigned char irq = IRQ;
#define STATUS (*(volatile unsigned char *) st0x_cr_sr)
#define CONTROL STATUS
#define DATA (*(volatile unsigned char *) st0x_dr)
+#define WRITE_CONTROL(d) { writeb((d), st0x_cr_sr); }
+#define WRITE_DATA(d) { writeb((d), st0x_dr); }
void st0x_setup (char *str, int *ints) {
controller_type = SEAGATE;
@@ -1097,24 +1099,19 @@ if (fast && transfersize && !(len % transfersize) && (len >= transfersize)
SCint->transfersize, len, data);
#endif
- __asm__("
- cld;
-"
+ {
#ifdef FAST32
-" shr $2, %%ecx;
-1: lodsl;
- movl %%eax, (%%edi);
-"
+ unsigned int *iop = phys_to_virt (st0x_dr);
+ const unsigned int *dp = (unsigned int *) data;
+ int xferlen = transfersize >> 2;
#else
-"1: lodsb;
- movb %%al, (%%edi);
-"
+ unsigned char *iop = phys_to_virt (st0x_dr);
+ const unsigned char *dp = data;
+ int xferlen = transfersize;
#endif
-" loop 1b;" : :
- /* input */
- "D" (st0x_dr), "S" (data), "c" (SCint->transfersize) :
- /* clobbered */
- "eax", "ecx", "esi" );
+ for (; xferlen; --xferlen)
+ *iop = *dp++;
+ }
len -= transfersize;
data += transfersize;
@@ -1133,55 +1130,20 @@ if (fast && transfersize && !(len % transfersize) && (len >= transfersize)
* We loop as long as we are in a data out phase, there is data to send,
* and BSY is still active.
*/
- __asm__ (
-
-/*
- Local variables :
- len = ecx
- data = esi
- st0x_cr_sr = ebx
- st0x_dr = edi
-
- Test for any data here at all.
-*/
- "\torl %%ecx, %%ecx
- jz 2f
-
- cld
-
- movl " SYMBOL_NAME_STR(st0x_cr_sr) ", %%ebx
- movl " SYMBOL_NAME_STR(st0x_dr) ", %%edi
-
-1: movb (%%ebx), %%al\n"
-/*
- Test for BSY
-*/
-
- "\ttest $1, %%al
- jz 2f\n"
-/*
- Test for data out phase - STATUS & REQ_MASK should be REQ_DATAOUT, which is 0.
-*/
- "\ttest $0xe, %%al
- jnz 2f \n"
-/*
- Test for REQ
-*/
- "\ttest $0x10, %%al
- jz 1b
- lodsb
- movb %%al, (%%edi)
- loop 1b
-
-2:
- ":
-/* output */
-"=S" (data), "=c" (len) :
-/* input */
-"0" (data), "1" (len) :
-/* clobbered */
-"eax", "ebx", "edi");
+ while (len)
+ {
+ unsigned char stat;
+
+ stat = STATUS;
+ if (!(stat & STAT_BSY) || ((stat & REQ_MASK) != REQ_DATAOUT))
+ break;
+ if (stat & STAT_REQ)
+ {
+ WRITE_DATA (*data++);
+ --len;
+ }
+ }
}
if (!len && nobuffs) {
@@ -1223,25 +1185,19 @@ if (fast && transfersize && !(len % transfersize) && (len >= transfersize)
" len = %d, data = %08x\n", hostno, SCint->underflow,
SCint->transfersize, len, data);
#endif
- __asm__("
- cld;
-"
+ {
#ifdef FAST32
-" shr $2, %%ecx;
-1: movl (%%esi), %%eax;
- stosl;
-"
+ const unsigned int *iop = phys_to_virt (st0x_dr);
+ unsigned int *dp = (unsigned int *) data;
+ int xferlen = len >> 2;
#else
-"1: movb (%%esi), %%al;
- stosb;
-"
+ const unsigned char *iop = phys_to_virt (st0x_dr);
+ unsigned char *dp = data;
+ int xferlen = len;
#endif
-
-" loop 1b;" : :
- /* input */
- "S" (st0x_dr), "D" (data), "c" (SCint->transfersize) :
- /* clobbered */
- "eax", "ecx", "edi");
+ for (; xferlen; --xferlen)
+ *dp++ = *iop;
+ }
len -= transfersize;
data += transfersize;
@@ -1271,57 +1227,19 @@ if (fast && transfersize && !(len % transfersize) && (len >= transfersize)
* and BSY is still active
*/
- __asm__ (
-/*
- Local variables :
- ecx = len
- edi = data
- esi = st0x_cr_sr
- ebx = st0x_dr
-
- Test for room to read
-*/
- "\torl %%ecx, %%ecx
- jz 2f
-
- cld
- movl " SYMBOL_NAME_STR(st0x_cr_sr) ", %%esi
- movl " SYMBOL_NAME_STR(st0x_dr) ", %%ebx
-
-1: movb (%%esi), %%al\n"
-/*
- Test for BSY
-*/
-
- "\ttest $1, %%al
- jz 2f\n"
-
-/*
- Test for data in phase - STATUS & REQ_MASK should be REQ_DATAIN, = STAT_IO, which is 4.
-*/
- "\tmovb $0xe, %%ah
- andb %%al, %%ah
- cmpb $0x04, %%ah
- jne 2f\n"
-
-/*
- Test for REQ
-*/
- "\ttest $0x10, %%al
- jz 1b
-
- movb (%%ebx), %%al
- stosb
- loop 1b\n"
-
-"2:\n"
- :
-/* output */
-"=D" (data), "=c" (len) :
-/* input */
-"0" (data), "1" (len) :
-/* clobbered */
-"eax","ebx", "esi");
+ while (len)
+ {
+ unsigned char stat;
+
+ stat = STATUS;
+ if (!(stat & STAT_BSY) || ((stat & REQ_MASK) != REQ_DATAIN))
+ break;
+ if (stat & STAT_REQ)
+ {
+ *data++ = DATA;
+ --len;
+ }
+ }
#if (DEBUG & PHASE_DATAIN)
printk("scsi%d: transfered -= %d\n", hostno, len);