* [PATCH 2.6.27-rc1] x86: fix readb() et al compile error with gcc-3.2.3
@ 2008-07-30 12:44 Mikael Pettersson
2008-08-15 12:31 ` Ingo Molnar
0 siblings, 1 reply; 2+ messages in thread
From: Mikael Pettersson @ 2008-07-30 12:44 UTC (permalink / raw)
To: mingo; +Cc: hpa, linux-kernel, tglx
Building 2.6.27-rc1 on x86 with gcc-3.2.3 fails with:
In file included from include/asm/dma.h:12,
from include/linux/bootmem.h:8,
from init/main.c:26:
include/asm/io.h: In function `readb':
include/asm/io.h:32: syntax error before string constant
include/asm/io.h: In function `readw':
include/asm/io.h:33: syntax error before string constant
include/asm/io.h: In function `readl':
include/asm/io.h:34: syntax error before string constant
include/asm/io.h: In function `__readb':
include/asm/io.h:36: syntax error before string constant
include/asm/io.h: In function `__readw':
include/asm/io.h:37: syntax error before string constant
include/asm/io.h: In function `__readl':
include/asm/io.h:38: syntax error before string constant
make[1]: *** [init/main.o] Error 1
make: *** [init] Error 2
Starting with 2.6.27-rc1 readb() et al are generated by a
build_mmio_read() macro, which generates asm() statements with
output register constraints like "=" "q", i.e. as two adjacent
string literals. This doesn't work with the old gcc-3.2.3.
Fixed by moving the "=" part into the callers' reg parameter
(as suggested by Ingo).
Build and boot-tested with gcc-3.2.3 on 32 and 64-bit x86.
Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
---
--- linux-2.6.27-rc1/include/asm-x86/io.h.~1~ 2008-07-29 10:40:13.000000000 +0200
+++ linux-2.6.27-rc1/include/asm-x86/io.h 2008-07-30 13:52:15.000000000 +0200
@@ -21,7 +21,7 @@ extern void __iomem *fix_ioremap(unsigne
#define build_mmio_read(name, size, type, reg, barrier) \
static inline type name(const volatile void __iomem *addr) \
-{ type ret; asm volatile("mov" size " %1,%0":"=" reg (ret) \
+{ type ret; asm volatile("mov" size " %1,%0":reg (ret) \
:"m" (*(volatile type __force *)addr) barrier); return ret; }
#define build_mmio_write(name, size, type, reg, barrier) \
@@ -29,13 +29,13 @@ static inline void name(type val, volati
{ asm volatile("mov" size " %0,%1": :reg (val), \
"m" (*(volatile type __force *)addr) barrier); }
-build_mmio_read(readb, "b", unsigned char, "q", :"memory")
-build_mmio_read(readw, "w", unsigned short, "r", :"memory")
-build_mmio_read(readl, "l", unsigned int, "r", :"memory")
-
-build_mmio_read(__readb, "b", unsigned char, "q", )
-build_mmio_read(__readw, "w", unsigned short, "r", )
-build_mmio_read(__readl, "l", unsigned int, "r", )
+build_mmio_read(readb, "b", unsigned char, "=q", :"memory")
+build_mmio_read(readw, "w", unsigned short, "=r", :"memory")
+build_mmio_read(readl, "l", unsigned int, "=r", :"memory")
+
+build_mmio_read(__readb, "b", unsigned char, "=q", )
+build_mmio_read(__readw, "w", unsigned short, "=r", )
+build_mmio_read(__readl, "l", unsigned int, "=r", )
build_mmio_write(writeb, "b", unsigned char, "q", :"memory")
build_mmio_write(writew, "w", unsigned short, "r", :"memory")
@@ -59,8 +59,8 @@ build_mmio_write(__writel, "l", unsigned
#define mmiowb() barrier()
#ifdef CONFIG_X86_64
-build_mmio_read(readq, "q", unsigned long, "r", :"memory")
-build_mmio_read(__readq, "q", unsigned long, "r", )
+build_mmio_read(readq, "q", unsigned long, "=r", :"memory")
+build_mmio_read(__readq, "q", unsigned long, "=r", )
build_mmio_write(writeq, "q", unsigned long, "r", :"memory")
build_mmio_write(__writeq, "q", unsigned long, "r", )
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 2.6.27-rc1] x86: fix readb() et al compile error with gcc-3.2.3
2008-07-30 12:44 [PATCH 2.6.27-rc1] x86: fix readb() et al compile error with gcc-3.2.3 Mikael Pettersson
@ 2008-08-15 12:31 ` Ingo Molnar
0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2008-08-15 12:31 UTC (permalink / raw)
To: Mikael Pettersson; +Cc: mingo, hpa, linux-kernel, tglx
* Mikael Pettersson <mikpe@it.uu.se> wrote:
> Building 2.6.27-rc1 on x86 with gcc-3.2.3 fails with:
>
> In file included from include/asm/dma.h:12,
> from include/linux/bootmem.h:8,
> from init/main.c:26:
> include/asm/io.h: In function `readb':
> include/asm/io.h:32: syntax error before string constant
> include/asm/io.h: In function `readw':
> include/asm/io.h:33: syntax error before string constant
> include/asm/io.h: In function `readl':
> include/asm/io.h:34: syntax error before string constant
> include/asm/io.h: In function `__readb':
> include/asm/io.h:36: syntax error before string constant
> include/asm/io.h: In function `__readw':
> include/asm/io.h:37: syntax error before string constant
> include/asm/io.h: In function `__readl':
> include/asm/io.h:38: syntax error before string constant
> make[1]: *** [init/main.o] Error 1
> make: *** [init] Error 2
>
> Starting with 2.6.27-rc1 readb() et al are generated by a
> build_mmio_read() macro, which generates asm() statements with
> output register constraints like "=" "q", i.e. as two adjacent
> string literals. This doesn't work with the old gcc-3.2.3.
>
> Fixed by moving the "=" part into the callers' reg parameter
> (as suggested by Ingo).
>
> Build and boot-tested with gcc-3.2.3 on 32 and 64-bit x86.
>
> Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
applied to tip/x86/urgent - thanks Mikael.
Ingo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-08-15 12:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-30 12:44 [PATCH 2.6.27-rc1] x86: fix readb() et al compile error with gcc-3.2.3 Mikael Pettersson
2008-08-15 12:31 ` Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®