diff -r d8fd24b43080 linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/page.h --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/page.h Mon Aug 22 10:18:14 2005 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/page.h Thu Aug 25 23:02:23 2005 @@ -64,7 +64,28 @@ /**** MACHINE <-> PHYSICAL CONVERSION MACROS ****/ extern u32 *phys_to_machine_mapping; #define pfn_to_mfn(_pfn) ((unsigned long) phys_to_machine_mapping[(unsigned int)(_pfn)]) -#define mfn_to_pfn(_mfn) ((unsigned long) machine_to_phys_mapping[(unsigned int)(_mfn)]) + +static inline unsigned long mfn_to_pfn(unsigned long mfn) +{ + unsigned int pfn; + u32* addr = &machine_to_phys_mapping[(unsigned int)(mfn)]; + + __asm__ __volatile__( + "1: movl %1,%k0\n" + "2:\n" + ".section .fixup,\"ax\"\n" + "3: movl %2,%k0\n" + " jmp 2b\n" + ".previous\n" + ".section __ex_table,\"a\"\n" + " .align 8\n" + " .quad 1b,3b\n" + ".previous" + : "=r"(pfn) + : "m"(*addr), "i"(0x55555555)); + + return (unsigned long)pfn; +} /* Definitions for machine and pseudophysical addresses. */ typedef unsigned long paddr_t;