diff options
author | Andi Kleen <ak@suse.de> | 2005-11-05 11:25:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-14 22:55:14 -0500 |
commit | 6b75aeedde1e8a8513393d3c1367bf81bc5b0c67 (patch) | |
tree | f8f25d30bf097a58e535adf3ac84b89b027b33e3 | |
parent | f6c2e3330d3fdd5474bc3756da46fca889a30e33 (diff) |
[PATCH] x86_64: Don't apply __PHYSICAL_MASK to page frame numbers
It is for physical addresses, not for PFNs.
Pointed out by Tejun Heo.
Cc: htejun@gmail.com
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | include/asm-x86_64/page.h | 2 | ||||
-rw-r--r-- | include/asm-x86_64/pgtable.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h index e5ab4d231f2c..06e489f32472 100644 --- a/include/asm-x86_64/page.h +++ b/include/asm-x86_64/page.h | |||
@@ -11,7 +11,7 @@ | |||
11 | #define PAGE_SIZE (1UL << PAGE_SHIFT) | 11 | #define PAGE_SIZE (1UL << PAGE_SHIFT) |
12 | #endif | 12 | #endif |
13 | #define PAGE_MASK (~(PAGE_SIZE-1)) | 13 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
14 | #define PHYSICAL_PAGE_MASK (~(PAGE_SIZE-1) & (__PHYSICAL_MASK << PAGE_SHIFT)) | 14 | #define PHYSICAL_PAGE_MASK (~(PAGE_SIZE-1) & __PHYSICAL_MASK) |
15 | 15 | ||
16 | #define THREAD_ORDER 1 | 16 | #define THREAD_ORDER 1 |
17 | #ifdef __ASSEMBLY__ | 17 | #ifdef __ASSEMBLY__ |
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index a204efb553dc..f8e87a57f3a7 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h | |||
@@ -246,7 +246,7 @@ static inline unsigned long pud_bad(pud_t pud) | |||
246 | #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) /* FIXME: is this | 246 | #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) /* FIXME: is this |
247 | right? */ | 247 | right? */ |
248 | #define pte_page(x) pfn_to_page(pte_pfn(x)) | 248 | #define pte_page(x) pfn_to_page(pte_pfn(x)) |
249 | #define pte_pfn(x) ((pte_val(x) >> PAGE_SHIFT) & __PHYSICAL_MASK) | 249 | #define pte_pfn(x) ((pte_val(x) & __PHYSICAL_MASK) >> PAGE_SHIFT) |
250 | 250 | ||
251 | static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot) | 251 | static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot) |
252 | { | 252 | { |
@@ -353,7 +353,7 @@ static inline pud_t *__pud_offset_k(pud_t *pud, unsigned long address) | |||
353 | #define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0) | 353 | #define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0) |
354 | #define pmd_bad(x) ((pmd_val(x) & (~PTE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE ) | 354 | #define pmd_bad(x) ((pmd_val(x) & (~PTE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE ) |
355 | #define pfn_pmd(nr,prot) (__pmd(((nr) << PAGE_SHIFT) | pgprot_val(prot))) | 355 | #define pfn_pmd(nr,prot) (__pmd(((nr) << PAGE_SHIFT) | pgprot_val(prot))) |
356 | #define pmd_pfn(x) ((pmd_val(x) >> PAGE_SHIFT) & __PHYSICAL_MASK) | 356 | #define pmd_pfn(x) ((pmd_val(x) & __PHYSICAL_MASK) >> PAGE_SHIFT) |
357 | 357 | ||
358 | #define pte_to_pgoff(pte) ((pte_val(pte) & PHYSICAL_PAGE_MASK) >> PAGE_SHIFT) | 358 | #define pte_to_pgoff(pte) ((pte_val(pte) & PHYSICAL_PAGE_MASK) >> PAGE_SHIFT) |
359 | #define pgoff_to_pte(off) ((pte_t) { ((off) << PAGE_SHIFT) | _PAGE_FILE }) | 359 | #define pgoff_to_pte(off) ((pte_t) { ((off) << PAGE_SHIFT) | _PAGE_FILE }) |