fix compile failure on x86-64 in arch/xen/x86_64/mm/ioremap.c
PATCH 1/1 fix compile failure on x86-64 in arch/xen/x86_64/mm/ioremap.c
Compiling unstable on x86-64 (RHEL 3, gcc 3.2.3) fails with this error:
CC arch/xen/x86_64/mm/ioremap.oarch/xen/x86_64/mm/ioremap.c:145:1: directives may not be used inside a macro argument
This is on x86-64, RHEL 3, gcc 3.2.3. I'm curious if anyone else is seeing it?
The attached patch fixes it for me. This issue is also tracked in
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=178
Signed-off-by Muli Ben-Yehuda <[email protected]>
linux-2.6-xen-sparse/arch/xen/x86_64/mm/ioremap.c +6 -6
@@ -93,6 +93,7 @@struct vm_struct * area;unsigned long offset, last_addr;domid_t domid =DOMID_IO ; +unsigned long prot;/* Don't allow wraparound or zero size */ last_addr = phys_addr + size -1 ;
@@ -139,13 +140,12 @@return NULL ; area->phys_addr = phys_addr; addr = (void __iomem *) area->addr; + prot = _PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | flags; +#if defined(__x86_64__) + prot |= _PAGE_USER; +#endif if (direct_remap_area_pages (&init_mm, (unsigned long ) addr, phys_addr, - size,__pgprot (_PAGE_PRESENT | _PAGE_RW | - _PAGE_DIRTY | _PAGE_ACCESSED -#if defined(__x86_64__) - | _PAGE_USER -#endif - | flags), domid)) { + size,__pgprot (prot), domid)) {vunmap ((void __force *) addr);return NULL ; }
Signature · 2 lines
Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/