Bruce Evans writes:
>On Fri, 5 Nov 1999, David O'Brien wrote:
>
>> The current show stopper for switching over to GCC 2.95.2 is a problem
>> compiling the `ahc' driver:
>>
>> cc -c -O -pipe -Wall -Wredundant-decls -Wnested-externs
>> -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline
>> -Wcast-qual -fformat-extensions -ansi -nostdinc -I- -I. -I../..
>> -I../../../include -DKERNEL -include opt_global.h -elf
>> ../../dev/aic7xxx/aic7xxx.c
>> ../../dev/aic7xxx/aic7xxx.c: In function `ahc_download_instr':
>> machine/bus.h:584: Invalid `asm' statement:
>> machine/bus.h:584: fixed or forbidden register 2 (cx) was spilled for class
>CREG.
>> *** Error code 1
>
>The asm statement is broken. The clobber list shouldn't include any
>registers that are explicitly allocated as operands.
>
As usual, Bruce is right.
Here's a patch to bus.h which works for both EGCS and GCC 2.95.2. I have
ahc0 and ahc1 and I generated and successfully booted kernels using both
compilers with this patch.
===================== Patch =============================
--- /sys/i386/include/bus.h Sat Aug 28 02:44:07 1999
+++ /sys/i386/include/bus.h_mod Sat Nov 6 09:45:47 1999
@@ -260,7 +260,7 @@
loop 1b" :
"=&a" (__x) :
"r" (bsh + offset), "D" (addr), "c" (count) :
- "%edi", "%ecx", "memory");
+ "memory");
}
#endif
}
@@ -288,7 +288,7 @@
loop 1b" :
"=&a" (__x) :
"r" (bsh + offset), "D" (addr), "c" (count) :
- "%edi", "%ecx", "memory");
+ "memory");
}
#endif
}
@@ -316,7 +316,7 @@
loop 1b" :
"=&a" (__x) :
"r" (bsh + offset), "D" (addr), "c" (count) :
- "%edi", "%ecx", "memory");
+ "memory");
}
#endif
}
@@ -364,7 +364,7 @@
loop 1b" :
"=&a" (__x) :
"d" (bsh + offset), "D" (addr), "c" (count) :
- "%edx", "%edi", "%ecx", "memory");
+ "memory");
}
#endif
#if defined(_I386_BUS_MEMIO_H_)
@@ -378,7 +378,7 @@
movsb" :
:
"S" (bsh + offset), "D" (addr), "c" (count) :
- "%esi", "%edi", "%ecx", "memory");
+ "memory");
}
#endif
}
@@ -401,7 +401,7 @@
loop 1b" :
"=&a" (__x) :
"d" (bsh + offset), "D" (addr), "c" (count) :
- "%edx", "%edi", "%ecx", "memory");
+ "memory");
}
#endif
#if defined(_I386_BUS_MEMIO_H_)
@@ -415,7 +415,7 @@
movsw" :
:
"S" (bsh + offset), "D" (addr), "c" (count) :
- "%esi", "%edi", "%ecx", "memory");
+ "memory");
}
#endif
}
@@ -438,7 +438,7 @@
loop 1b" :
"=&a" (__x) :
"d" (bsh + offset), "D" (addr), "c" (count) :
- "%edx", "%edi", "%ecx", "memory");
+ "memory");
}
#endif
#if defined(_I386_BUS_MEMIO_H_)
@@ -452,7 +452,7 @@
movsl" :
:
"S" (bsh + offset), "D" (addr), "c" (count) :
- "%esi", "%edi", "%ecx", "memory");
+ "memory");
}
#endif
}
@@ -580,8 +580,7 @@
movb %%al,(%1) \n\
loop 1b" :
"=&a" (__x) :
- "r" (bsh + offset), "S" (addr), "c" (count) :
- "%esi", "%ecx");
+ "r" (bsh + offset), "S" (addr), "c" (count));
}
#endif
}
@@ -608,8 +607,7 @@
movw %%ax,(%1) \n\
loop 1b" :
"=&a" (__x) :
- "r" (bsh + offset), "S" (addr), "c" (count) :
- "%esi", "%ecx");
+ "r" (bsh + offset), "S" (addr), "c" (count));
}
#endif
}
@@ -636,8 +634,7 @@
movl %%eax,(%1) \n\
loop 1b" :
"=&a" (__x) :
- "r" (bsh + offset), "S" (addr), "c" (count) :
- "%esi", "%ecx");
+ "r" (bsh + offset), "S" (addr), "c" (count));
}
#endif
}
@@ -686,7 +683,7 @@
loop 1b" :
"=&a" (__x) :
"d" (bsh + offset), "S" (addr), "c" (count) :
- "%edx", "%esi", "%ecx", "memory");
+ "memory");
}
#endif
#if defined(_I386_BUS_MEMIO_H_)
@@ -700,7 +697,7 @@
movsb" :
:
"D" (bsh + offset), "S" (addr), "c" (count) :
- "%edi", "%esi", "%ecx", "memory");
+ "memory");
}
#endif
}
@@ -723,7 +720,7 @@
loop 1b" :
"=&a" (__x) :
"d" (bsh + offset), "S" (addr), "c" (count) :
- "%edx", "%esi", "%ecx", "memory");
+ "memory");
}
#endif
#if defined(_I386_BUS_MEMIO_H_)
@@ -737,7 +734,7 @@
movsw" :
:
"D" (bsh + offset), "S" (addr), "c" (count) :
- "%edi", "%esi", "%ecx", "memory");
+ "memory");
}
#endif
}
@@ -760,7 +757,7 @@
loop 1b" :
"=&a" (__x) :
"d" (bsh + offset), "S" (addr), "c" (count) :
- "%edx", "%esi", "%ecx", "memory");
+ "memory");
}
#endif
#if defined(_I386_BUS_MEMIO_H_)
@@ -774,7 +771,7 @@
movsl" :
:
"D" (bsh + offset), "S" (addr), "c" (count) :
- "%edi", "%esi", "%ecx", "memory");
+ "memory");
}
#endif
}
---
Gary Jennejohn
Home - [EMAIL PROTECTED]
Work - [EMAIL PROTECTED]
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message