From owner-freebsd-current Sat Nov 6 15:12: 0 1999 Delivered-To: freebsd-current@freebsd.org Received: from relay.nuxi.com (nuxi.cs.ucdavis.edu [169.237.7.38]) by hub.freebsd.org (Postfix) with ESMTP id 42FAE14F97 for ; Sat, 6 Nov 1999 15:11:49 -0800 (PST) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (root@d60-025.leach.ucdavis.edu [169.237.60.25]) by relay.nuxi.com (8.9.3/8.9.3) with ESMTP id PAA33630; Sat, 6 Nov 1999 15:11:48 -0800 (PST) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.9.3/8.9.1) id PAA05885; Sat, 6 Nov 1999 15:11:48 -0800 (PST) (envelope-from obrien) Date: Sat, 6 Nov 1999 15:11:48 -0800 From: "David O'Brien" To: Gary Jennejohn Cc: freebsd-current@freebsd.org Subject: Re: show stopper for Gcc 2.95.2 conversion Message-ID: <19991106151148.B5642@dragon.nuxi.com> Reply-To: obrien@freebsd.org References: <199911060934.KAA00510@peedub.muc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <199911060934.KAA00510@peedub.muc.de>; from garyj@peedub.muc.de on Sat, Nov 06, 1999 at 10:34:18AM +0100 X-Operating-System: FreeBSD 4.0-CURRENT Organization: The NUXI BSD group X-PGP-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Keyid: 34F9F9D5 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, Nov 06, 1999 at 10:34:18AM +0100, Gary Jennejohn wrote: > Here's a patch to bus.h which works for both EGCS and GCC 2.95.2. I have Here is the patch I've been working on (before I 1st got BDE's reply). The changes are mostly from OpenBSD + style changes for the way we do things. Can you also test this one? Index: bus.h =================================================================== RCS file: /home/ncvs/src/sys/i386/include/bus.h,v retrieving revision 1.6 diff -u -r1.6 bus.h --- bus.h 1999/08/28 00:44:07 1.6 +++ bus.h 1999/11/06 21:42:15 @@ -252,15 +252,14 @@ else #endif { - int __x __asm__("%eax"); __asm __volatile(" \n\ cld \n\ - 1: movb (%1),%%al \n\ + 1: movb (%2),%%al \n\ stosb \n\ loop 1b" : - "=&a" (__x) : - "r" (bsh + offset), "D" (addr), "c" (count) : - "%edi", "%ecx", "memory"); + "=D" (addr), "=c" (count) : + "r" (bsh + offset), "0" (addr), "1" (count) : + "%eax", "memory"); } #endif } @@ -280,15 +279,14 @@ else #endif { - int __x __asm__("%eax"); __asm __volatile(" \n\ cld \n\ - 1: movw (%1),%%ax \n\ + 1: movw (%2),%%ax \n\ stosw \n\ loop 1b" : - "=&a" (__x) : - "r" (bsh + offset), "D" (addr), "c" (count) : - "%edi", "%ecx", "memory"); + "=D" (addr), "=c" (count) : + "r" (bsh + offset), "0" (addr), "1" (count) : + "%eax", "memory"); } #endif } @@ -308,15 +306,14 @@ else #endif { - int __x __asm__("%eax"); __asm __volatile(" \n\ cld \n\ - 1: movl (%1),%%eax \n\ + 1: movl (%2),%%eax \n\ stosl \n\ loop 1b" : - "=&a" (__x) : - "r" (bsh + offset), "D" (addr), "c" (count) : - "%edi", "%ecx", "memory"); + "=D" (addr), "=c" (count) : + "r" (bsh + offset), "0" (addr), "1" (count) : + "%eax", "memory"); } #endif } @@ -355,16 +352,16 @@ if (tag == I386_BUS_SPACE_IO) #endif { - int __x __asm__("%eax"); + int _port_ = bsh + offset; \ __asm __volatile(" \n\ cld \n\ - 1: inb %w1,%%al \n\ + 1: inb %w2,%%al \n\ stosb \n\ - incl %1 \n\ + incl %2 \n\ loop 1b" : - "=&a" (__x) : - "d" (bsh + offset), "D" (addr), "c" (count) : - "%edx", "%edi", "%ecx", "memory"); + "=D" (addr), "=c" (count), "=d" (_port_) : + "0" (addr), "1" (count), "2" (bsh + offset) : + "%eax", "memory", "cc"); } #endif #if defined(_I386_BUS_MEMIO_H_) @@ -372,13 +369,14 @@ else #endif { + int _port_ = bsh + offset; \ __asm __volatile(" \n\ cld \n\ repne \n\ movsb" : - : - "S" (bsh + offset), "D" (addr), "c" (count) : - "%esi", "%edi", "%ecx", "memory"); + "=S" (_port_), "=D" (addr), "=c" (count) : + "0" (addr), "1" (count), "2" (bsh + offset) : + "memory", "cc"); } #endif } @@ -392,16 +390,16 @@ if (tag == I386_BUS_SPACE_IO) #endif { - int __x __asm__("%eax"); + int _port_ = bsh + offset; \ __asm __volatile(" \n\ cld \n\ - 1: inw %w1,%%ax \n\ + 1: inw %w2,%%ax \n\ stosw \n\ - addl $2,%1 \n\ + addl $2,%2 \n\ loop 1b" : - "=&a" (__x) : - "d" (bsh + offset), "D" (addr), "c" (count) : - "%edx", "%edi", "%ecx", "memory"); + "=D" (addr), "=c" (count), "=d" (_port_) : + "0" (addr), "1" (count), "2" (bsh + offset) : + "%eax", "memory", "cc"); } #endif #if defined(_I386_BUS_MEMIO_H_) @@ -409,13 +407,14 @@ else #endif { + int _port_ = bsh + offset; \ __asm __volatile(" \n\ cld \n\ repne \n\ movsw" : - : - "S" (bsh + offset), "D" (addr), "c" (count) : - "%esi", "%edi", "%ecx", "memory"); + "=S" (_port_), "=D" (addr), "=c" (count) : + "0" (addr), "1" (count), "2" (bsh + offset) : + "memory", "cc"); } #endif } @@ -429,16 +428,16 @@ if (tag == I386_BUS_SPACE_IO) #endif { - int __x __asm__("%eax"); + int _port_ = bsh + offset; \ __asm __volatile(" \n\ cld \n\ - 1: inl %w1,%%eax \n\ + 1: inl %w2,%%eax \n\ stosl \n\ - addl $4,%1 \n\ + addl $4,%2 \n\ loop 1b" : - "=&a" (__x) : - "d" (bsh + offset), "D" (addr), "c" (count) : - "%edx", "%edi", "%ecx", "memory"); + "=D" (addr), "=c" (count), "=d" (_port_) : + "0" (addr), "1" (count), "2" (bsh + offset) : + "%eax", "memory", "cc"); } #endif #if defined(_I386_BUS_MEMIO_H_) @@ -446,13 +445,14 @@ else #endif { + int _port_ = bsh + offset; \ __asm __volatile(" \n\ cld \n\ repne \n\ movsl" : - : - "S" (bsh + offset), "D" (addr), "c" (count) : - "%esi", "%edi", "%ecx", "memory"); + "=S" (_port_), "=D" (addr), "=c" (count) : + "0" (addr), "1" (count), "2" (bsh + offset) : + "memory", "cc"); } #endif } @@ -573,15 +573,14 @@ else #endif { - int __x __asm__("%eax"); __asm __volatile(" \n\ cld \n\ 1: lodsb \n\ - movb %%al,(%1) \n\ + movb %%al,(%2) \n\ loop 1b" : - "=&a" (__x) : - "r" (bsh + offset), "S" (addr), "c" (count) : - "%esi", "%ecx"); + "=S" (addr), "=c" (count) : + "r" (bsh + offset), "0" (addr), "1" (count) : + "%eax", "memory", "cc"); } #endif } @@ -601,15 +600,15 @@ else #endif { - int __x __asm__("%eax"); __asm __volatile(" \n\ cld \n\ 1: lodsw \n\ movw %%ax,(%1) \n\ + movw %%ax,(%2) \n\ loop 1b" : - "=&a" (__x) : - "r" (bsh + offset), "S" (addr), "c" (count) : - "%esi", "%ecx"); + "=S" (addr), "=c" (count) : + "r" (bsh + offset), "0" (addr), "1" (count) : + "%eax", "memory", "cc"); } #endif } @@ -629,15 +628,14 @@ else #endif { - int __x __asm__("%eax"); __asm __volatile(" \n\ cld \n\ 1: lodsl \n\ - movl %%eax,(%1) \n\ + movl %%eax,(%2) \n\ loop 1b" : - "=&a" (__x) : - "r" (bsh + offset), "S" (addr), "c" (count) : - "%esi", "%ecx"); + "=S" (addr), "=c" (count) : + "r" (bsh + offset), "0" (addr), "1" (count) : + "%eax", "memory", "cc"); } #endif } @@ -677,16 +675,16 @@ if (tag == I386_BUS_SPACE_IO) #endif { - int __x __asm__("%eax"); + int _port_ = bsh + offset; \ __asm __volatile(" \n\ cld \n\ 1: lodsb \n\ outb %%al,%w1 \n\ incl %1 \n\ loop 1b" : - "=&a" (__x) : - "d" (bsh + offset), "S" (addr), "c" (count) : - "%edx", "%esi", "%ecx", "memory"); + "=S" (addr), "=c" (count), "=d" (_port_) : + "0" (bsh + offset), "1" (addr), "2" (count) : + "%eax", "memory", "cc"); } #endif #if defined(_I386_BUS_MEMIO_H_) @@ -694,13 +692,14 @@ else #endif { + int _port_ = bsh + offset; \ __asm __volatile(" \n\ cld \n\ repne \n\ movsb" : - : - "D" (bsh + offset), "S" (addr), "c" (count) : - "%edi", "%esi", "%ecx", "memory"); + "=S" (addr), "=D" (_port_), "=c" (count) : + "0" (bsh + offset), "1" (addr), "2" (count) : + "memory", "cc"); } #endif } @@ -714,16 +713,16 @@ if (tag == I386_BUS_SPACE_IO) #endif { - int __x __asm__("%eax"); + int _port_ = bsh + offset; \ __asm __volatile(" \n\ cld \n\ 1: lodsw \n\ outw %%ax,%w1 \n\ addl $2,%1 \n\ loop 1b" : - "=&a" (__x) : - "d" (bsh + offset), "S" (addr), "c" (count) : - "%edx", "%esi", "%ecx", "memory"); + "=S" (addr), "=c" (count), "=d" (_port_) : + "0" (bsh + offset), "1" (addr), "2" (count) : + "%eax", "memory", "cc"); } #endif #if defined(_I386_BUS_MEMIO_H_) @@ -731,13 +730,14 @@ else #endif { + int _port_ = bsh + offset; \ __asm __volatile(" \n\ cld \n\ repne \n\ movsw" : - : - "D" (bsh + offset), "S" (addr), "c" (count) : - "%edi", "%esi", "%ecx", "memory"); + "=S" (addr), "=D" (_port_), "=c" (count) : + "0" (bsh + offset), "1" (addr), "2" (count) : + "memory", "cc"); } #endif } @@ -751,16 +751,16 @@ if (tag == I386_BUS_SPACE_IO) #endif { - int __x __asm__("%eax"); + int _port_ = bsh + offset; \ __asm __volatile(" \n\ cld \n\ 1: lodsl \n\ outl %%eax,%w1 \n\ addl $4,%1 \n\ loop 1b" : - "=&a" (__x) : - "d" (bsh + offset), "S" (addr), "c" (count) : - "%edx", "%esi", "%ecx", "memory"); + "=S" (addr), "=c" (count), "=d" (_port_) : + "0" (bsh + offset), "1" (addr), "2" (count) : + "%eax", "memory", "cc"); } #endif #if defined(_I386_BUS_MEMIO_H_) @@ -768,13 +768,14 @@ else #endif { + int _port_ = bsh + offset; \ __asm __volatile(" \n\ cld \n\ repne \n\ movsl" : - : - "D" (bsh + offset), "S" (addr), "c" (count) : - "%edi", "%esi", "%ecx", "memory"); + "=S" (addr), "=D" (_port_), "=c" (count) : + "0" (bsh + offset), "1" (addr), "2" (count) : + "memory", "cc"); } #endif } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message