diff options
author | bde <bde@FreeBSD.org> | 1998-04-15 17:26:17 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1998-04-15 17:26:17 +0000 |
commit | 37b60f29dd0d528b8bc950b0b559f304b73db9ec (patch) | |
tree | 8062757c455ad3c2f5a278b5068fb58129b757c8 | |
parent | b7f7670c8a01c82d8ed45eb3a4643ac0f7d944b0 (diff) | |
download | FreeBSD-src-37b60f29dd0d528b8bc950b0b559f304b73db9ec.zip FreeBSD-src-37b60f29dd0d528b8bc950b0b559f304b73db9ec.tar.gz |
Support compiling with `gcc -ansi'. Fix missing `volatile's in __asm()
statements while I'm here.
-rw-r--r-- | sys/i386/i386/in_cksum.c | 14 | ||||
-rw-r--r-- | sys/i386/isa/seagate.c | 16 |
2 files changed, 17 insertions, 13 deletions
diff --git a/sys/i386/i386/in_cksum.c b/sys/i386/i386/in_cksum.c index d3b02e3..7250798 100644 --- a/sys/i386/i386/in_cksum.c +++ b/sys/i386/i386/in_cksum.c @@ -32,7 +32,7 @@ * * from tahoe: in_cksum.c 1.2 86/01/05 * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91 - * $Id: in_cksum.c,v 1.11 1997/08/16 19:14:52 wollman Exp $ + * $Id: in_cksum.c,v 1.12 1997/09/02 20:05:27 bde Exp $ */ #include <sys/param.h> @@ -62,10 +62,14 @@ * Thanks to gcc we don't have to guess * which registers contain sum & w. */ -#define ADD(n) asm("addl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (w)) -#define ADDC(n) asm("adcl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (w)) -#define LOAD(n) asm volatile("movb " #n "(%1), %0" : "=r" (junk) : "r" (w)) -#define MOP asm("adcl $0, %0" : "=r" (sum) : "0" (sum)) +#define ADD(n) __asm __volatile \ + ("addl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (w)) +#define ADDC(n) __asm __volatile \ + ("adcl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (w)) +#define LOAD(n) __asm __volatile \ + ("movb " #n "(%1), %0" : "=r" (junk) : "r" (w)) +#define MOP __asm __volatile \ + ("adcl $0, %0" : "=r" (sum) : "0" (sum)) int in_cksum(m, len) diff --git a/sys/i386/isa/seagate.c b/sys/i386/isa/seagate.c index 43ff3da..939f037 100644 --- a/sys/i386/isa/seagate.c +++ b/sys/i386/isa/seagate.c @@ -60,7 +60,7 @@ * that category, with the possible exception of scanners and * some of the older MO drives. * - * $Id: seagate.c,v 1.26 1997/09/21 21:41:35 gibbs Exp $ + * $Id: seagate.c,v 1.27 1997/11/07 09:20:30 phk Exp $ */ /* @@ -779,9 +779,9 @@ void sea_timeout (void *arg) * after every MSGOUT, MSGIN, CMDOUT, STATIN request. * Return true if REQ deassert found. */ -static inline int sea_wait_for_req_deassert (adapter_t *z, int cnt, char *msg) +static __inline int sea_wait_for_req_deassert (adapter_t *z, int cnt, char *msg) { - asm (" + __asm __volatile (" 1: testb $0x10, %2 jz 2f loop 1b @@ -1073,7 +1073,7 @@ void sea_data_output (adapter_t *z, u_char **pdata, u_long *plen) if (len && !(len % BLOCK_SIZE)) { while (len) { WAITFOR10 (*z->STATUS & STAT_REQ, "blind block read"); - asm(" + __asm __volatile (" shr $2, %%ecx; cld; rep; @@ -1085,7 +1085,7 @@ void sea_data_output (adapter_t *z, u_char **pdata, u_long *plen) } } else { #endif - asm ("cld + __asm __volatile ("cld 1: movb (%%ebx), %%al xorb $1, %%al testb $0xf, %%al @@ -1120,7 +1120,7 @@ void sea_data_input (adapter_t *z, u_char **pdata, u_long *plen) if (len && !(len % BLOCK_SIZE)) { while (len) { WAITFOR10 (*z->STATUS & STAT_REQ, "blind block read"); - asm(" + __asm __volatile (" shr $2, %%ecx; cld; rep; @@ -1133,7 +1133,7 @@ void sea_data_input (adapter_t *z, u_char **pdata, u_long *plen) } else { #endif if (len >= 512) { - asm (" cld + __asm __volatile (" cld 1: movb (%%esi), %%al xorb $5, %%al testb $0xf, %%al @@ -1149,7 +1149,7 @@ void sea_data_input (adapter_t *z, u_char **pdata, u_long *plen) "0" (data), "1" (len) /* input */ : "eax", "ebx", "esi"); /* clobbered */ } else { - asm (" cld + __asm __volatile (" cld 1: movb (%%esi), %%al xorb $5, %%al testb $0xf, %%al |