ia64/xen-unstable

changeset 12576:50467f56ed65

[HVM] Fix building PV-on-HVM drivers on i386.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Mon Nov 27 10:02:24 2006 +0000 (2006-11-27)
parents 25cb51eed511
children 97c552510470
files linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/maddr.h linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/maddr.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/maddr.h	Sun Nov 26 17:39:09 2006 +0000
     1.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/maddr.h	Mon Nov 27 10:02:24 2006 +0000
     1.3 @@ -9,6 +9,15 @@
     1.4  #define FOREIGN_FRAME_BIT	(1UL<<31)
     1.5  #define FOREIGN_FRAME(m)	((m) | FOREIGN_FRAME_BIT)
     1.6  
     1.7 +/* Definitions for machine and pseudophysical addresses. */
     1.8 +#ifdef CONFIG_X86_PAE
     1.9 +typedef unsigned long long paddr_t;
    1.10 +typedef unsigned long long maddr_t;
    1.11 +#else
    1.12 +typedef unsigned long paddr_t;
    1.13 +typedef unsigned long maddr_t;
    1.14 +#endif
    1.15 +
    1.16  #ifdef CONFIG_XEN
    1.17  
    1.18  extern unsigned long *phys_to_machine_mapping;
    1.19 @@ -101,26 +110,6 @@ static inline void set_phys_to_machine(u
    1.20  	phys_to_machine_mapping[pfn] = mfn;
    1.21  }
    1.22  
    1.23 -
    1.24 -#else /* !CONFIG_XEN */
    1.25 -
    1.26 -#define pfn_to_mfn(pfn) (pfn)
    1.27 -#define mfn_to_pfn(mfn) (mfn)
    1.28 -#define mfn_to_local_pfn(mfn) (mfn)
    1.29 -#define set_phys_to_machine(pfn, mfn) BUG_ON((pfn) != (mfn))
    1.30 -#define phys_to_machine_mapping_valid(pfn) (1)
    1.31 -
    1.32 -#endif /* !CONFIG_XEN */
    1.33 -
    1.34 -/* Definitions for machine and pseudophysical addresses. */
    1.35 -#ifdef CONFIG_X86_PAE
    1.36 -typedef unsigned long long paddr_t;
    1.37 -typedef unsigned long long maddr_t;
    1.38 -#else
    1.39 -typedef unsigned long paddr_t;
    1.40 -typedef unsigned long maddr_t;
    1.41 -#endif
    1.42 -
    1.43  static inline maddr_t phys_to_machine(paddr_t phys)
    1.44  {
    1.45  	maddr_t machine = pfn_to_mfn(phys >> PAGE_SHIFT);
    1.46 @@ -148,6 +137,19 @@ static inline paddr_t pte_machine_to_phy
    1.47  	return phys;
    1.48  }
    1.49  
    1.50 +#else /* !CONFIG_XEN */
    1.51 +
    1.52 +#define pfn_to_mfn(pfn) (pfn)
    1.53 +#define mfn_to_pfn(mfn) (mfn)
    1.54 +#define mfn_to_local_pfn(mfn) (mfn)
    1.55 +#define set_phys_to_machine(pfn, mfn) BUG_ON((pfn) != (mfn))
    1.56 +#define phys_to_machine_mapping_valid(pfn) (1)
    1.57 +#define phys_to_machine(phys) ((maddr_t)(phys))
    1.58 +#define machine_to_phys(mach) ((paddr_t)(mach))
    1.59 +#define pte_machine_to_phys(mach) ((paddr_t)(mach))
    1.60 +
    1.61 +#endif /* !CONFIG_XEN */
    1.62 +
    1.63  /* VIRT <-> MACHINE conversion */
    1.64  #define virt_to_machine(v)	(phys_to_machine(__pa(v)))
    1.65  #define virt_to_mfn(v)		(pfn_to_mfn(__pa(v) >> PAGE_SHIFT))
     2.1 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/maddr.h	Sun Nov 26 17:39:09 2006 +0000
     2.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/maddr.h	Mon Nov 27 10:02:24 2006 +0000
     2.3 @@ -9,6 +9,10 @@
     2.4  #define FOREIGN_FRAME_BIT	(1UL<<63)
     2.5  #define FOREIGN_FRAME(m)	((m) | FOREIGN_FRAME_BIT)
     2.6  
     2.7 +/* Definitions for machine and pseudophysical addresses. */
     2.8 +typedef unsigned long paddr_t;
     2.9 +typedef unsigned long maddr_t;
    2.10 +
    2.11  #ifdef CONFIG_XEN
    2.12  
    2.13  extern unsigned long *phys_to_machine_mapping;
    2.14 @@ -99,20 +103,6 @@ static inline void set_phys_to_machine(u
    2.15  	phys_to_machine_mapping[pfn] = mfn;
    2.16  }
    2.17  
    2.18 -#else /* !CONFIG_XEN */
    2.19 -
    2.20 -#define pfn_to_mfn(pfn) (pfn)
    2.21 -#define mfn_to_pfn(mfn) (mfn)
    2.22 -#define mfn_to_local_pfn(mfn) (mfn)
    2.23 -#define set_phys_to_machine(pfn, mfn) BUG_ON((pfn) != (mfn))
    2.24 -#define phys_to_machine_mapping_valid(pfn) (1)
    2.25 -
    2.26 -#endif /* !CONFIG_XEN */
    2.27 -
    2.28 -/* Definitions for machine and pseudophysical addresses. */
    2.29 -typedef unsigned long paddr_t;
    2.30 -typedef unsigned long maddr_t;
    2.31 -
    2.32  static inline maddr_t phys_to_machine(paddr_t phys)
    2.33  {
    2.34  	maddr_t machine = pfn_to_mfn(phys >> PAGE_SHIFT);
    2.35 @@ -135,6 +125,19 @@ static inline paddr_t pte_machine_to_phy
    2.36  	return phys;
    2.37  }
    2.38  
    2.39 +#else /* !CONFIG_XEN */
    2.40 +
    2.41 +#define pfn_to_mfn(pfn) (pfn)
    2.42 +#define mfn_to_pfn(mfn) (mfn)
    2.43 +#define mfn_to_local_pfn(mfn) (mfn)
    2.44 +#define set_phys_to_machine(pfn, mfn) BUG_ON((pfn) != (mfn))
    2.45 +#define phys_to_machine_mapping_valid(pfn) (1)
    2.46 +#define phys_to_machine(phys) ((maddr_t)(phys))
    2.47 +#define machine_to_phys(mach) ((paddr_t)(mach))
    2.48 +#define pte_machine_to_phys(mach) ((paddr_t)(mach))
    2.49 +
    2.50 +#endif /* !CONFIG_XEN */
    2.51 +
    2.52  /* VIRT <-> MACHINE conversion */
    2.53  #define virt_to_machine(v)	(phys_to_machine(__pa(v)))
    2.54  #define virt_to_mfn(v)		(pfn_to_mfn(__pa(v) >> PAGE_SHIFT))