ia64/xen-unstable

changeset 9976:fc75a2c9835e

[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@valinux.co.jp>
author awilliam@xenbuild.aw
date Tue May 09 11:42:26 2006 -0600 (2006-05-09)
parents e502007031f4
children e891c49c7bc0
files linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c linux-2.6-xen-sparse/include/asm-ia64/page.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c	Tue May 09 11:41:06 2006 -0600
     1.2 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c	Tue May 09 11:42:26 2006 -0600
     1.3 @@ -285,3 +285,8 @@ EXPORT_SYMBOL(balloon_dealloc_empty_page
     1.4  EXPORT_SYMBOL(balloon_update_driver_allowance);
     1.5  
     1.6  
     1.7 +///////////////////////////////////////////////////////////////////////////
     1.8 +// PageForeign(), SetPageForeign(), ClearPageForeign()
     1.9 +
    1.10 +struct address_space xen_ia64_foreign_dummy_mapping;
    1.11 +
     2.1 --- a/linux-2.6-xen-sparse/include/asm-ia64/page.h	Tue May 09 11:41:06 2006 -0600
     2.2 +++ b/linux-2.6-xen-sparse/include/asm-ia64/page.h	Tue May 09 11:42:26 2006 -0600
     2.3 @@ -235,6 +235,41 @@ get_order (unsigned long size)
     2.4  #include <linux/kernel.h>
     2.5  #include <asm/hypervisor.h>
     2.6  
     2.7 +// XXX hack!
     2.8 +//     Linux/IA64 uses PG_arch_1.
     2.9 +//     This hack will be removed once PG_foreign bit is taken.
    2.10 +//#include <xen/foreign_page.h>
    2.11 +#ifdef __ASM_XEN_FOREIGN_PAGE_H__
    2.12 +# error "don't include include/xen/foreign_page.h!"
    2.13 +#endif
    2.14 +
    2.15 +extern struct address_space xen_ia64_foreign_dummy_mapping;
    2.16 +#define PageForeign(page)	\
    2.17 +	((page)->mapping == &xen_ia64_foreign_dummy_mapping)
    2.18 +
    2.19 +#define SetPageForeign(page, dtor) do {				\
    2.20 +	set_page_private((page), (unsigned long)(dtor));	\
    2.21 +	(page)->mapping = &xen_ia64_foreign_dummy_mapping;	\
    2.22 +	smp_rmb();						\
    2.23 +} while (0)
    2.24 +
    2.25 +#define ClearPageForeign(page) do {	\
    2.26 +	(page)->mapping = NULL;		\
    2.27 +	smp_rmb();			\
    2.28 +	set_page_private((page), 0);	\
    2.29 +} while (0)
    2.30 +
    2.31 +#define PageForeignDestructor(page)	\
    2.32 +	( (void (*) (struct page *)) page_private(page) )
    2.33 +
    2.34 +#define arch_free_page(_page,_order)			\
    2.35 +({      int foreign = PageForeign(_page);               \
    2.36 +	if (foreign)                                    \
    2.37 +		(PageForeignDestructor(_page))(_page);  \
    2.38 +	foreign;                                        \
    2.39 +})
    2.40 +#define HAVE_ARCH_FREE_PAGE
    2.41 +
    2.42  //XXX xen page size != page size
    2.43  
    2.44  static inline unsigned long
    2.45 @@ -279,6 +314,9 @@ machine_to_phys_for_dma(unsigned long ma
    2.46  #define set_phys_to_machine(pfn, mfn) do { } while (0)
    2.47  #define xen_machphys_update(mfn, pfn) do { } while (0)
    2.48  
    2.49 +//XXX to compile set_phys_to_machine(vaddr, FOREIGN_FRAME(m))
    2.50 +#define FOREIGN_FRAME(m)        (INVALID_P2M_ENTRY)
    2.51 +
    2.52  #define mfn_to_pfn(mfn)			(mfn)
    2.53  #define mfn_to_virt(mfn)		(__va((mfn) << PAGE_SHIFT))
    2.54  #define pfn_to_mfn(pfn)			(pfn)