diff options
| author | kristerw <kristerw@NetBSD.org> | 2000-03-13 21:10:24 +0000 |
|---|---|---|
| committer | kristerw <kristerw@NetBSD.org> | 2000-03-13 21:10:24 +0000 |
| commit | ce56ba78b795e89c59e59eb28ffa91feb74a63ff (patch) | |
| tree | f7f5123d194b768ecc52272f8818572126137ef1 /sys | |
| parent | 9034310694d726b843411e38dbe2b6dafbaba8df (diff) | |
Make the inline asm conform to what gcc thinks they should look like (per
discussions in http://gcc.gnu.org/ml/gcc-patches/1998-11/msg00004.html)
Approved by fvdl.
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/arch/i386/include/bus.h | 159 | ||||
| -rw-r--r-- | sys/arch/i386/include/pio.h | 47 |
2 files changed, 133 insertions, 73 deletions
diff --git a/sys/arch/i386/include/bus.h b/sys/arch/i386/include/bus.h index 07bd9e3a792..a0b0184d166 100644 --- a/sys/arch/i386/include/bus.h +++ b/sys/arch/i386/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.25 2000/01/25 22:13:21 drochner Exp $ */ +/* $NetBSD: bus.h,v 1.26 2000/03/13 21:10:24 kristerw Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -233,15 +233,17 @@ do { \ if ((t) == I386_BUS_SPACE_IO) { \ insb((h) + (o), (a), (c)); \ } else { \ + void *dummy1; \ + int dummy2; \ int __x __asm__("%eax"); \ __asm __volatile(" \ cld ; \ 1: movb (%1),%%al ; \ stosb ; \ loop 1b" : \ - "=&a" (__x) : \ - "r" ((h) + (o)), "D" ((a)), "c" ((c)) : \ - "%edi", "%ecx", "memory"); \ + "=&a" (__x), "=D" (dummy1), "=c" (dummy2) : \ + "r" ((h) + (o)), "1" ((a)), "2" ((c)) : \ + "memory"); \ } \ } while (0) @@ -252,15 +254,17 @@ do { \ if ((t) == I386_BUS_SPACE_IO) { \ insw((h) + (o), (a), (c)); \ } else { \ + void *dummy1; \ + int dummy2; \ int __x __asm__("%eax"); \ __asm __volatile(" \ cld ; \ 1: movw (%1),%%ax ; \ stosw ; \ loop 1b" : \ - "=&a" (__x) : \ - "r" ((h) + (o)), "D" ((a)), "c" ((c)) : \ - "%edi", "%ecx", "memory"); \ + "=&a" (__x), "=D" (dummy1), "=c" (dummy2) : \ + "r" ((h) + (o)), "1" ((a)), "2" ((c)) : \ + "memory"); \ } \ } while (0) @@ -271,15 +275,17 @@ do { \ if ((t) == I386_BUS_SPACE_IO) { \ insl((h) + (o), (a), (c)); \ } else { \ + void *dummy1; \ + int dummy2; \ int __x __asm__("%eax"); \ __asm __volatile(" \ cld ; \ 1: movl (%1),%%eax ; \ stosl ; \ loop 1b" : \ - "=&a" (__x) : \ - "r" ((h) + (o)), "D" ((a)), "c" ((c)) : \ - "%edi", "%ecx", "memory"); \ + "=&a" (__x), "=D" (dummy1), "=c" (dummy2) : \ + "r" ((h) + (o)), "1" ((a)), "2" ((c)) : \ + "memory"); \ } \ } while (0) @@ -300,6 +306,9 @@ do { \ #define bus_space_read_region_1(t, h, o, a, c) \ do { \ if ((t) == I386_BUS_SPACE_IO) { \ + int dummy1; \ + void *dummy2; \ + int dummy3; \ int __x __asm__("%eax"); \ __asm __volatile(" \ cld ; \ @@ -307,17 +316,21 @@ do { \ stosb ; \ incl %1 ; \ loop 1b" : \ - "=&a" (__x) : \ - "d" ((h) + (o)), "D" ((a)), "c" ((c)) : \ - "%edx", "%edi", "%ecx", "memory"); \ + "=&a" (__x), "=d" (dummy1), "=D" (dummy2), \ + "=c" (dummy3) : \ + "1" ((h) + (o)), "2" ((a)), "3" ((c)) : \ + "memory"); \ } else { \ + int dummy1; \ + void *dummy2; \ + int dummy3; \ __asm __volatile(" \ cld ; \ repne ; \ movsb" : \ - : \ - "S" ((h) + (o)), "D" ((a)), "c" ((c)) : \ - "%esi", "%edi", "%ecx", "memory"); \ + "=S" (dummy1), "=D" (dummy2), "=c" (dummy3) : \ + "0" ((h) + (o)), "1" ((a)), "2" ((c)) : \ + "memory"); \ } \ } while (0) @@ -326,6 +339,9 @@ do { \ __BUS_SPACE_ADDRESS_SANITY((a), u_int16_t, "buffer"); \ __BUS_SPACE_ADDRESS_SANITY((h) + (o), u_int16_t, "bus addr"); \ if ((t) == I386_BUS_SPACE_IO) { \ + int dummy1; \ + void *dummy2; \ + int dummy3; \ int __x __asm__("%eax"); \ __asm __volatile(" \ cld ; \ @@ -333,17 +349,21 @@ do { \ stosw ; \ addl $2,%1 ; \ loop 1b" : \ - "=&a" (__x) : \ - "d" ((h) + (o)), "D" ((a)), "c" ((c)) : \ - "%edx", "%edi", "%ecx", "memory"); \ + "=&a" (__x), "=d" (dummy1), "=D" (dummy2), \ + "=c" (dummy3) : \ + "1" ((h) + (o)), "2" ((a)), "3" ((c)) : \ + "memory"); \ } else { \ + int dummy1; \ + void *dummy2; \ + int dummy3; \ __asm __volatile(" \ cld ; \ repne ; \ movsw" : \ - : \ - "S" ((h) + (o)), "D" ((a)), "c" ((c)) : \ - "%esi", "%edi", "%ecx", "memory"); \ + "=S" (dummy1), "=D" (dummy2), "=c" (dummy3) : \ + "0" ((h) + (o)), "1" ((a)), "2" ((c)) : \ + "memory"); \ } \ } while (0) @@ -352,6 +372,9 @@ do { \ __BUS_SPACE_ADDRESS_SANITY((a), u_int32_t, "buffer"); \ __BUS_SPACE_ADDRESS_SANITY((h) + (o), u_int32_t, "bus addr"); \ if ((t) == I386_BUS_SPACE_IO) { \ + int dummy1; \ + void *dummy2; \ + int dummy3; \ int __x __asm__("%eax"); \ __asm __volatile(" \ cld ; \ @@ -359,16 +382,20 @@ do { \ stosl ; \ addl $4,%1 ; \ loop 1b" : \ - "=&a" (__x) : \ - "d" ((h) + (o)), "D" ((a)), "c" ((c)) : \ - "%edx", "%edi", "%ecx", "memory"); \ + "=&a" (__x), "=d" (dummy1), "=D" (dummy2), \ + "=c" (dummy3) : \ + "1" ((h) + (o)), "2" ((a)), "3" ((c)) : \ + "memory"); \ } else { \ + int dummy1; \ + void *dummy2; \ + int dummy3; \ __asm __volatile(" \ cld ; \ repne ; \ movsl" : \ - : \ - "S" ((h) + (o)), "D" ((a)), "c" ((c)) : \ + "=S" (dummy1), "=D" (dummy2), "=c" (dummy3) : \ + "0" ((h) + (o)), "1" ((a)), "2" ((c)) : \ "%esi", "%edi", "%ecx", "memory"); \ } \ } while (0) @@ -430,15 +457,16 @@ do { \ if ((t) == I386_BUS_SPACE_IO) { \ outsb((h) + (o), (a), (c)); \ } else { \ + void *dummy1; \ + int dummy2; \ int __x __asm__("%eax"); \ __asm __volatile(" \ cld ; \ 1: lodsb ; \ movb %%al,(%1) ; \ loop 1b" : \ - "=&a" (__x) : \ - "r" ((h) + (o)), "S" ((a)), "c" ((c)) : \ - "%esi", "%ecx"); \ + "=&a" (__x), "=S" (dummy1), "=c" (dummy2) : \ + "r" ((h) + (o)), "1" ((a)), "2" ((c))); \ } \ } while (0) @@ -449,15 +477,16 @@ do { \ if ((t) == I386_BUS_SPACE_IO) { \ outsw((h) + (o), (a), (c)); \ } else { \ + void *dummy1; \ + int dummy2; \ int __x __asm__("%eax"); \ __asm __volatile(" \ cld ; \ 1: lodsw ; \ movw %%ax,(%1) ; \ loop 1b" : \ - "=&a" (__x) : \ - "r" ((h) + (o)), "S" ((a)), "c" ((c)) : \ - "%esi", "%ecx"); \ + "=&a" (__x), "=S" (dummy1), "=c" (dummy2) : \ + "r" ((h) + (o)), "1" ((a)), "2" ((c))); \ } \ } while (0) @@ -468,15 +497,16 @@ do { \ if ((t) == I386_BUS_SPACE_IO) { \ outsl((h) + (o), (a), (c)); \ } else { \ + void *dummy1; \ + int dummy2; \ int __x __asm__("%eax"); \ __asm __volatile(" \ cld ; \ 1: lodsl ; \ movl %%eax,(%1) ; \ loop 1b" : \ - "=&a" (__x) : \ - "r" ((h) + (o)), "S" ((a)), "c" ((c)) : \ - "%esi", "%ecx"); \ + "=&a" (__x), "=S" (dummy1), "=c" (dummy2) : \ + "r" ((h) + (o)), "1" ((a)), "2" ((c))); \ } \ } while (0) @@ -497,6 +527,9 @@ do { \ #define bus_space_write_region_1(t, h, o, a, c) \ do { \ if ((t) == I386_BUS_SPACE_IO) { \ + int dummy1; \ + void *dummy2; \ + int dummy3; \ int __x __asm__("%eax"); \ __asm __volatile(" \ cld ; \ @@ -504,17 +537,21 @@ do { \ outb %%al,%w1 ; \ incl %1 ; \ loop 1b" : \ - "=&a" (__x) : \ - "d" ((h) + (o)), "S" ((a)), "c" ((c)) : \ - "%edx", "%esi", "%ecx", "memory"); \ + "=&a" (__x), "=d" (dummy1), "=S" (dummy2), \ + "=c" (dummy3) : \ + "1" ((h) + (o)), "2" ((a)), "3" ((c)) : \ + "memory"); \ } else { \ + int dummy1; \ + void *dummy2; \ + int dummy3; \ __asm __volatile(" \ cld ; \ repne ; \ movsb" : \ - : \ - "D" ((h) + (o)), "S" ((a)), "c" ((c)) : \ - "%edi", "%esi", "%ecx", "memory"); \ + "=D" (dummy1), "=S" (dummy2), "=c" (dummy3) : \ + "0" ((h) + (o)), "1" ((a)), "2" ((c)) : \ + "memory"); \ } \ } while (0) @@ -523,6 +560,9 @@ do { \ __BUS_SPACE_ADDRESS_SANITY((a), u_int16_t, "buffer"); \ __BUS_SPACE_ADDRESS_SANITY((h) + (o), u_int16_t, "bus addr"); \ if ((t) == I386_BUS_SPACE_IO) { \ + int dummy1; \ + void *dummy2; \ + int dummy3; \ int __x __asm__("%eax"); \ __asm __volatile(" \ cld ; \ @@ -530,17 +570,21 @@ do { \ outw %%ax,%w1 ; \ addl $2,%1 ; \ loop 1b" : \ - "=&a" (__x) : \ - "d" ((h) + (o)), "S" ((a)), "c" ((c)) : \ - "%edx", "%esi", "%ecx", "memory"); \ + "=&a" (__x), "=d" (dummy1), "=S" (dummy2), \ + "=c" (dummy3) : \ + "1" ((h) + (o)), "2" ((a)), "3" ((c)) : \ + "memory"); \ } else { \ + int dummy1; \ + void *dummy2; \ + int dummy3; \ __asm __volatile(" \ cld ; \ repne ; \ movsw" : \ - : \ - "D" ((h) + (o)), "S" ((a)), "c" ((c)) : \ - "%edi", "%esi", "%ecx", "memory"); \ + "=D" (dummy1), "=S" (dummy2), "=c" (dummy3) : \ + "0" ((h) + (o)), "1" ((a)), "2" ((c)) : \ + "memory"); \ } \ } while (0) @@ -549,6 +593,9 @@ do { \ __BUS_SPACE_ADDRESS_SANITY((a), u_int32_t, "buffer"); \ __BUS_SPACE_ADDRESS_SANITY((h) + (o), u_int32_t, "bus addr"); \ if ((t) == I386_BUS_SPACE_IO) { \ + int dummy1; \ + void *dummy2; \ + int dummy3; \ int __x __asm__("%eax"); \ __asm __volatile(" \ cld ; \ @@ -556,17 +603,21 @@ do { \ outl %%eax,%w1 ; \ addl $4,%1 ; \ loop 1b" : \ - "=&a" (__x) : \ - "d" ((h) + (o)), "S" ((a)), "c" ((c)) : \ - "%edx", "%esi", "%ecx", "memory"); \ + "=&a" (__x), "=d" (dummy1), "=S" (dummy2), \ + "=c" (dummy3) : \ + "1" ((h) + (o)), "2" ((a)), "3" ((c)) : \ + "memory"); \ } else { \ + int dummy1; \ + void *dummy2; \ + int dummy3; \ __asm __volatile(" \ cld ; \ repne ; \ movsl" : \ - : \ - "D" ((h) + (o)), "S" ((a)), "c" ((c)) : \ - "%edi", "%esi", "%ecx", "memory"); \ + "=D" (dummy1), "=S" (dummy2), "=c" (dummy3) : \ + "0" ((h) + (o)), "1" ((a)), "2" ((c)) : \ + "memory"); \ } \ } while (0) diff --git a/sys/arch/i386/include/pio.h b/sys/arch/i386/include/pio.h index f5b737ea3d0..901351a89c5 100644 --- a/sys/arch/i386/include/pio.h +++ b/sys/arch/i386/include/pio.h @@ -1,4 +1,4 @@ -/* $NetBSD: pio.h,v 1.14 1998/08/15 05:10:25 mycroft Exp $ */ +/* $NetBSD: pio.h,v 1.15 2000/03/13 21:10:24 kristerw Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -82,10 +82,12 @@ __inb(int port) static __inline void insb(int port, void *addr, int cnt) { + void *dummy1; + int dummy2; __asm __volatile("cld\n\trepne\n\tinsb" : - : - "d" (port), "D" (addr), "c" (cnt) : - "%edi", "%ecx", "memory"); + "=D" (dummy1), "=c" (dummy2) : + "d" (port), "0" (addr), "1" (cnt) : + "memory"); } #define inw(port) \ @@ -110,10 +112,12 @@ __inw(int port) static __inline void insw(int port, void *addr, int cnt) { + void *dummy1; + int dummy2; __asm __volatile("cld\n\trepne\n\tinsw" : - : - "d" (port), "D" (addr), "c" (cnt) : - "%edi", "%ecx", "memory"); + "=D" (dummy1), "=c" (dummy2) : + "d" (port), "0" (addr), "1" (cnt) : + "memory"); } #define inl(port) \ @@ -138,10 +142,12 @@ __inl(int port) static __inline void insl(int port, void *addr, int cnt) { + void *dummy1; + int dummy2; __asm __volatile("cld\n\trepne\n\tinsl" : - : - "d" (port), "D" (addr), "c" (cnt) : - "%edi", "%ecx", "memory"); + "=D" (dummy1), "=c" (dummy2) : + "d" (port), "0" (addr), "1" (cnt) : + "memory"); } #define outb(port, data) \ @@ -162,10 +168,11 @@ __outb(int port, u_int8_t data) static __inline void outsb(int port, void *addr, int cnt) { + void *dummy1; + int dummy2; __asm __volatile("cld\n\trepne\n\toutsb" : - : - "d" (port), "S" (addr), "c" (cnt) : - "%esi", "%ecx"); + "=S" (dummy1), "=c" (dummy2) : + "d" (port), "0" (addr), "1" (cnt)); } #define outw(port, data) \ @@ -186,10 +193,11 @@ __outw(int port, u_int16_t data) static __inline void outsw(int port, void *addr, int cnt) { + void *dummy1; + int dummy2; __asm __volatile("cld\n\trepne\n\toutsw" : - : - "d" (port), "S" (addr), "c" (cnt) : - "%esi", "%ecx"); + "=S" (dummy1), "=c" (dummy2) : + "d" (port), "0" (addr), "1" (cnt)); } #define outl(port, data) \ @@ -210,10 +218,11 @@ __outl(int port, u_int32_t data) static __inline void outsl(int port, void *addr, int cnt) { + void *dummy1; + int dummy2; __asm __volatile("cld\n\trepne\n\toutsl" : - : - "d" (port), "S" (addr), "c" (cnt) : - "%esi", "%ecx"); + "=S" (dummy1), "=c" (dummy2) : + "d" (port), "0" (addr), "1" (cnt)); } #endif /* _I386_PIO_H_ */ |
