aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-x86/xen/page.h4
-rw-r--r--include/linux/pfn.h6
2 files changed, 7 insertions, 3 deletions
diff --git a/include/asm-x86/xen/page.h b/include/asm-x86/xen/page.h
index 7b3835d3b77d..de9170b537ab 100644
--- a/include/asm-x86/xen/page.h
+++ b/include/asm-x86/xen/page.h
@@ -76,13 +76,13 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
76static inline xmaddr_t phys_to_machine(xpaddr_t phys) 76static inline xmaddr_t phys_to_machine(xpaddr_t phys)
77{ 77{
78 unsigned offset = phys.paddr & ~PAGE_MASK; 78 unsigned offset = phys.paddr & ~PAGE_MASK;
79 return XMADDR(PFN_PHYS((u64)pfn_to_mfn(PFN_DOWN(phys.paddr))) | offset); 79 return XMADDR(PFN_PHYS(pfn_to_mfn(PFN_DOWN(phys.paddr))) | offset);
80} 80}
81 81
82static inline xpaddr_t machine_to_phys(xmaddr_t machine) 82static inline xpaddr_t machine_to_phys(xmaddr_t machine)
83{ 83{
84 unsigned offset = machine.maddr & ~PAGE_MASK; 84 unsigned offset = machine.maddr & ~PAGE_MASK;
85 return XPADDR(PFN_PHYS((u64)mfn_to_pfn(PFN_DOWN(machine.maddr))) | offset); 85 return XPADDR(PFN_PHYS(mfn_to_pfn(PFN_DOWN(machine.maddr))) | offset);
86} 86}
87 87
88/* 88/*
diff --git a/include/linux/pfn.h b/include/linux/pfn.h
index bb01f8b92b56..7646637221f3 100644
--- a/include/linux/pfn.h
+++ b/include/linux/pfn.h
@@ -1,9 +1,13 @@
1#ifndef _LINUX_PFN_H_ 1#ifndef _LINUX_PFN_H_
2#define _LINUX_PFN_H_ 2#define _LINUX_PFN_H_
3 3
4#ifndef __ASSEMBLY__
5#include <linux/types.h>
6#endif
7
4#define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK) 8#define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK)
5#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) 9#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
6#define PFN_DOWN(x) ((x) >> PAGE_SHIFT) 10#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
7#define PFN_PHYS(x) ((x) << PAGE_SHIFT) 11#define PFN_PHYS(x) ((phys_addr_t)(x) << PAGE_SHIFT)
8 12
9#endif 13#endif