direct-io.hg

changeset 11323:5264cc30d711

[IA64] split parts of page.h into maddr.h

ia64 support for xen-unstable.hg cset 11081:9c953e1b6fad

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author awilliam@xenbuild.aw
date Wed Aug 23 11:15:29 2006 -0600 (2006-08-23)
parents 8293018c1a24
children 56ec2377b32e
files linux-2.6-xen-sparse/include/asm-ia64/maddr.h linux-2.6-xen-sparse/include/asm-ia64/page.h
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/linux-2.6-xen-sparse/include/asm-ia64/maddr.h	Wed Aug 23 11:15:29 2006 -0600
     1.3 @@ -0,0 +1,81 @@
     1.4 +#ifndef _ASM_IA64_MADDR_H
     1.5 +#define _ASM_IA64_MADDR_H
     1.6 +
     1.7 +#ifndef __ASSEMBLY__
     1.8 +#ifdef CONFIG_XEN
     1.9 +
    1.10 +#define INVALID_P2M_ENTRY	(~0UL)
    1.11 +
    1.12 +#include <linux/kernel.h>
    1.13 +#include <asm/hypervisor.h>
    1.14 +#include <xen/features.h>	// to compile netback, netfront
    1.15 +typedef unsigned long maddr_t;	// to compile netback, netfront
    1.16 +
    1.17 +
    1.18 +/* XXX xen page size != page size */
    1.19 +
    1.20 +static inline unsigned long
    1.21 +pfn_to_mfn_for_dma(unsigned long pfn)
    1.22 +{
    1.23 +	unsigned long mfn;
    1.24 +	mfn = HYPERVISOR_phystomach(pfn);
    1.25 +	BUG_ON(mfn == 0); // XXX
    1.26 +	BUG_ON(mfn == INVALID_P2M_ENTRY); // XXX
    1.27 +	BUG_ON(mfn == INVALID_MFN);
    1.28 +	return mfn;
    1.29 +}
    1.30 +
    1.31 +static inline unsigned long
    1.32 +phys_to_machine_for_dma(unsigned long phys)
    1.33 +{
    1.34 +	unsigned long machine =
    1.35 +	              pfn_to_mfn_for_dma(phys >> PAGE_SHIFT) << PAGE_SHIFT;
    1.36 +	machine |= (phys & ~PAGE_MASK);
    1.37 +	return machine;
    1.38 +}
    1.39 +
    1.40 +static inline unsigned long
    1.41 +mfn_to_pfn_for_dma(unsigned long mfn)
    1.42 +{
    1.43 +	unsigned long pfn;
    1.44 +	pfn = HYPERVISOR_machtophys(mfn);
    1.45 +	BUG_ON(pfn == 0);
    1.46 +	//BUG_ON(pfn == INVALID_M2P_ENTRY);
    1.47 +	return pfn;
    1.48 +}
    1.49 +
    1.50 +static inline unsigned long
    1.51 +machine_to_phys_for_dma(unsigned long machine)
    1.52 +{
    1.53 +	unsigned long phys =
    1.54 +	              mfn_to_pfn_for_dma(machine >> PAGE_SHIFT) << PAGE_SHIFT;
    1.55 +	phys |= (machine & ~PAGE_MASK);
    1.56 +	return phys;
    1.57 +}
    1.58 +
    1.59 +#define set_phys_to_machine(pfn, mfn) do { } while (0)
    1.60 +#define xen_machphys_update(mfn, pfn) do { } while (0)
    1.61 +
    1.62 +/* XXX to compile set_phys_to_machine(vaddr, FOREIGN_FRAME(m)) */
    1.63 +#define FOREIGN_FRAME(m)        (INVALID_P2M_ENTRY)
    1.64 +
    1.65 +#define mfn_to_pfn(mfn)			(mfn)
    1.66 +#define mfn_to_virt(mfn)		(__va((mfn) << PAGE_SHIFT))
    1.67 +#define pfn_to_mfn(pfn)			(pfn)
    1.68 +#define virt_to_mfn(virt)		(__pa(virt) >> PAGE_SHIFT)
    1.69 +#define virt_to_machine(virt)		__pa(virt) // for tpmfront.c
    1.70 +
    1.71 +static inline unsigned long
    1.72 +mfn_to_local_pfn(unsigned long mfn)
    1.73 +{
    1.74 +	extern unsigned long max_mapnr;
    1.75 +	unsigned long pfn = mfn_to_pfn_for_dma(mfn);
    1.76 +	if (!pfn_valid(pfn))
    1.77 +		return INVALID_P2M_ENTRY;
    1.78 +	return pfn;
    1.79 +}
    1.80 +
    1.81 +#endif /* CONFIG_XEN */
    1.82 +#endif /* __ASSEMBLY__ */
    1.83 +
    1.84 +#endif /* _ASM_IA64_MADDR_H */
     2.1 --- a/linux-2.6-xen-sparse/include/asm-ia64/page.h	Wed Aug 23 11:14:52 2006 -0600
     2.2 +++ b/linux-2.6-xen-sparse/include/asm-ia64/page.h	Wed Aug 23 11:15:29 2006 -0600
     2.3 @@ -224,12 +224,9 @@ get_order (unsigned long size)
     2.4  #ifndef __ASSEMBLY__
     2.5  #ifdef CONFIG_XEN
     2.6  
     2.7 -#define INVALID_P2M_ENTRY	(~0UL)
     2.8 -
     2.9  #include <linux/kernel.h>
    2.10  #include <asm/hypervisor.h>
    2.11  #include <xen/features.h>	// to compile netback, netfront
    2.12 -typedef unsigned long maddr_t;	// to compile netback, netfront
    2.13  
    2.14  /*
    2.15   * XXX hack!
    2.16 @@ -268,68 +265,7 @@ extern struct address_space xen_ia64_for
    2.17  })
    2.18  #define HAVE_ARCH_FREE_PAGE
    2.19  
    2.20 -/* XXX xen page size != page size */
    2.21 -
    2.22 -static inline unsigned long
    2.23 -pfn_to_mfn_for_dma(unsigned long pfn)
    2.24 -{
    2.25 -	unsigned long mfn;
    2.26 -	mfn = HYPERVISOR_phystomach(pfn);
    2.27 -	BUG_ON(mfn == 0); // XXX
    2.28 -	BUG_ON(mfn == INVALID_P2M_ENTRY); // XXX
    2.29 -	BUG_ON(mfn == INVALID_MFN);
    2.30 -	return mfn;
    2.31 -}
    2.32 -
    2.33 -static inline unsigned long
    2.34 -phys_to_machine_for_dma(unsigned long phys)
    2.35 -{
    2.36 -	unsigned long machine =
    2.37 -	              pfn_to_mfn_for_dma(phys >> PAGE_SHIFT) << PAGE_SHIFT;
    2.38 -	machine |= (phys & ~PAGE_MASK);
    2.39 -	return machine;
    2.40 -}
    2.41 -
    2.42 -static inline unsigned long
    2.43 -mfn_to_pfn_for_dma(unsigned long mfn)
    2.44 -{
    2.45 -	unsigned long pfn;
    2.46 -	pfn = HYPERVISOR_machtophys(mfn);
    2.47 -	BUG_ON(pfn == 0);
    2.48 -	//BUG_ON(pfn == INVALID_M2P_ENTRY);
    2.49 -	return pfn;
    2.50 -}
    2.51 -
    2.52 -static inline unsigned long
    2.53 -machine_to_phys_for_dma(unsigned long machine)
    2.54 -{
    2.55 -	unsigned long phys =
    2.56 -	              mfn_to_pfn_for_dma(machine >> PAGE_SHIFT) << PAGE_SHIFT;
    2.57 -	phys |= (machine & ~PAGE_MASK);
    2.58 -	return phys;
    2.59 -}
    2.60 -
    2.61 -#define set_phys_to_machine(pfn, mfn) do { } while (0)
    2.62 -#define xen_machphys_update(mfn, pfn) do { } while (0)
    2.63 -
    2.64 -/* XXX to compile set_phys_to_machine(vaddr, FOREIGN_FRAME(m)) */
    2.65 -#define FOREIGN_FRAME(m)        (INVALID_P2M_ENTRY)
    2.66 -
    2.67 -#define mfn_to_pfn(mfn)			(mfn)
    2.68 -#define mfn_to_virt(mfn)		(__va((mfn) << PAGE_SHIFT))
    2.69 -#define pfn_to_mfn(pfn)			(pfn)
    2.70 -#define virt_to_mfn(virt)		(__pa(virt) >> PAGE_SHIFT)
    2.71 -#define virt_to_machine(virt)		__pa(virt) // for tpmfront.c
    2.72 -
    2.73 -static inline unsigned long
    2.74 -mfn_to_local_pfn(unsigned long mfn)
    2.75 -{
    2.76 -	extern unsigned long max_mapnr;
    2.77 -	unsigned long pfn = mfn_to_pfn_for_dma(mfn);
    2.78 -	if (!pfn_valid(pfn))
    2.79 -		return INVALID_P2M_ENTRY;
    2.80 -	return pfn;
    2.81 -}
    2.82 +#include <asm/maddr.h>
    2.83  
    2.84  #endif /* CONFIG_XEN */
    2.85  #endif /* __ASSEMBLY__ */