diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-15 13:01:15 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-15 13:01:15 -0500 |
commit | f99c6bb6e2e9c35bd3dc0b1d0faa28bd6970930d (patch) | |
tree | 338721c5084d536208a944567c2dface6a38a994 /arch/sh/mm/pg-sh7705.c | |
parent | e0a04cffa4e97e1e53625e40e70895c882e8972f (diff) | |
parent | 9c57548f17806ffd8e4dc4f7973ce78bbfbc2079 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6: (35 commits)
sh: rts7751r2d board updates.
sh: Kill off dead bigsur and ec3104 boards.
sh: Fixup r7780rp pata_platform for devres conversion.
sh: Revert TLB miss fast-path changes that broke PTEA parts.
sh: Compile fix for heartbeat consolidation.
sh: heartbeat consolidation for banked LEDs.
sh: define dma noncoherent API functions.
sh: Missing flush_dcache_all() proto in cacheflush.h.
sh: Kill dead/unused ISA code from __ioremap().
sh: Add cpu-features header to asm/Kbuild.
sh: Move __KERNEL__ up in asm/page.h.
sh: Fix syscall numbering breakage.
sh: dcache write-back for R7780RP PIO.
sh: Switch to local TLB flush variants in additional callsites.
sh: Local TLB flushing variants for SMP prep.
sh: Fixup cpu_data references for the non-boot CPUs.
sh: Use a per-cpu ASID cache.
sh: add SH_CLK_MD Kconfig default.
sh: Fixup SHMIN INTC register definitions.
sh: SH-DMAC compile fixes
...
Diffstat (limited to 'arch/sh/mm/pg-sh7705.c')
-rw-r--r-- | arch/sh/mm/pg-sh7705.c | 37 |
1 files changed, 5 insertions, 32 deletions
diff --git a/arch/sh/mm/pg-sh7705.c b/arch/sh/mm/pg-sh7705.c index ff9ece986cbc..887ab9d18ccd 100644 --- a/arch/sh/mm/pg-sh7705.c +++ b/arch/sh/mm/pg-sh7705.c | |||
@@ -7,9 +7,7 @@ | |||
7 | * This file is subject to the terms and conditions of the GNU General Public | 7 | * This file is subject to the terms and conditions of the GNU General Public |
8 | * License. See the file "COPYING" in the main directory of this archive | 8 | * License. See the file "COPYING" in the main directory of this archive |
9 | * for more details. | 9 | * for more details. |
10 | * | ||
11 | */ | 10 | */ |
12 | |||
13 | #include <linux/init.h> | 11 | #include <linux/init.h> |
14 | #include <linux/mman.h> | 12 | #include <linux/mman.h> |
15 | #include <linux/mm.h> | 13 | #include <linux/mm.h> |
@@ -45,13 +43,13 @@ static inline void __flush_purge_virtual_region(void *p1, void *virt, int size) | |||
45 | 43 | ||
46 | p = __pa(p1_begin); | 44 | p = __pa(p1_begin); |
47 | 45 | ||
48 | ways = cpu_data->dcache.ways; | 46 | ways = current_cpu_data.dcache.ways; |
49 | addr = CACHE_OC_ADDRESS_ARRAY; | 47 | addr = CACHE_OC_ADDRESS_ARRAY; |
50 | 48 | ||
51 | do { | 49 | do { |
52 | unsigned long data; | 50 | unsigned long data; |
53 | 51 | ||
54 | addr |= (v & cpu_data->dcache.entry_mask); | 52 | addr |= (v & current_cpu_data.dcache.entry_mask); |
55 | 53 | ||
56 | data = ctrl_inl(addr); | 54 | data = ctrl_inl(addr); |
57 | if ((data & CACHE_PHYSADDR_MASK) == | 55 | if ((data & CACHE_PHYSADDR_MASK) == |
@@ -60,7 +58,7 @@ static inline void __flush_purge_virtual_region(void *p1, void *virt, int size) | |||
60 | ctrl_outl(data, addr); | 58 | ctrl_outl(data, addr); |
61 | } | 59 | } |
62 | 60 | ||
63 | addr += cpu_data->dcache.way_incr; | 61 | addr += current_cpu_data.dcache.way_incr; |
64 | } while (--ways); | 62 | } while (--ways); |
65 | 63 | ||
66 | p1_begin += L1_CACHE_BYTES; | 64 | p1_begin += L1_CACHE_BYTES; |
@@ -76,7 +74,6 @@ void clear_user_page(void *to, unsigned long address, struct page *pg) | |||
76 | { | 74 | { |
77 | struct page *page = virt_to_page(to); | 75 | struct page *page = virt_to_page(to); |
78 | 76 | ||
79 | __set_bit(PG_mapped, &page->flags); | ||
80 | if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) { | 77 | if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) { |
81 | clear_page(to); | 78 | clear_page(to); |
82 | __flush_wback_region(to, PAGE_SIZE); | 79 | __flush_wback_region(to, PAGE_SIZE); |
@@ -95,12 +92,11 @@ void clear_user_page(void *to, unsigned long address, struct page *pg) | |||
95 | * @from: P1 address | 92 | * @from: P1 address |
96 | * @address: U0 address to be mapped | 93 | * @address: U0 address to be mapped |
97 | */ | 94 | */ |
98 | void copy_user_page(void *to, void *from, unsigned long address, struct page *pg) | 95 | void copy_user_page(void *to, void *from, unsigned long address, |
96 | struct page *pg) | ||
99 | { | 97 | { |
100 | struct page *page = virt_to_page(to); | 98 | struct page *page = virt_to_page(to); |
101 | 99 | ||
102 | |||
103 | __set_bit(PG_mapped, &page->flags); | ||
104 | if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) { | 100 | if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) { |
105 | copy_page(to, from); | 101 | copy_page(to, from); |
106 | __flush_wback_region(to, PAGE_SIZE); | 102 | __flush_wback_region(to, PAGE_SIZE); |
@@ -112,26 +108,3 @@ void copy_user_page(void *to, void *from, unsigned long address, struct page *pg | |||
112 | __flush_wback_region(to, PAGE_SIZE); | 108 | __flush_wback_region(to, PAGE_SIZE); |
113 | } | 109 | } |
114 | } | 110 | } |
115 | |||
116 | /* | ||
117 | * For SH7705, we have our own implementation for ptep_get_and_clear | ||
118 | * Copied from pg-sh4.c | ||
119 | */ | ||
120 | inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | ||
121 | { | ||
122 | pte_t pte = *ptep; | ||
123 | |||
124 | pte_clear(mm, addr, ptep); | ||
125 | if (!pte_not_present(pte)) { | ||
126 | unsigned long pfn = pte_pfn(pte); | ||
127 | if (pfn_valid(pfn)) { | ||
128 | struct page *page = pfn_to_page(pfn); | ||
129 | struct address_space *mapping = page_mapping(page); | ||
130 | if (!mapping || !mapping_writably_mapped(mapping)) | ||
131 | __clear_bit(PG_mapped, &page->flags); | ||
132 | } | ||
133 | } | ||
134 | |||
135 | return pte; | ||
136 | } | ||
137 | |||