diff options
Diffstat (limited to 'arch/score/mm')
-rw-r--r-- | arch/score/mm/cache.c | 26 | ||||
-rw-r--r-- | arch/score/mm/init.c | 7 |
2 files changed, 25 insertions, 8 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 | ||
55 | void 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. */ |
55 | void __update_cache(struct vm_area_struct *vma, unsigned long address, | 77 | void __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 | ||
diff --git a/arch/score/mm/init.c b/arch/score/mm/init.c index f684a590c21d..7f001bbedb00 100644 --- a/arch/score/mm/init.c +++ b/arch/score/mm/init.c | |||
@@ -83,7 +83,6 @@ void __init mem_init(void) | |||
83 | unsigned long codesize, reservedpages, datasize, initsize; | 83 | unsigned long codesize, reservedpages, datasize, initsize; |
84 | unsigned long tmp, ram = 0; | 84 | unsigned long tmp, ram = 0; |
85 | 85 | ||
86 | max_mapnr = max_low_pfn; | ||
87 | high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT); | 86 | high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT); |
88 | totalram_pages += free_all_bootmem(); | 87 | totalram_pages += free_all_bootmem(); |
89 | totalram_pages -= setup_zero_page(); /* Setup zeroed pages. */ | 88 | totalram_pages -= setup_zero_page(); /* Setup zeroed pages. */ |
@@ -101,17 +100,13 @@ void __init mem_init(void) | |||
101 | datasize = (unsigned long) &_edata - (unsigned long) &_etext; | 100 | datasize = (unsigned long) &_edata - (unsigned long) &_etext; |
102 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; | 101 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; |
103 | 102 | ||
104 | kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT); | ||
105 | kclist_add(&kcore_vmalloc, (void *) VMALLOC_START, | ||
106 | VMALLOC_END - VMALLOC_START); | ||
107 | |||
108 | printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, " | 103 | printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, " |
109 | "%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n", | 104 | "%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n", |
110 | (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), | 105 | (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), |
111 | ram << (PAGE_SHIFT-10), codesize >> 10, | 106 | ram << (PAGE_SHIFT-10), codesize >> 10, |
112 | reservedpages << (PAGE_SHIFT-10), datasize >> 10, | 107 | reservedpages << (PAGE_SHIFT-10), datasize >> 10, |
113 | initsize >> 10, | 108 | initsize >> 10, |
114 | (unsigned long) (totalhigh_pages << (PAGE_SHIFT-10))); | 109 | totalhigh_pages << (PAGE_SHIFT-10)); |
115 | } | 110 | } |
116 | #endif /* !CONFIG_NEED_MULTIPLE_NODES */ | 111 | #endif /* !CONFIG_NEED_MULTIPLE_NODES */ |
117 | 112 | ||