-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Jeremy Fitzhardinge
authored and
Ingo Molnar
committed
Sep 14, 2008
1 parent
600715d
commit 947d049
Showing
3 changed files
with
9 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
#ifndef _LINUX_PFN_H_ | ||
#define _LINUX_PFN_H_ | ||
|
||
#ifndef __ASSEMBLY__ | ||
#include <linux/types.h> | ||
#endif | ||
|
||
#define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK) | ||
#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) | ||
#define PFN_DOWN(x) ((x) >> PAGE_SHIFT) | ||
#define PFN_PHYS(x) ((x) << PAGE_SHIFT) | ||
#define PFN_PHYS(x) ((phys_addr_t)(x) << PAGE_SHIFT) | ||
|
||
#endif |