aboutsummaryrefslogtreecommitdiffstats
path: root/arch/score/mm
diff options
context:
space:
mode:
authorChen Liqin <liqin.chen@sunplusct.com>2009-11-18 00:22:33 -0500
committerChen Liqin <liqin.chen@sunplusct.com>2009-12-17 05:28:31 -0500
commit11ab3f3d3c2474d3ed6912443de74c3972bd6f23 (patch)
tree51b121a80494989c220b10dbef1f2c463882899f /arch/score/mm
parent718deb6b61e34c200c1f2b706176d9aac334cb2d (diff)
score: add flush_dcahce_page and PG_dcache_dirty define
Signed-off-by: Cui Bixiong <bixiong@sunnorth.com.cn> Signed-off-by: Chen Liqin <liqin.chen@sunplusct.com> modified: arch/score/include/asm/cacheflush.h modified: arch/score/mm/cache.c
Diffstat (limited to 'arch/score/mm')
-rw-r--r--arch/score/mm/cache.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/arch/score/mm/cache.c b/arch/score/mm/cache.c
index dbac9d9dfddd..b25e95743600 100644
--- a/arch/score/mm/cache.c
+++ b/arch/score/mm/cache.c
@@ -29,6 +29,7 @@
29#include <linux/mm.h> 29#include <linux/mm.h>
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/sched.h> 31#include <linux/sched.h>
32#include <linux/fs.h>
32 33
33#include <asm/mmu_context.h> 34#include <asm/mmu_context.h>
34 35
@@ -51,6 +52,27 @@ static void flush_data_cache_page(unsigned long addr)
51 } 52 }
52} 53}
53 54
55void flush_dcache_page(struct page *page)
56{
57 struct address_space *mapping = page_mapping(page);
58 unsigned long addr;
59
60 if (PageHighMem(page))
61 return;
62 if (mapping && !mapping_mapped(mapping)) {
63 set_bit(PG_dcache_dirty, &(page)->flags);
64 return;
65 }
66
67 /*
68 * We could delay the flush for the !page_mapping case too. But that
69 * case is for exec env/arg pages and those are %99 certainly going to
70 * get faulted into the tlb (and thus flushed) anyways.
71 */
72 addr = (unsigned long) page_address(page);
73 flush_data_cache_page(addr);
74}
75
54/* called by update_mmu_cache. */ 76/* called by update_mmu_cache. */
55void __update_cache(struct vm_area_struct *vma, unsigned long address, 77void __update_cache(struct vm_area_struct *vma, unsigned long address,
56 pte_t pte) 78 pte_t pte)
@@ -63,11 +85,11 @@ void __update_cache(struct vm_area_struct *vma, unsigned long address,
63 if (unlikely(!pfn_valid(pfn))) 85 if (unlikely(!pfn_valid(pfn)))
64 return; 86 return;
65 page = pfn_to_page(pfn); 87 page = pfn_to_page(pfn);
66 if (page_mapping(page) && test_bit(PG_arch_1, &page->flags)) { 88 if (page_mapping(page) && test_bit(PG_dcache_dirty, &(page)->flags)) {
67 addr = (unsigned long) page_address(page); 89 addr = (unsigned long) page_address(page);
68 if (exec) 90 if (exec)
69 flush_data_cache_page(addr); 91 flush_data_cache_page(addr);
70 clear_bit(PG_arch_1, &page->flags); 92 clear_bit(PG_dcache_dirty, &(page)->flags);
71 } 93 }
72} 94}
73 95