diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-17 11:08:57 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-17 11:08:57 -0500 |
commit | a377d181e65241344dd95aa4a42c477477be03f1 (patch) | |
tree | bb624d0d33a95c9894899a22ea3d896ede66ce1e | |
parent | 22a80593598736e33080c6877be6ae99ec091e02 (diff) | |
parent | ef8355c3a3c7a4d7f1d49881937337ea78ed306a (diff) |
Merge branch 'for-linus' of git://gitserver.sunplusct.com/linux-2.6-score
* 'for-linus' of git://gitserver.sunplusct.com/linux-2.6-score:
score: include asm-generic/param.h in asm/delay.h.
score: fixed pfn_valid define.
score: add flush_dcahce_page and PG_dcache_dirty define
-rw-r--r-- | arch/score/include/asm/cacheflush.h | 4 | ||||
-rw-r--r-- | arch/score/include/asm/delay.h | 2 | ||||
-rw-r--r-- | arch/score/include/asm/page.h | 2 | ||||
-rw-r--r-- | arch/score/kernel/setup.c | 1 | ||||
-rw-r--r-- | arch/score/mm/cache.c | 26 | ||||
-rw-r--r-- | arch/score/mm/init.c | 5 |
6 files changed, 31 insertions, 9 deletions
diff --git a/arch/score/include/asm/cacheflush.h b/arch/score/include/asm/cacheflush.h index caaba24036e..1d545d0ce20 100644 --- a/arch/score/include/asm/cacheflush.h +++ b/arch/score/include/asm/cacheflush.h | |||
@@ -14,10 +14,12 @@ extern void flush_cache_sigtramp(unsigned long addr); | |||
14 | extern void flush_icache_all(void); | 14 | extern void flush_icache_all(void); |
15 | extern void flush_icache_range(unsigned long start, unsigned long end); | 15 | extern void flush_icache_range(unsigned long start, unsigned long end); |
16 | extern void flush_dcache_range(unsigned long start, unsigned long end); | 16 | extern void flush_dcache_range(unsigned long start, unsigned long end); |
17 | extern void flush_dcache_page(struct page *page); | ||
18 | |||
19 | #define PG_dcache_dirty PG_arch_1 | ||
17 | 20 | ||
18 | #define flush_cache_dup_mm(mm) do {} while (0) | 21 | #define flush_cache_dup_mm(mm) do {} while (0) |
19 | #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0 | 22 | #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0 |
20 | #define flush_dcache_page(page) do {} while (0) | ||
21 | #define flush_dcache_mmap_lock(mapping) do {} while (0) | 23 | #define flush_dcache_mmap_lock(mapping) do {} while (0) |
22 | #define flush_dcache_mmap_unlock(mapping) do {} while (0) | 24 | #define flush_dcache_mmap_unlock(mapping) do {} while (0) |
23 | #define flush_cache_vmap(start, end) do {} while (0) | 25 | #define flush_cache_vmap(start, end) do {} while (0) |
diff --git a/arch/score/include/asm/delay.h b/arch/score/include/asm/delay.h index 6726ec199dc..529e494712a 100644 --- a/arch/score/include/asm/delay.h +++ b/arch/score/include/asm/delay.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _ASM_SCORE_DELAY_H | 1 | #ifndef _ASM_SCORE_DELAY_H |
2 | #define _ASM_SCORE_DELAY_H | 2 | #define _ASM_SCORE_DELAY_H |
3 | 3 | ||
4 | #include <asm-generic/param.h> | ||
5 | |||
4 | static inline void __delay(unsigned long loops) | 6 | static inline void __delay(unsigned long loops) |
5 | { | 7 | { |
6 | /* 3 cycles per loop. */ | 8 | /* 3 cycles per loop. */ |
diff --git a/arch/score/include/asm/page.h b/arch/score/include/asm/page.h index d92a5a2d36d..1e9ade8e77e 100644 --- a/arch/score/include/asm/page.h +++ b/arch/score/include/asm/page.h | |||
@@ -74,7 +74,7 @@ extern unsigned long max_pfn; | |||
74 | #define page_to_bus(page) (page_to_phys(page)) | 74 | #define page_to_bus(page) (page_to_phys(page)) |
75 | #define phys_to_page(paddr) (pfn_to_page(phys_to_pfn(paddr))) | 75 | #define phys_to_page(paddr) (pfn_to_page(phys_to_pfn(paddr))) |
76 | 76 | ||
77 | #define pfn_valid(pfn) ((pfn) >= min_low_pfn && (pfn) < max_mapnr) | 77 | #define pfn_valid(pfn) (((pfn) >= min_low_pfn) && ((pfn) < max_low_pfn)) |
78 | 78 | ||
79 | #define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT) | 79 | #define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT) |
80 | 80 | ||
diff --git a/arch/score/kernel/setup.c b/arch/score/kernel/setup.c index 6a2503c75c4..6f898c05787 100644 --- a/arch/score/kernel/setup.c +++ b/arch/score/kernel/setup.c | |||
@@ -49,6 +49,7 @@ static void __init bootmem_init(void) | |||
49 | 49 | ||
50 | min_low_pfn = PFN_UP(MEMORY_START); | 50 | min_low_pfn = PFN_UP(MEMORY_START); |
51 | max_low_pfn = PFN_UP(MEMORY_START + MEMORY_SIZE); | 51 | max_low_pfn = PFN_UP(MEMORY_START + MEMORY_SIZE); |
52 | max_mapnr = max_low_pfn - min_low_pfn; | ||
52 | 53 | ||
53 | /* Initialize the boot-time allocator with low memory only. */ | 54 | /* Initialize the boot-time allocator with low memory only. */ |
54 | bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn, | 55 | bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn, |
diff --git a/arch/score/mm/cache.c b/arch/score/mm/cache.c index dbac9d9dfdd..b25e9574360 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 4e3dcd0c471..8c15b2c85d5 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,10 +100,6 @@ 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), |