aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-m32r/pgtable.h
diff options
context:
space:
mode:
authorHirokazu Takata <takata@linux-m32r.org>2007-05-10 22:22:28 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-11 08:29:33 -0700
commit23c9bbbac57ae50dceadfda37b49785ec04dd42f (patch)
treead04af7dc8306767613dd1774bced3a75b0540c0 /include/asm-m32r/pgtable.h
parentm32r: fix tme_handler to check _PAGE_PRESENT bit (diff)
downloadlinux-dev-23c9bbbac57ae50dceadfda37b49785ec04dd42f.tar.xz
linux-dev-23c9bbbac57ae50dceadfda37b49785ec04dd42f.zip
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 '')
-rw-r--r--include/asm-m32r/pgtable.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/asm-m32r/pgtable.h b/include/asm-m32r/pgtable.h
index 8b2a2f17e695..6604303fc47c 100644
--- a/include/asm-m32r/pgtable.h
+++ b/include/asm-m32r/pgtable.h
@@ -366,7 +366,7 @@ static inline void pmd_set(pmd_t * pmdp, pte_t * ptep)
#define pte_unmap_nested(pte) do { } while (0)
/* Encode and de-code a swap entry */
-#define __swp_type(x) (((x).val >> 2) & 0x3f)
+#define __swp_type(x) (((x).val >> 2) & 0x1f)
#define __swp_offset(x) ((x).val >> 10)
#define __swp_entry(type, offset) \
((swp_entry_t) { ((type) << 2) | ((offset) << 10) })