direct-io.hg

changeset 6153:0daaf1e5ca36

Fix __pte,__pmd,__pgd for PAE.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Sun Aug 14 18:58:25 2005 +0000 (2005-08-14)
parents da515995a281
children d47c61f72572 972917cee2fd
files linux-2.6-xen-sparse/include/asm-xen/asm-i386/page.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/page.h	Sun Aug 14 17:44:30 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/page.h	Sun Aug 14 18:58:25 2005 +0000
     1.3 @@ -63,15 +63,20 @@
     1.4  extern unsigned int *phys_to_machine_mapping;
     1.5  #define pfn_to_mfn(_pfn) ((unsigned long)(phys_to_machine_mapping[(_pfn)]))
     1.6  #define mfn_to_pfn(_mfn) ((unsigned long)(machine_to_phys_mapping[(_mfn)]))
     1.7 -static inline unsigned long phys_to_machine(unsigned long phys)
     1.8 +#ifdef CONFIG_X86_PAE
     1.9 +typedef unsigned long long physaddr_t;
    1.10 +#else
    1.11 +typedef unsigned long physaddr_t;
    1.12 +#endif
    1.13 +static inline physaddr_t phys_to_machine(physaddr_t phys)
    1.14  {
    1.15 -	unsigned long machine = pfn_to_mfn(phys >> PAGE_SHIFT);
    1.16 +	physaddr_t machine = pfn_to_mfn(phys >> PAGE_SHIFT);
    1.17  	machine = (machine << PAGE_SHIFT) | (phys & ~PAGE_MASK);
    1.18  	return machine;
    1.19  }
    1.20 -static inline unsigned long machine_to_phys(unsigned long machine)
    1.21 +static inline physaddr_t machine_to_phys(physaddr_t machine)
    1.22  {
    1.23 -	unsigned long phys = mfn_to_pfn(machine >> PAGE_SHIFT);
    1.24 +	physaddr_t phys = mfn_to_pfn(machine >> PAGE_SHIFT);
    1.25  	phys = (phys << PAGE_SHIFT) | (machine & ~PAGE_MASK);
    1.26  	return phys;
    1.27  }
    1.28 @@ -86,8 +91,9 @@ typedef struct { unsigned long pte_low, 
    1.29  typedef struct { unsigned long long pmd; } pmd_t;
    1.30  typedef struct { unsigned long long pgd; } pgd_t;
    1.31  typedef struct { unsigned long long pgprot; } pgprot_t;
    1.32 -#define __pte(x) ({ unsigned long long _x = (x); \
    1.33 -    (((_x)&1) ? ((pte_t) {phys_to_machine(_x)}) : ((pte_t) {(_x)})); })
    1.34 +#define __pte(x) ({ unsigned long long _x = (x);        \
    1.35 +    if (_x & 1) _x = phys_to_machine(_x);               \
    1.36 +    ((pte_t) {(unsigned long)(_x), (unsigned long)(_x>>32)}); })
    1.37  #define __pgd(x) ({ unsigned long long _x = (x); \
    1.38      (((_x)&1) ? ((pgd_t) {phys_to_machine(_x)}) : ((pgd_t) {(_x)})); })
    1.39  #define __pmd(x) ({ unsigned long long _x = (x); \