diff options
author | Hirokazu Takata <takata@linux-m32r.org> | 2007-05-11 01:22:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-11 11:29:33 -0400 |
commit | 23c9bbbac57ae50dceadfda37b49785ec04dd42f (patch) | |
tree | ad04af7dc8306767613dd1774bced3a75b0540c0 /include/asm-m32r/pgtable-2level.h | |
parent | 0d4f64681695b0e389f7121eb647b27c602990bc (diff) |
m32r: fix pte_to_pgoff(), pgoff_to_pte() and __swp_type() macros
This patch is required to handle file-mapped or swapped-out pages
correctly.
- Fix pte_to_pgoff() and pgoff_to_pte() macros not to include
_PAGE_PROTNONE bit of PTE.
Mask value for { ACCESSED, N, (R, W, X), L, G } is not 0xef but 0x7f.
- Fix __swp_type() macro for MAX_SWAPFILES_SHIFT(=5), which is defined
in include/linux/swap.h.
* M32R TLB format
[0] [1:19] [20:23] [24:31]
+-----------------------+----+-------------+
| VPN |0000| ASID |
+-----------------------+----+-------------+
+-+---------------------+----+-+---+-+-+-+-+
|0 PPN |0000|N|AC |L|G|V| |
+-+---------------------+----+-+---+-+-+-+-+
|| RWX | |
* software bits in PTE || | +-- _PAGE_FILE | _PAGE_DIRTY
|| +---- _PAGE_PRESENT
|+---------------- _PAGE_ACCESSED
+----------------- _PAGE_PROTNONE
Signed-off-by: Hitoshi Yamamoto <hitoshiy@linux-m32r.org>
Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-m32r/pgtable-2level.h')
-rw-r--r-- | include/asm-m32r/pgtable-2level.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/asm-m32r/pgtable-2level.h b/include/asm-m32r/pgtable-2level.h index 750925726a10..bca3475f9595 100644 --- a/include/asm-m32r/pgtable-2level.h +++ b/include/asm-m32r/pgtable-2level.h | |||
@@ -71,8 +71,8 @@ static inline pmd_t *pmd_offset(pgd_t * dir, unsigned long address) | |||
71 | #define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) | 71 | #define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) |
72 | 72 | ||
73 | #define PTE_FILE_MAX_BITS 29 | 73 | #define PTE_FILE_MAX_BITS 29 |
74 | #define pte_to_pgoff(pte) (((pte_val(pte) >> 2) & 0xef) | (((pte_val(pte) >> 10)) << 7)) | 74 | #define pte_to_pgoff(pte) (((pte_val(pte) >> 2) & 0x7f) | (((pte_val(pte) >> 10)) << 7)) |
75 | #define pgoff_to_pte(off) ((pte_t) { (((off) & 0xef) << 2) | (((off) >> 7) << 10) | _PAGE_FILE }) | 75 | #define pgoff_to_pte(off) ((pte_t) { (((off) & 0x7f) << 2) | (((off) >> 7) << 10) | _PAGE_FILE }) |
76 | 76 | ||
77 | #endif /* __KERNEL__ */ | 77 | #endif /* __KERNEL__ */ |
78 | #endif /* _ASM_M32R_PGTABLE_2LEVEL_H */ | 78 | #endif /* _ASM_M32R_PGTABLE_2LEVEL_H */ |