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-ia64-devel

[Xen-ia64-devel] [PATCH 4/7] fix __virt_to_maddr()

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH 4/7] fix __virt_to_maddr()
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Thu, 29 Jan 2009 11:21:30 +0900
Cc: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Delivery-date: Wed, 28 Jan 2009 18:16:56 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
[IA64] fix __virt_to_maddr()

__virt_to_maddr() should be updated acording to xen relocation.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff --git a/xen/include/asm-ia64/linux-xen/linux/efi.h 
b/xen/include/asm-ia64/linux-xen/linux/efi.h
--- a/xen/include/asm-ia64/linux-xen/linux/efi.h
+++ b/xen/include/asm-ia64/linux-xen/linux/efi.h
@@ -23,6 +23,9 @@
 
 #include <asm/page.h>
 #include <asm/system.h>
+#ifdef XEN
+#include <asm/pgtable.h>
+#endif
 
 #define EFI_SUCCESS            0
 #define EFI_LOAD_ERROR          ( 1 | (1UL << (BITS_PER_LONG-1)))
diff --git a/xen/include/asm-ia64/xenpage.h b/xen/include/asm-ia64/xenpage.h
--- a/xen/include/asm-ia64/xenpage.h
+++ b/xen/include/asm-ia64/xenpage.h
@@ -17,18 +17,22 @@ extern int ia64_mfn_valid (unsigned long
 
 #include <asm/xensystem.h>
 
-static inline unsigned long __virt_to_maddr(unsigned long va)
-{
-       if (va - KERNEL_START < xenheap_size)
-               return xen_pstart + (va - KERNEL_START);
-       else
-               /* 
-                * Because the significant 8 bits of VA are used by Xen,
-                * and xen uses cached/uncached identity mapping.
-                * IA64_MAX_PHYS_BITS can't be larger than 56
-                */
-               return (va & ((1UL << IA64_MAX_PHYS_BITS) - 1));
-}
+/*
+ * macro: avoid header inclustion hell
+ * static inline unsigned long __virt_to_maddr(unsigned long va)
+ */
+/*
+ * Because the significant 8 bits of VA are used by Xen,
+ * and xen uses cached/uncached identity mapping.
+ * IA64_MAX_PHYS_BITS can't be larger than 56
+ */
+#define __virt_to_maddr(va)                                            \
+       ({                                                              \
+               unsigned long __va__ = (va);                            \
+               (__va__ - KERNEL_START < KERNEL_TR_PAGE_SIZE) ?         \
+                       xen_pstart + (__va__ - KERNEL_START) :          \
+                       (__va__ & ((1UL << IA64_MAX_PHYS_BITS) - 1));   \
+       })
 
 #define virt_to_maddr(va)      (__virt_to_maddr((unsigned long)va))
 

Attachment: fix__virt_to_maddr.patch
Description: Text Data

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-ia64-devel] [PATCH 4/7] fix __virt_to_maddr(), Isaku Yamahata <=