WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] fix compile failure on x86-64 in arch/xen/x86_64/mm/

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] fix compile failure on x86-64 in arch/xen/x86_64/mm/ioremap.c
From: Muli Ben-Yehuda <mulix@xxxxxxxxx>
Date: Tue, 23 Aug 2005 15:47:28 +0300
Delivery-date: Tue, 23 Aug 2005 12:45:33 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.10i
Compiling unstable on x86-64 (RHEL 3, gcc 3.2.3) fails with this
error: 

 CC      arch/xen/x86_64/mm/ioremap.o
arch/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 <mulix@xxxxxxxxx>

diff -r 43d91cbb1bfb -r 84ef495eb414 
linux-2.6-xen-sparse/arch/xen/x86_64/mm/ioremap.c
--- a/linux-2.6-xen-sparse/arch/xen/x86_64/mm/ioremap.c Mon Aug 22 23:07:37 2005
+++ b/linux-2.6-xen-sparse/arch/xen/x86_64/mm/ioremap.c Tue Aug 23 17:31:10 2005
@@ -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;
        }

-- 
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] fix compile failure on x86-64 in arch/xen/x86_64/mm/ioremap.c, Muli Ben-Yehuda <=