aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm/pgtable_32.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-09-20 14:24:58 -0400
committerIngo Molnar <mingo@elte.hu>2009-09-20 14:25:03 -0400
commitbfefb7a0c6e08736f2d5917c468467f134bf28bb (patch)
tree7aa7084114dc083fe5b4d7b532901bdeb67188e7 /arch/sh/include/asm/pgtable_32.h
parent8d0cc631f6dd0a9283ceb7d61d8b85ecbcd355ea (diff)
parent78f28b7c555359c67c2a0d23f7436e915329421e (diff)
Merge branch 'linus' into x86/urgent
Merge reason: Bring in changes that the next patch will depend on. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/sh/include/asm/pgtable_32.h')
-rw-r--r--arch/sh/include/asm/pgtable_32.h30
1 files changed, 25 insertions, 5 deletions
diff --git a/arch/sh/include/asm/pgtable_32.h b/arch/sh/include/asm/pgtable_32.h
index 72ea209195bd..c0d359ce337b 100644
--- a/arch/sh/include/asm/pgtable_32.h
+++ b/arch/sh/include/asm/pgtable_32.h
@@ -20,7 +20,7 @@
20 * - Bit 9 is reserved by everyone and used by _PAGE_PROTNONE. 20 * - Bit 9 is reserved by everyone and used by _PAGE_PROTNONE.
21 * 21 *
22 * - Bits 10 and 11 are low bits of the PPN that are reserved on >= 4K pages. 22 * - Bits 10 and 11 are low bits of the PPN that are reserved on >= 4K pages.
23 * Bit 10 is used for _PAGE_ACCESSED, bit 11 remains unused. 23 * Bit 10 is used for _PAGE_ACCESSED, and bit 11 is used for _PAGE_SPECIAL.
24 * 24 *
25 * - On 29 bit platforms, bits 31 to 29 are used for the space attributes 25 * - On 29 bit platforms, bits 31 to 29 are used for the space attributes
26 * and timing control which (together with bit 0) are moved into the 26 * and timing control which (together with bit 0) are moved into the
@@ -52,6 +52,7 @@
52#define _PAGE_PROTNONE 0x200 /* software: if not present */ 52#define _PAGE_PROTNONE 0x200 /* software: if not present */
53#define _PAGE_ACCESSED 0x400 /* software: page referenced */ 53#define _PAGE_ACCESSED 0x400 /* software: page referenced */
54#define _PAGE_FILE _PAGE_WT /* software: pagecache or swap? */ 54#define _PAGE_FILE _PAGE_WT /* software: pagecache or swap? */
55#define _PAGE_SPECIAL 0x800 /* software: special page */
55 56
56#define _PAGE_SZ_MASK (_PAGE_SZ0 | _PAGE_SZ1) 57#define _PAGE_SZ_MASK (_PAGE_SZ0 | _PAGE_SZ1)
57#define _PAGE_PR_MASK (_PAGE_RW | _PAGE_USER) 58#define _PAGE_PR_MASK (_PAGE_RW | _PAGE_USER)
@@ -86,6 +87,14 @@
86#define _PAGE_PCC_ATR8 0x60000000 /* Attribute Memory space, 8 bit bus */ 87#define _PAGE_PCC_ATR8 0x60000000 /* Attribute Memory space, 8 bit bus */
87#define _PAGE_PCC_ATR16 0x60000001 /* Attribute Memory space, 6 bit bus */ 88#define _PAGE_PCC_ATR16 0x60000001 /* Attribute Memory space, 6 bit bus */
88 89
90#ifndef CONFIG_X2TLB
91/* copy the ptea attributes */
92static inline unsigned long copy_ptea_attributes(unsigned long x)
93{
94 return ((x >> 28) & 0xe) | (x & 0x1);
95}
96#endif
97
89/* Mask which drops unused bits from the PTEL value */ 98/* Mask which drops unused bits from the PTEL value */
90#if defined(CONFIG_CPU_SH3) 99#if defined(CONFIG_CPU_SH3)
91#define _PAGE_CLEAR_FLAGS (_PAGE_PROTNONE | _PAGE_ACCESSED| \ 100#define _PAGE_CLEAR_FLAGS (_PAGE_PROTNONE | _PAGE_ACCESSED| \
@@ -148,8 +157,12 @@
148# define _PAGE_SZHUGE (_PAGE_FLAGS_HARD) 157# define _PAGE_SZHUGE (_PAGE_FLAGS_HARD)
149#endif 158#endif
150 159
160/*
161 * Mask of bits that are to be preserved accross pgprot changes.
162 */
151#define _PAGE_CHG_MASK \ 163#define _PAGE_CHG_MASK \
152 (PTE_MASK | _PAGE_ACCESSED | _PAGE_CACHABLE | _PAGE_DIRTY) 164 (PTE_MASK | _PAGE_ACCESSED | _PAGE_CACHABLE | \
165 _PAGE_DIRTY | _PAGE_SPECIAL)
153 166
154#ifndef __ASSEMBLY__ 167#ifndef __ASSEMBLY__
155 168
@@ -328,7 +341,7 @@ static inline void set_pte(pte_t *ptep, pte_t pte)
328#define pte_dirty(pte) ((pte).pte_low & _PAGE_DIRTY) 341#define pte_dirty(pte) ((pte).pte_low & _PAGE_DIRTY)
329#define pte_young(pte) ((pte).pte_low & _PAGE_ACCESSED) 342#define pte_young(pte) ((pte).pte_low & _PAGE_ACCESSED)
330#define pte_file(pte) ((pte).pte_low & _PAGE_FILE) 343#define pte_file(pte) ((pte).pte_low & _PAGE_FILE)
331#define pte_special(pte) (0) 344#define pte_special(pte) ((pte).pte_low & _PAGE_SPECIAL)
332 345
333#ifdef CONFIG_X2TLB 346#ifdef CONFIG_X2TLB
334#define pte_write(pte) ((pte).pte_high & _PAGE_EXT_USER_WRITE) 347#define pte_write(pte) ((pte).pte_high & _PAGE_EXT_USER_WRITE)
@@ -358,8 +371,9 @@ PTE_BIT_FUNC(low, mkclean, &= ~_PAGE_DIRTY);
358PTE_BIT_FUNC(low, mkdirty, |= _PAGE_DIRTY); 371PTE_BIT_FUNC(low, mkdirty, |= _PAGE_DIRTY);
359PTE_BIT_FUNC(low, mkold, &= ~_PAGE_ACCESSED); 372PTE_BIT_FUNC(low, mkold, &= ~_PAGE_ACCESSED);
360PTE_BIT_FUNC(low, mkyoung, |= _PAGE_ACCESSED); 373PTE_BIT_FUNC(low, mkyoung, |= _PAGE_ACCESSED);
374PTE_BIT_FUNC(low, mkspecial, |= _PAGE_SPECIAL);
361 375
362static inline pte_t pte_mkspecial(pte_t pte) { return pte; } 376#define __HAVE_ARCH_PTE_SPECIAL
363 377
364/* 378/*
365 * Macro and implementation to make a page protection as uncachable. 379 * Macro and implementation to make a page protection as uncachable.
@@ -394,13 +408,19 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
394 408
395/* to find an entry in a page-table-directory. */ 409/* to find an entry in a page-table-directory. */
396#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) 410#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
397#define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address)) 411#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
412#define __pgd_offset(address) pgd_index(address)
398 413
399/* to find an entry in a kernel page-table-directory */ 414/* to find an entry in a kernel page-table-directory */
400#define pgd_offset_k(address) pgd_offset(&init_mm, address) 415#define pgd_offset_k(address) pgd_offset(&init_mm, address)
401 416
417#define __pud_offset(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
418#define __pmd_offset(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
419
402/* Find an entry in the third-level page table.. */ 420/* Find an entry in the third-level page table.. */
403#define pte_index(address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) 421#define pte_index(address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
422#define __pte_offset(address) pte_index(address)
423
404#define pte_offset_kernel(dir, address) \ 424#define pte_offset_kernel(dir, address) \
405 ((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(address)) 425 ((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(address))
406#define pte_offset_map(dir, address) pte_offset_kernel(dir, address) 426#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)