diff options
author | Mikael Pettersson <mikpe@it.uu.se> | 2008-08-13 15:07:07 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-15 08:30:32 -0400 |
commit | 1c5b0eb66d74683e2be5da0c53e33c1f4ca982fd (patch) | |
tree | 688b345892d4b7d8aa5465393fa9a2e791340b6a /include/asm-x86 | |
parent | 04b69447f79eade34e92f3117a39e8fa6ecb519b (diff) |
x86: fix readb() et al compile error with gcc-3.2.3
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 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.
Fixes <http://bugzilla.kernel.org/show_bug.cgi?id=11205>.
Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/io.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/include/asm-x86/io.h b/include/asm-x86/io.h index bf5d629b3a39..0f954dc89cb3 100644 --- a/include/asm-x86/io.h +++ b/include/asm-x86/io.h | |||
@@ -21,7 +21,7 @@ extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys); | |||
21 | 21 | ||
22 | #define build_mmio_read(name, size, type, reg, barrier) \ | 22 | #define build_mmio_read(name, size, type, reg, barrier) \ |
23 | static inline type name(const volatile void __iomem *addr) \ | 23 | static inline type name(const volatile void __iomem *addr) \ |
24 | { type ret; asm volatile("mov" size " %1,%0":"=" reg (ret) \ | 24 | { type ret; asm volatile("mov" size " %1,%0":reg (ret) \ |
25 | :"m" (*(volatile type __force *)addr) barrier); return ret; } | 25 | :"m" (*(volatile type __force *)addr) barrier); return ret; } |
26 | 26 | ||
27 | #define build_mmio_write(name, size, type, reg, barrier) \ | 27 | #define build_mmio_write(name, size, type, reg, barrier) \ |
@@ -29,13 +29,13 @@ static inline void name(type val, volatile void __iomem *addr) \ | |||
29 | { asm volatile("mov" size " %0,%1": :reg (val), \ | 29 | { asm volatile("mov" size " %0,%1": :reg (val), \ |
30 | "m" (*(volatile type __force *)addr) barrier); } | 30 | "m" (*(volatile type __force *)addr) barrier); } |
31 | 31 | ||
32 | build_mmio_read(readb, "b", unsigned char, "q", :"memory") | 32 | build_mmio_read(readb, "b", unsigned char, "=q", :"memory") |
33 | build_mmio_read(readw, "w", unsigned short, "r", :"memory") | 33 | build_mmio_read(readw, "w", unsigned short, "=r", :"memory") |
34 | build_mmio_read(readl, "l", unsigned int, "r", :"memory") | 34 | build_mmio_read(readl, "l", unsigned int, "=r", :"memory") |
35 | 35 | ||
36 | build_mmio_read(__readb, "b", unsigned char, "q", ) | 36 | build_mmio_read(__readb, "b", unsigned char, "=q", ) |
37 | build_mmio_read(__readw, "w", unsigned short, "r", ) | 37 | build_mmio_read(__readw, "w", unsigned short, "=r", ) |
38 | build_mmio_read(__readl, "l", unsigned int, "r", ) | 38 | build_mmio_read(__readl, "l", unsigned int, "=r", ) |
39 | 39 | ||
40 | build_mmio_write(writeb, "b", unsigned char, "q", :"memory") | 40 | build_mmio_write(writeb, "b", unsigned char, "q", :"memory") |
41 | build_mmio_write(writew, "w", unsigned short, "r", :"memory") | 41 | build_mmio_write(writew, "w", unsigned short, "r", :"memory") |
@@ -59,8 +59,8 @@ build_mmio_write(__writel, "l", unsigned int, "r", ) | |||
59 | #define mmiowb() barrier() | 59 | #define mmiowb() barrier() |
60 | 60 | ||
61 | #ifdef CONFIG_X86_64 | 61 | #ifdef CONFIG_X86_64 |
62 | build_mmio_read(readq, "q", unsigned long, "r", :"memory") | 62 | build_mmio_read(readq, "q", unsigned long, "=r", :"memory") |
63 | build_mmio_read(__readq, "q", unsigned long, "r", ) | 63 | build_mmio_read(__readq, "q", unsigned long, "=r", ) |
64 | build_mmio_write(writeq, "q", unsigned long, "r", :"memory") | 64 | build_mmio_write(writeq, "q", unsigned long, "r", :"memory") |
65 | build_mmio_write(__writeq, "q", unsigned long, "r", ) | 65 | build_mmio_write(__writeq, "q", unsigned long, "r", ) |
66 | 66 | ||