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-changelog

[Xen-changelog] [IA64] linux: arch_free_page()

# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID fc75a2c9835e644ec3962fb50b122173ae0b5122
# Parent  e502007031f4d6a8f6705713a225fa1d55e44450
[IA64] linux: arch_free_page()

add defeinitions of arch_free_page()
work around for PG_foreign. xen/ia64 uses PG_arch1.
This work around sould be removed once PG_foreign is taken.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c |    5 +++
 linux-2.6-xen-sparse/include/asm-ia64/page.h    |   38 ++++++++++++++++++++++++
 2 files changed, 43 insertions(+)

diff -r e502007031f4 -r fc75a2c9835e 
linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c   Tue May 09 11:41:06 
2006 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c   Tue May 09 11:42:26 
2006 -0600
@@ -285,3 +285,8 @@ EXPORT_SYMBOL(balloon_update_driver_allo
 EXPORT_SYMBOL(balloon_update_driver_allowance);
 
 
+///////////////////////////////////////////////////////////////////////////
+// PageForeign(), SetPageForeign(), ClearPageForeign()
+
+struct address_space xen_ia64_foreign_dummy_mapping;
+
diff -r e502007031f4 -r fc75a2c9835e 
linux-2.6-xen-sparse/include/asm-ia64/page.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/page.h      Tue May 09 11:41:06 
2006 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/page.h      Tue May 09 11:42:26 
2006 -0600
@@ -235,6 +235,41 @@ get_order (unsigned long size)
 #include <linux/kernel.h>
 #include <asm/hypervisor.h>
 
+// XXX hack!
+//     Linux/IA64 uses PG_arch_1.
+//     This hack will be removed once PG_foreign bit is taken.
+//#include <xen/foreign_page.h>
+#ifdef __ASM_XEN_FOREIGN_PAGE_H__
+# error "don't include include/xen/foreign_page.h!"
+#endif
+
+extern struct address_space xen_ia64_foreign_dummy_mapping;
+#define PageForeign(page)      \
+       ((page)->mapping == &xen_ia64_foreign_dummy_mapping)
+
+#define SetPageForeign(page, dtor) do {                                \
+       set_page_private((page), (unsigned long)(dtor));        \
+       (page)->mapping = &xen_ia64_foreign_dummy_mapping;      \
+       smp_rmb();                                              \
+} while (0)
+
+#define ClearPageForeign(page) do {    \
+       (page)->mapping = NULL;         \
+       smp_rmb();                      \
+       set_page_private((page), 0);    \
+} while (0)
+
+#define PageForeignDestructor(page)    \
+       ( (void (*) (struct page *)) page_private(page) )
+
+#define arch_free_page(_page,_order)                   \
+({      int foreign = PageForeign(_page);               \
+       if (foreign)                                    \
+               (PageForeignDestructor(_page))(_page);  \
+       foreign;                                        \
+})
+#define HAVE_ARCH_FREE_PAGE
+
 //XXX xen page size != page size
 
 static inline unsigned long
@@ -279,6 +314,9 @@ machine_to_phys_for_dma(unsigned long ma
 #define set_phys_to_machine(pfn, mfn) do { } while (0)
 #define xen_machphys_update(mfn, pfn) do { } while (0)
 
+//XXX to compile set_phys_to_machine(vaddr, FOREIGN_FRAME(m))
+#define FOREIGN_FRAME(m)        (INVALID_P2M_ENTRY)
+
 #define mfn_to_pfn(mfn)                        (mfn)
 #define mfn_to_virt(mfn)               (__va((mfn) << PAGE_SHIFT))
 #define pfn_to_mfn(pfn)                        (pfn)

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [IA64] linux: arch_free_page(), Xen patchbot-unstable <=