summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/i386/include/bus.h188
-rw-r--r--sys/arch/i386/include/pio.h35
-rw-r--r--sys/arch/i386/isa/clock.c14
-rw-r--r--sys/arch/i386/stand/libsa/pciprobe.c6
4 files changed, 121 insertions, 122 deletions
diff --git a/sys/arch/i386/include/bus.h b/sys/arch/i386/include/bus.h
index df4405b5f54..3a2b312b9d3 100644
--- a/sys/arch/i386/include/bus.h
+++ b/sys/arch/i386/include/bus.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus.h,v 1.13 1998/10/04 22:33:41 niklas Exp $ */
+/* $OpenBSD: bus.h,v 1.14 1999/01/31 14:56:01 espie Exp $ */
/* $NetBSD: bus.h,v 1.6 1996/11/10 03:19:25 thorpej Exp $ */
/*-
@@ -143,45 +143,45 @@ void bus_space_free __P((bus_space_tag_t t, bus_space_handle_t bsh,
#define bus_space_read_multi_1(t, h, o, a, c) do { \
if ((t) == I386_BUS_SPACE_IO) { \
insb((h) + (o), (a), (c)); \
- } else { \
+ } else {void *_addr=(a); int _cnt=(c); \
__asm __volatile(" \
cld ; \
- 1: movb (%0),%%al ; \
+ 1: movb (%2),%%al ; \
stosb ; \
loop 1b" : \
- : \
- "r" ((h) + (o)), "D" ((a)), "c" ((c)) : \
- "%edi", "%ecx", "%eax", "memory"); \
+ "=D" (_addr), "=c" (_cnt) : \
+ "r" ((h) + (o)), "0" (_addr), "1" (_cnt) : \
+ "%eax", "memory"); \
} \
} while (0)
#define bus_space_read_multi_2(t, h, o, a, c) do { \
if ((t) == I386_BUS_SPACE_IO) { \
insw((h) + (o), (a), (c)); \
- } else { \
+ } else {void *_addr=(a); int _cnt=(c); \
__asm __volatile(" \
cld ; \
- 1: movw (%0),%%ax ; \
+ 1: movw (%2),%%ax ; \
stosw ; \
loop 1b" : \
- : \
- "r" ((h) + (o)), "D" ((a)), "c" ((c)) : \
- "%edi", "%ecx", "%eax", "memory"); \
+ "=D" (_addr), "=c" (_cnt) : \
+ "r" ((h) + (o)), "0" (_addr), "1" (_cnt) : \
+ "%eax", "memory"); \
} \
} while (0)
#define bus_space_read_multi_4(t, h, o, a, c) do { \
if ((t) == I386_BUS_SPACE_IO) { \
insl((h) + (o), (a), (c)); \
- } else { \
+ } else {void *_addr=(a); int _cnt=(c); \
__asm __volatile(" \
cld ; \
- 1: movl (%0),%%eax ; \
+ 1: movl (%2),%%eax ; \
stosl ; \
loop 1b" : \
- : \
- "r" ((h) + (o)), "D" ((a)), "c" ((c)) : \
- "%edi", "%ecx", "%eax", "memory"); \
+ "=D" (_addr), "=c" (_cnt) : \
+ "r" ((h) + (o)), "0" (_addr), "1" (_cnt) : \
+ "%eax", "memory"); \
} \
} while (0)
@@ -221,68 +221,71 @@ void bus_space_free __P((bus_space_tag_t t, bus_space_handle_t bsh,
*/
#define bus_space_read_region_1(t, h, o, a, c) do { \
+ int _cnt = (c); void *_addr = (a); int _port = (h)+(o); \
if ((t) == I386_BUS_SPACE_IO) { \
__asm __volatile(" \
cld ; \
- 1: inb %w0,%%al ; \
+ 1: inb %w2,%%al ; \
stosb ; \
- incl %0 ; \
+ incl %2 ; \
loop 1b" : \
- : \
- "d" ((h) + (o)), "D" ((a)), "c" ((c)) : \
- "%edx", "%edi", "%ecx", "%eax", "memory"); \
+ "=D" (_addr), "=c" (_cnt), "=d" (_port) : \
+ "0" (_addr), "1" (_cnt), "2" (_port) : \
+ "%eax", "memory", "cc"); \
} else { \
__asm __volatile(" \
cld ; \
repne ; \
movsb" : \
- : \
- "S" ((h) + (o)), "D" ((a)), "c" ((c)) : \
- "%esi", "%edi", "%ecx", "memory"); \
+ "=D" (_addr), "=c" (_cnt), "=S" (_port) : \
+ "0" (_addr), "1" (_cnt), "2" (_port) : \
+ "memory", "cc"); \
} \
} while (0)
#define bus_space_read_region_2(t, h, o, a, c) do { \
+ int _cnt = (c); void *_addr = (a); int _port = (h)+(o); \
if ((t) == I386_BUS_SPACE_IO) { \
__asm __volatile(" \
cld ; \
- 1: inw %w0,%%ax ; \
+ 1: inw %w2,%%ax ; \
stosw ; \
- addl $2,%0 ; \
+ addl $2,%2 ; \
loop 1b" : \
- : \
- "d" ((h) + (o)), "D" ((a)), "c" ((c)) : \
- "%edx", "%edi", "%ecx", "%eax", "memory"); \
+ "=D" (_addr), "=c" (_cnt), "=d" (_port) : \
+ "0" (_addr), "1" (_cnt), "2" (_port) : \
+ "%eax", "memory", "cc"); \
} else { \
__asm __volatile(" \
cld ; \
repne ; \
movsw" : \
- : \
- "S" ((h) + (o)), "D" ((a)), "c" ((c)) : \
- "%esi", "%edi", "%ecx", "memory"); \
+ "=D" (_addr), "=c" (_cnt), "=S" (_port) : \
+ "0" (_addr), "1" (_cnt), "2" (_port) : \
+ "memory", "cc"); \
} \
} while (0)
#define bus_space_read_region_4(t, h, o, a, c) do { \
+ int _cnt = (c); void *_addr = (a); int _port = (h)+(o); \
if ((t) == I386_BUS_SPACE_IO) { \
__asm __volatile(" \
cld ; \
- 1: inl %w0,%%eax ; \
+ 1: inl %w2,%%eax ; \
stosl ; \
- addl $4,%0 ; \
+ addl $4,%2 ; \
loop 1b" : \
- : \
- "d" ((h) + (o)), "D" ((a)), "c" ((c)) : \
- "%edx", "%edi", "%ecx", "%eax", "memory"); \
+ "=D" (_addr), "=c" (_cnt), "=d" (_port) : \
+ "0" (_addr), "1" (_cnt), "2" (_port) : \
+ "%eax", "memory", "cc"); \
} else { \
__asm __volatile(" \
cld ; \
repne ; \
movsl" : \
- : \
- "S" ((h) + (o)), "D" ((a)), "c" ((c)) : \
- "%esi", "%edi", "%ecx", "memory"); \
+ "=D" (_addr), "=c" (_cnt), "=S" (_port) : \
+ "0" (_addr), "1" (_cnt), "2" (_port) : \
+ "memory", "cc"); \
} \
} while (0)
@@ -358,45 +361,45 @@ void bus_space_free __P((bus_space_tag_t t, bus_space_handle_t bsh,
#define bus_space_write_multi_1(t, h, o, a, c) do { \
if ((t) == I386_BUS_SPACE_IO) { \
outsb((h) + (o), (a), (c)); \
- } else { \
+ } else {const void *_addr=(a); int _cnt=(c); \
__asm __volatile(" \
cld ; \
1: lodsb ; \
- movb %%al,(%0) ; \
+ movb %%al,(%2) ; \
loop 1b" : \
- : \
- "r" ((h) + (o)), "S" ((a)), "c" ((c)) : \
- "%esi", "%ecx", "%eax"); \
+ "=S" (_addr), "=c" (_cnt) : \
+ "r" ((h) + (o)), "0" (_addr), "1" (_cnt) : \
+ "%eax", "memory", "cc"); \
} \
} while (0)
#define bus_space_write_multi_2(t, h, o, a, c) do { \
if ((t) == I386_BUS_SPACE_IO) { \
outsw((h) + (o), (a), (c)); \
- } else { \
+ } else {const void *_addr=(a); int _cnt=(c); \
__asm __volatile(" \
cld ; \
1: lodsw ; \
- movw %%ax,(%0) ; \
+ movw %%ax,(%2) ; \
loop 1b" : \
- : \
- "r" ((h) + (o)), "S" ((a)), "c" ((c)) : \
- "%esi", "%ecx", "%eax"); \
+ "=S" (_addr), "=c" (_cnt) : \
+ "r" ((h) + (o)), "0" (_addr), "1" (_cnt) : \
+ "%eax", "memory", "cc"); \
} \
} while (0)
#define bus_space_write_multi_4(t, h, o, a, c) do { \
if ((t) == I386_BUS_SPACE_IO) { \
outsl((h) + (o), (a), (c)); \
- } else { \
+ } else {const void *_addr=(a); int _cnt=(c); \
__asm __volatile(" \
cld ; \
1: lodsl ; \
- movl %%eax,(%0) ; \
+ movl %%eax,(%2) ; \
loop 1b" : \
- : \
- "r" ((h) + (o)), "S" ((a)), "c" ((c)) : \
- "%esi", "%ecx", "%eax"); \
+ "=S" (_addr), "=c" (_cnt) : \
+ "r" ((h) + (o)), "0" (_addr), "1" (_cnt) : \
+ "%eax", "memory", "cc"); \
} \
} while (0)
@@ -436,6 +439,7 @@ void bus_space_free __P((bus_space_tag_t t, bus_space_handle_t bsh,
*/
#define bus_space_write_region_1(t, h, o, a, c) do { \
+ int _port = (h)+(o); void *_addr=(a); int _cnt=(c); \
if ((t) == I386_BUS_SPACE_IO) { \
__asm __volatile(" \
cld ; \
@@ -443,21 +447,22 @@ void bus_space_free __P((bus_space_tag_t t, bus_space_handle_t bsh,
outb %%al,%w0 ; \
incl %0 ; \
loop 1b" : \
- : \
- "d" ((h) + (o)), "S" ((a)), "c" ((c)) : \
- "%edx", "%esi", "%ecx", "%eax", "memory"); \
+ "=d" (_port), "=S" (_addr), "=c" (_cnt) : \
+ "0" (_port), "1" (_addr), "2" (_cnt) : \
+ "%eax", "memory", "cc"); \
} else { \
__asm __volatile(" \
cld ; \
repne ; \
movsb" : \
- : \
- "D" ((h) + (o)), "S" ((a)), "c" ((c)) : \
- "%edi", "%esi", "%ecx", "memory"); \
+ "=D" (_port), "=S" (_addr), "=c" (_cnt) : \
+ "0" (_port), "1" (_addr), "2" (_cnt) : \
+ "memory", "cc"); \
} \
} while (0)
#define bus_space_write_region_2(t, h, o, a, c) do { \
+ int _port = (h)+(o); void *_addr=(a); int _cnt=(c); \
if ((t) == I386_BUS_SPACE_IO) { \
__asm __volatile(" \
cld ; \
@@ -465,21 +470,22 @@ void bus_space_free __P((bus_space_tag_t t, bus_space_handle_t bsh,
outw %%ax,%w0 ; \
addl $2,%0 ; \
loop 1b" : \
- : \
- "d" ((h) + (o)), "S" ((a)), "c" ((c)) : \
- "%edx", "%esi", "%ecx", "%eax", "memory"); \
+ "=d" (_port), "=S" (_addr), "=c" (_cnt) : \
+ "0" (_port), "1" (_addr), "2" (_cnt) : \
+ "%eax", "memory", "cc"); \
} else { \
__asm __volatile(" \
cld ; \
repne ; \
movsw" : \
- : \
- "D" ((h) + (o)), "S" ((a)), "c" ((c)) : \
- "%edi", "%esi", "%ecx", "memory"); \
+ "=D" (_port), "=S" (_addr), "=c" (_cnt) : \
+ "0" (_port), "1" (_addr), "2" (_cnt) : \
+ "memory", "cc"); \
} \
} while (0)
#define bus_space_write_region_4(t, h, o, a, c) do { \
+ int _port = (h)+(o); void *_addr=(a); int _cnt=(c); \
if ((t) == I386_BUS_SPACE_IO) { \
__asm __volatile(" \
cld ; \
@@ -487,17 +493,17 @@ void bus_space_free __P((bus_space_tag_t t, bus_space_handle_t bsh,
outl %%eax,%w0 ; \
addl $4,%0 ; \
loop 1b" : \
- : \
- "d" ((h) + (o)), "S" ((a)), "c" ((c)) : \
- "%edx", "%esi", "%ecx", "%eax", "memory"); \
+ "=d" (_port), "=S" (_addr), "=c" (_cnt) : \
+ "0" (_port), "1" (_addr), "2" (_cnt) : \
+ "%eax", "memory", "cc"); \
} else { \
__asm __volatile(" \
cld ; \
repne ; \
movsl" : \
- : \
- "D" ((h) + (o)), "S" ((a)), "c" ((c)) : \
- "%edi", "%esi", "%ecx", "memory"); \
+ "=D" (_port), "=S" (_addr), "=c" (_cnt) : \
+ "0" (_port), "1" (_addr), "2" (_cnt) : \
+ "memory", "cc"); \
} \
} while (0)
@@ -612,62 +618,62 @@ void bus_space_free __P((bus_space_tag_t t, bus_space_handle_t bsh,
*/
#define bus_space_set_region_1(t, h, o, v, c) do { \
+ int _port = (h)+(o); int _cnt = (c); \
if ((t) == I386_BUS_SPACE_IO) { \
__asm __volatile(" \
1: outb %%al,%w0 ; \
incl %0 ; \
loop 1b" : \
- : \
- "d" ((h) + (o)), "c" ((c)), "a" ((v)) : \
- "%edx", "%ecx", "%eax"); \
+ "=d" (_port), "=c" (_cnt) : \
+ "0" (_port), "1" (_cnt), "a" ((v))); \
} else { \
__asm __volatile(" \
cld ; \
repne ; \
stosb" : \
- : \
- "D" ((h) + (o)), "c" ((c)), "a" ((v)) : \
- "%edi", "%ecx", "%eax", "memory"); \
+ "=D" (_port), "=c" (_cnt) : \
+ "0" (_port), "1" (_cnt), "a" ((v)) : \
+ "memory"); \
} \
} while (0)
#define bus_space_set_region_2(t, h, o, v, c) do { \
+ int _port = (h)+(o); int _cnt = (c); \
if ((t) == I386_BUS_SPACE_IO) { \
__asm __volatile(" \
1: outw %%ax,%w0 ; \
addl $2, %0 ; \
loop 1b" : \
- : \
- "d" ((h) + (o)), "c" ((c)), "a" ((v)) : \
- "%edx", "%ecx", "%eax"); \
+ "=d" (_port), "=c" (_cnt) : \
+ "0" (_port), "1" (_cnt), "a" ((v))); \
} else { \
__asm __volatile(" \
cld ; \
repne ; \
stosw" : \
- : \
- "D" ((h) + (o)), "c" ((c)), "a" ((v)) : \
- "%edi", "%ecx", "%eax", "memory"); \
+ "=D" (_port), "=c" (_cnt) : \
+ "0" (_port), "1" (_cnt), "a" ((v)) : \
+ "memory"); \
} \
} while (0)
#define bus_space_set_region_4(t, h, o, v, c) do { \
+ int _port = (h)+(o); int _cnt = (c); \
if ((t) == I386_BUS_SPACE_IO) { \
__asm __volatile(" \
1: outl %%eax,%w0 ; \
addl $4, %0 ; \
loop 1b" : \
- : \
- "d" ((h) + (o)), "c" ((c)), "a" ((v)) : \
- "%edx", "%ecx", "%eax"); \
+ "=d" (_port), "=c" (_cnt) : \
+ "0" (_port), "1" (_cnt), "a" ((v))); \
} else { \
__asm __volatile(" \
cld ; \
repne ; \
stosl" : \
- : \
- "D" ((h) + (o)), "c" ((c)), "a" ((v)) : \
- "%edi", "%ecx", "%eax", "memory"); \
+ "=D" (_port), "=c" (_cnt) : \
+ "0" (_port), "1" (_cnt), "a" ((v)) : \
+ "memory"); \
} \
} while (0)
diff --git a/sys/arch/i386/include/pio.h b/sys/arch/i386/include/pio.h
index 47ee837e109..eaabb04b296 100644
--- a/sys/arch/i386/include/pio.h
+++ b/sys/arch/i386/include/pio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pio.h,v 1.5 1997/11/10 23:40:45 niklas Exp $ */
+/* $OpenBSD: pio.h,v 1.6 1999/01/31 14:56:01 espie Exp $ */
/* $NetBSD: pio.h,v 1.13 1996/03/08 20:15:23 cgd Exp $ */
/*
@@ -77,9 +77,9 @@ static __inline void
insb(int port, void *addr, int cnt)
{
__asm __volatile("cld\n\trepne\n\tinsb" :
- :
- "d" (port), "D" (addr), "c" (cnt) :
- "%edi", "%ecx", "memory");
+ "=D" (addr), "=c" (cnt) :
+ "d" (port), "0" (addr), "1" (cnt) :
+ "memory");
}
#define inw(port) \
@@ -105,9 +105,9 @@ static __inline void
insw(int port, void *addr, int cnt)
{
__asm __volatile("cld\n\trepne\n\tinsw" :
- :
- "d" (port), "D" (addr), "c" (cnt) :
- "%edi", "%ecx", "memory");
+ "=D" (addr), "=c" (cnt) :
+ "d" (port), "0" (addr), "1" (cnt) :
+ "memory");
}
#define inl(port) \
@@ -133,9 +133,9 @@ static __inline void
insl(int port, void *addr, int cnt)
{
__asm __volatile("cld\n\trepne\n\tinsl" :
- :
- "d" (port), "D" (addr), "c" (cnt) :
- "%edi", "%ecx", "memory");
+ "=D" (addr), "=c" (cnt) :
+ "d" (port), "0" (addr), "1" (cnt) :
+ "memory");
}
#define outb(port, data) \
@@ -157,9 +157,8 @@ static __inline void
outsb(int port, const void *addr, int cnt)
{
__asm __volatile("cld\n\trepne\n\toutsb" :
- :
- "d" (port), "S" (addr), "c" (cnt) :
- "%esi", "%ecx");
+ "=S" (addr), "=c" (cnt) :
+ "d" (port), "0" (addr), "1" (cnt));
}
#define outw(port, data) \
@@ -181,9 +180,8 @@ static __inline void
outsw(int port, const void *addr, int cnt)
{
__asm __volatile("cld\n\trepne\n\toutsw" :
- :
- "d" (port), "S" (addr), "c" (cnt) :
- "%esi", "%ecx");
+ "=S" (addr), "=c" (cnt) :
+ "d" (port), "0" (addr), "1" (cnt));
}
#define outl(port, data) \
@@ -205,9 +203,8 @@ static __inline void
outsl(int port, const void *addr, int cnt)
{
__asm __volatile("cld\n\trepne\n\toutsl" :
- :
- "d" (port), "S" (addr), "c" (cnt) :
- "%esi", "%ecx");
+ "=S" (addr), "=c" (cnt) :
+ "d" (port), "0" (addr), "1" (cnt));
}
#endif /* _I386_PIO_H_ */
diff --git a/sys/arch/i386/isa/clock.c b/sys/arch/i386/isa/clock.c
index 4c1beee01f6..12cc6bdf252 100644
--- a/sys/arch/i386/isa/clock.c
+++ b/sys/arch/i386/isa/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.18 1999/01/13 07:26:00 niklas Exp $ */
+/* $OpenBSD: clock.c,v 1.19 1999/01/31 14:56:01 espie Exp $ */
/* $NetBSD: clock.c,v 1.39 1996/05/12 23:11:54 mycroft Exp $ */
/*-
@@ -262,14 +262,10 @@ delay(n)
n -= 5;
if (n < 0)
return;
- {register int m;
- __asm __volatile("mul %3"
- : "=a" (n), "=d" (m)
- : "0" (n), "r" (TIMER_FREQ));
- __asm __volatile("div %3"
- : "=a" (n)
- : "0" (n), "d" (m), "r" (1000000)
- : "%edx");}
+ __asm __volatile("mul %2\n\tdiv %3"
+ : "=a" (n)
+ : "0" (n), "r" (TIMER_FREQ), "r" (1000000)
+ : "%edx", "cc");
#else
/*
* Calculate ((n * TIMER_FREQ) / 1e6) without using floating point and
diff --git a/sys/arch/i386/stand/libsa/pciprobe.c b/sys/arch/i386/stand/libsa/pciprobe.c
index 7ba6d2cda55..bef46384944 100644
--- a/sys/arch/i386/stand/libsa/pciprobe.c
+++ b/sys/arch/i386/stand/libsa/pciprobe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pciprobe.c,v 1.1 1998/02/24 22:07:46 weingart Exp $ */
+/* $OpenBSD: pciprobe.c,v 1.2 1999/01/31 14:56:01 espie Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -50,8 +50,8 @@ pciprobe()
__asm __volatile(DOINT(0x1A) ";shll $8,%2; setc %b2"
: "=a" (hw_chars), "=b" (rev), "=c" (rc),
"=d" (sig), "=D" (entry32)
- : "0" (0xB101), "D" (0x0)
- : "cc", "eax", "ebx", "ecx", "edx");
+ : "0" (0xB101), "4" (0x0)
+ : "cc");
if (rc & 0xff00 || hw_chars & 0xff00)
return;