diff options
author | Marc Espie <espie@cvs.openbsd.org> | 1999-01-31 14:56:02 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 1999-01-31 14:56:02 +0000 |
commit | c2ae597a496a66466fb1cd1fb02d5d450e3b06a8 (patch) | |
tree | 8da2c08f5a970c698efdcaa487d13cea5bc07a05 /sys/dev/isa | |
parent | fd89b8127a42f7f1e8364d5b93d3f95a23fe1f59 (diff) |
Fix clobbers so that GENERIC may compile with egcs.
Historically, the documentation of extended asm was lacking, namely you
should NOT specify the same register as an input, and a clobber.
If the register is clobbered, it should be specified as an output as well,
e.g., by linking input and output through the "number" notation.
(Beware of lvalues, some local variables needed...)
In older versions, up-to egcs1.1.1, the compiler did not even warn about
it, but it was liable to output bad code. Newer egcs are pickier and
simply refuse to swallow such code.
Diffstat (limited to 'sys/dev/isa')
-rw-r--r-- | sys/dev/isa/seagate.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/sys/dev/isa/seagate.c b/sys/dev/isa/seagate.c index 4d7d9755480..fcba075b106 100644 --- a/sys/dev/isa/seagate.c +++ b/sys/dev/isa/seagate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: seagate.c,v 1.12 1999/01/07 06:14:49 niklas Exp $ */ +/* $OpenBSD: seagate.c,v 1.13 1999/01/31 14:56:01 espie Exp $ */ /* * ST01/02, Future Domain TMC-885, TMC-950 SCSI driver @@ -1304,33 +1304,38 @@ sea_information_transfer(sea) if ((tmp & PH_MASK) != phase) break; if (!(phase & STAT_IO)) { + int block = BLOCK_SIZE; + void *a = sea->maddr_dr; #ifdef SEA_ASSEMBLER asm("shr $2, %%ecx\n\t\ cld\n\t\ rep\n\t\ movsl" : - "=S" (scb->data) : + "=S" (scb->data), + "=c" (block) , + "=D" (a) : "0" (scb->data), - "D" (sea->maddr_dr), - "c" (BLOCK_SIZE) : - "%ecx", "%edi"); + "2" (a), + "1" (block) ); #else for (count = 0; count < BLOCK_SIZE; count++) DATA = *(scb->data++); #endif - } else { + } else { + int block = BLOCK_SIZE; + void *a = sea->maddr_dr; #ifdef SEA_ASSEMBLER asm("shr $2, %%ecx\n\t\ cld\n\t\ rep\n\t\ movsl" : - "=D" (scb->data) : - "S" (sea->maddr_dr), + "=D" (scb->data), "=c" (block) , + "=S" (a) : "0" (scb->data), - "c" (BLOCK_SIZE) : - "%ecx", "%esi"); + "2" (a) , + "1" (block) ); #else for (count = 0; count < BLOCK_SIZE; |