[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#2073: assembler problems in asm/io.h during build of kernel



You (Bruce Perens) wrote:
> There was a change in the way that GCC handles embedded assembler that
> made new compilers incompatible with the old kernels. Ugh. The io.h file
> in the new kernel is similar enough to the old one that it may be a drop-in
> replacement. I don't think anyone has tried this yet.

I saw this on comp.os.linux.development.system, but I haven't tried
if it still compiles the kernel with gcc < 2.7.x...


From: Russell Johnston <rjohnsto@edge.net>
Newsgroups: comp.os.linux.development.system
Subject: Re: gcc 2.7.2 and kernel 1.2.13

This patch allows compilation of kernel 1.2.13 with gcc > 2.7.0

Russell Johnston
<rjohnsto@edge.net>

--- ./linux/include/asm-i386/io.h-	Mon Aug 15 00:56:19 1994
+++ ./linux/include/asm-i386/io.h	Wed Nov 15 23:04:25 1995
@@ -49,9 +49,9 @@

 #define __OUT(s,s1,x) \
 __OUT1(s,x) __OUT2(s,s1,"w") : : "a" (value), "d" (port)); } \
-__OUT1(s##c,x) __OUT2(s,s1,"") : : "a" (value), "i" (port)); } \
+__OUT1(s##c,x) __OUT2(s,s1,"") : : "a" (value), "id" (port)); } \
 __OUT1(s##_p,x) __OUT2(s,s1,"w") : : "a" (value), "d" (port));
SLOW_DOWN_IO; } \
-__OUT1(s##c_p,x) __OUT2(s,s1,"") : : "a" (value), "i" (port));
SLOW_DOWN_IO; }
+__OUT1(s##c_p,x) __OUT2(s,s1,"") : : "a" (value), "id" (port));
SLOW_DOWN_IO; }

 #define __IN1(s) \
 extern inline unsigned int __in##s(unsigned short port) { unsigned int _v;
@@ -61,9 +61,9 @@

 #define __IN(s,s1,i...) \
 __IN1(s) __IN2(s,s1,"w") : "=a" (_v) : "d" (port) ,##i ); return _v; } \
-__IN1(s##c) __IN2(s,s1,"") : "=a" (_v) : "i" (port) ,##i ); return _v; } \
+__IN1(s##c) __IN2(s,s1,"") : "=a" (_v) : "id" (port) ,##i ); return _v; }
\
 __IN1(s##_p) __IN2(s,s1,"w") : "=a" (_v) : "d" (port) ,##i );
SLOW_DOWN_IO; return _v; } \
-__IN1(s##c_p) __IN2(s,s1,"") : "=a" (_v) : "i" (port) ,##i );
SLOW_DOWN_IO; return _v; }
+__IN1(s##c_p) __IN2(s,s1,"") : "=a" (_v) : "id" (port) ,##i );
SLOW_DOWN_IO; return _v; }

 #define __INS(s) \
 extern inline void ins##s(unsigned short port, void * addr, unsigned long
count) \

--
  Miquel van    | Cistron Internet Services   --    Alphen aan den Rijn.
  Smoorenburg,  | mailto:info@cistron.nl          http://www.cistron.nl/
miquels@het.net | Tel: +31-172-419445 (Voice) 430979 (Fax) 442580 (Data)


Reply to: