ia64/xen-unstable

changeset 19127:4edb72e1d0fe

[IA64] fix __virt_to_maddr()

__virt_to_maddr() should be updated acording to xen relocation.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Fri Jan 30 11:12:03 2009 +0900 (2009-01-30)
parents 78bea2f2b0e5
children 77393d4de777
files xen/include/asm-ia64/linux-xen/linux/efi.h xen/include/asm-ia64/xenpage.h
line diff
     1.1 --- a/xen/include/asm-ia64/linux-xen/linux/efi.h	Fri Jan 30 11:11:39 2009 +0900
     1.2 +++ b/xen/include/asm-ia64/linux-xen/linux/efi.h	Fri Jan 30 11:12:03 2009 +0900
     1.3 @@ -23,6 +23,9 @@
     1.4  
     1.5  #include <asm/page.h>
     1.6  #include <asm/system.h>
     1.7 +#ifdef XEN
     1.8 +#include <asm/pgtable.h>
     1.9 +#endif
    1.10  
    1.11  #define EFI_SUCCESS		0
    1.12  #define EFI_LOAD_ERROR          ( 1 | (1UL << (BITS_PER_LONG-1)))
     2.1 --- a/xen/include/asm-ia64/xenpage.h	Fri Jan 30 11:11:39 2009 +0900
     2.2 +++ b/xen/include/asm-ia64/xenpage.h	Fri Jan 30 11:12:03 2009 +0900
     2.3 @@ -17,18 +17,22 @@ extern int ia64_mfn_valid (unsigned long
     2.4  
     2.5  #include <asm/xensystem.h>
     2.6  
     2.7 -static inline unsigned long __virt_to_maddr(unsigned long va)
     2.8 -{
     2.9 -	if (va - KERNEL_START < xenheap_size)
    2.10 -		return xen_pstart + (va - KERNEL_START);
    2.11 -	else
    2.12 -		/* 
    2.13 -		 * Because the significant 8 bits of VA are used by Xen,
    2.14 -		 * and xen uses cached/uncached identity mapping.
    2.15 -		 * IA64_MAX_PHYS_BITS can't be larger than 56
    2.16 -		 */
    2.17 -		return (va & ((1UL << IA64_MAX_PHYS_BITS) - 1));
    2.18 -}
    2.19 +/*
    2.20 + * macro: avoid header inclustion hell
    2.21 + * static inline unsigned long __virt_to_maddr(unsigned long va)
    2.22 + */
    2.23 +/*
    2.24 + * Because the significant 8 bits of VA are used by Xen,
    2.25 + * and xen uses cached/uncached identity mapping.
    2.26 + * IA64_MAX_PHYS_BITS can't be larger than 56
    2.27 + */
    2.28 +#define __virt_to_maddr(va)						\
    2.29 +	({								\
    2.30 +		unsigned long __va__ = (va);				\
    2.31 +		(__va__ - KERNEL_START < KERNEL_TR_PAGE_SIZE) ?		\
    2.32 +			xen_pstart + (__va__ - KERNEL_START) :		\
    2.33 +			(__va__ & ((1UL << IA64_MAX_PHYS_BITS) - 1));	\
    2.34 +	})
    2.35  
    2.36  #define virt_to_maddr(va)	(__virt_to_maddr((unsigned long)va))
    2.37