diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-09-11 04:31:48 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-14 11:24:26 -0400 |
commit | 947d0496cf3e12ebfa70b3eaf561c25403247ce9 (patch) | |
tree | f2f77730b77c50735669dca5ff42afee69463d0e /include/asm-x86 | |
parent | 600715dcdf567c86f8b2c6173fcfb4b873e25a19 (diff) |
generic: make PFN_PHYS explicitly return phys_addr_t
PFN_PHYS, as its name suggests, turns a pfn into a physical address.
However, it is a macro which just operates on its argument without
modifying its type. pfns are typed unsigned long, but an unsigned
long may not be long enough to hold a physical address (32-bit systems
with more than 32 bits of physcial address).
Make sure we cast to phys_addr_t to return a complete result.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/xen/page.h | 4 |
1 files changed, 2 insertions, 2 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) | |||
76 | static inline xmaddr_t phys_to_machine(xpaddr_t phys) | 76 | static 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 | ||
82 | static inline xpaddr_t machine_to_phys(xmaddr_t machine) | 82 | static 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 | /* |