diff options
author | Paul Mundt <lethal@linux-sh.org> | 2006-11-20 00:30:26 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2006-12-05 20:45:37 -0500 |
commit | 21440cf04a64cd1b1209c12a6e1a3afba2a28709 (patch) | |
tree | 9af7a89c4c711b8433b3b1e23e2ba0c95f82fbf7 /arch/sh/mm/pg-sh4.c | |
parent | b552c7e8bceae8a04ae79ecee6fa369c1ba4f8e4 (diff) |
sh: Preliminary support for SH-X2 MMU.
This adds some preliminary support for the SH-X2 MMU, used by
newer SH-4A parts (particularly SH7785).
This MMU implements a 'compat' mode with SH-X MMUs and an
'extended' mode for SH-X2 extended features. Extended features
include additional page sizes (8kB, 4MB, 64MB), as well as the
addition of page execute permissions.
The extended mode attributes are placed in a second data array,
which requires us to switch to 64-bit PTEs when in X2 mode.
With the addition of the exec perms, we also overhaul the mmap
prots somewhat, now that it's possible to handle them more
intelligently.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm/pg-sh4.c')
-rw-r--r-- | arch/sh/mm/pg-sh4.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/arch/sh/mm/pg-sh4.c b/arch/sh/mm/pg-sh4.c index 07371ed7a313..e973ac3b13be 100644 --- a/arch/sh/mm/pg-sh4.c +++ b/arch/sh/mm/pg-sh4.c | |||
@@ -37,10 +37,6 @@ void clear_user_page(void *to, unsigned long address, struct page *page) | |||
37 | if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) | 37 | if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) |
38 | clear_page(to); | 38 | clear_page(to); |
39 | else { | 39 | else { |
40 | pgprot_t pgprot = __pgprot(_PAGE_PRESENT | | ||
41 | _PAGE_RW | _PAGE_CACHABLE | | ||
42 | _PAGE_DIRTY | _PAGE_ACCESSED | | ||
43 | _PAGE_HW_SHARED | _PAGE_FLAGS_HARD); | ||
44 | unsigned long phys_addr = PHYSADDR(to); | 40 | unsigned long phys_addr = PHYSADDR(to); |
45 | unsigned long p3_addr = P3SEG + (address & CACHE_ALIAS); | 41 | unsigned long p3_addr = P3SEG + (address & CACHE_ALIAS); |
46 | pgd_t *pgd = pgd_offset_k(p3_addr); | 42 | pgd_t *pgd = pgd_offset_k(p3_addr); |
@@ -50,7 +46,7 @@ void clear_user_page(void *to, unsigned long address, struct page *page) | |||
50 | pte_t entry; | 46 | pte_t entry; |
51 | unsigned long flags; | 47 | unsigned long flags; |
52 | 48 | ||
53 | entry = pfn_pte(phys_addr >> PAGE_SHIFT, pgprot); | 49 | entry = pfn_pte(phys_addr >> PAGE_SHIFT, PAGE_KERNEL); |
54 | down(&p3map_sem[(address & CACHE_ALIAS)>>12]); | 50 | down(&p3map_sem[(address & CACHE_ALIAS)>>12]); |
55 | set_pte(pte, entry); | 51 | set_pte(pte, entry); |
56 | local_irq_save(flags); | 52 | local_irq_save(flags); |
@@ -77,10 +73,6 @@ void copy_user_page(void *to, void *from, unsigned long address, | |||
77 | if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) | 73 | if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) |
78 | copy_page(to, from); | 74 | copy_page(to, from); |
79 | else { | 75 | else { |
80 | pgprot_t pgprot = __pgprot(_PAGE_PRESENT | | ||
81 | _PAGE_RW | _PAGE_CACHABLE | | ||
82 | _PAGE_DIRTY | _PAGE_ACCESSED | | ||
83 | _PAGE_HW_SHARED | _PAGE_FLAGS_HARD); | ||
84 | unsigned long phys_addr = PHYSADDR(to); | 76 | unsigned long phys_addr = PHYSADDR(to); |
85 | unsigned long p3_addr = P3SEG + (address & CACHE_ALIAS); | 77 | unsigned long p3_addr = P3SEG + (address & CACHE_ALIAS); |
86 | pgd_t *pgd = pgd_offset_k(p3_addr); | 78 | pgd_t *pgd = pgd_offset_k(p3_addr); |
@@ -90,7 +82,7 @@ void copy_user_page(void *to, void *from, unsigned long address, | |||
90 | pte_t entry; | 82 | pte_t entry; |
91 | unsigned long flags; | 83 | unsigned long flags; |
92 | 84 | ||
93 | entry = pfn_pte(phys_addr >> PAGE_SHIFT, pgprot); | 85 | entry = pfn_pte(phys_addr >> PAGE_SHIFT, PAGE_KERNEL); |
94 | down(&p3map_sem[(address & CACHE_ALIAS)>>12]); | 86 | down(&p3map_sem[(address & CACHE_ALIAS)>>12]); |
95 | set_pte(pte, entry); | 87 | set_pte(pte, entry); |
96 | local_irq_save(flags); | 88 | local_irq_save(flags); |