diff options
author | Matt Fleming <matt@console-pimps.org> | 2009-10-06 17:22:28 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-10-10 08:51:37 -0400 |
commit | 8386aebb9e15a94137693ea4f4df84207f71cc75 (patch) | |
tree | d290d8455eac2085f79d5c03b5b5e1f6ba222be5 | |
parent | b336f124b1cca55c28b2c5df0e02aa5ace5be7d4 (diff) |
sh: Make most PMB functions static
There's no need to export the internal PMB functions for allocating,
freeing and modifying PMB entries, etc. This way we can restrict the
interface for PMB.
Also remove the static from pmb_init() so that we have more freedom in
setting up the initial PMB entries and turning on MMU 32bit mode.
Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/include/asm/mmu.h | 8 | ||||
-rw-r--r-- | arch/sh/kernel/setup.c | 4 | ||||
-rw-r--r-- | arch/sh/mm/pmb.c | 17 |
3 files changed, 13 insertions, 16 deletions
diff --git a/arch/sh/include/asm/mmu.h b/arch/sh/include/asm/mmu.h index 5025e12b7864..9c84b4546c8d 100644 --- a/arch/sh/include/asm/mmu.h +++ b/arch/sh/include/asm/mmu.h | |||
@@ -64,16 +64,10 @@ struct pmb_entry { | |||
64 | }; | 64 | }; |
65 | 65 | ||
66 | /* arch/sh/mm/pmb.c */ | 66 | /* arch/sh/mm/pmb.c */ |
67 | int __set_pmb_entry(unsigned long vpn, unsigned long ppn, | ||
68 | unsigned long flags, int *entry); | ||
69 | int set_pmb_entry(struct pmb_entry *pmbe); | ||
70 | void clear_pmb_entry(struct pmb_entry *pmbe); | ||
71 | struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn, | ||
72 | unsigned long flags); | ||
73 | void pmb_free(struct pmb_entry *pmbe); | ||
74 | long pmb_remap(unsigned long virt, unsigned long phys, | 67 | long pmb_remap(unsigned long virt, unsigned long phys, |
75 | unsigned long size, unsigned long flags); | 68 | unsigned long size, unsigned long flags); |
76 | void pmb_unmap(unsigned long addr); | 69 | void pmb_unmap(unsigned long addr); |
70 | int pmb_init(void); | ||
77 | #endif /* __ASSEMBLY__ */ | 71 | #endif /* __ASSEMBLY__ */ |
78 | 72 | ||
79 | #endif /* __MMU_H */ | 73 | #endif /* __MMU_H */ |
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index f9d44f8e0df6..8fdd03a67680 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c | |||
@@ -453,6 +453,10 @@ void __init setup_arch(char **cmdline_p) | |||
453 | 453 | ||
454 | paging_init(); | 454 | paging_init(); |
455 | 455 | ||
456 | #ifdef CONFIG_PMB | ||
457 | pmb_init(); | ||
458 | #endif | ||
459 | |||
456 | #ifdef CONFIG_SMP | 460 | #ifdef CONFIG_SMP |
457 | plat_smp_setup(); | 461 | plat_smp_setup(); |
458 | #endif | 462 | #endif |
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c index b8a33949296a..f01c8191144c 100644 --- a/arch/sh/mm/pmb.c +++ b/arch/sh/mm/pmb.c | |||
@@ -115,8 +115,8 @@ repeat: | |||
115 | return pos; | 115 | return pos; |
116 | } | 116 | } |
117 | 117 | ||
118 | struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn, | 118 | static struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn, |
119 | unsigned long flags) | 119 | unsigned long flags) |
120 | { | 120 | { |
121 | struct pmb_entry *pmbe; | 121 | struct pmb_entry *pmbe; |
122 | int pos; | 122 | int pos; |
@@ -141,7 +141,7 @@ struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn, | |||
141 | return pmbe; | 141 | return pmbe; |
142 | } | 142 | } |
143 | 143 | ||
144 | void pmb_free(struct pmb_entry *pmbe) | 144 | static void pmb_free(struct pmb_entry *pmbe) |
145 | { | 145 | { |
146 | spin_lock_irq(&pmb_list_lock); | 146 | spin_lock_irq(&pmb_list_lock); |
147 | pmb_list_del(pmbe); | 147 | pmb_list_del(pmbe); |
@@ -153,8 +153,8 @@ void pmb_free(struct pmb_entry *pmbe) | |||
153 | /* | 153 | /* |
154 | * Must be in P2 for __set_pmb_entry() | 154 | * Must be in P2 for __set_pmb_entry() |
155 | */ | 155 | */ |
156 | void __set_pmb_entry(unsigned long vpn, unsigned long ppn, | 156 | static void __set_pmb_entry(unsigned long vpn, unsigned long ppn, |
157 | unsigned long flags, int pos) | 157 | unsigned long flags, int pos) |
158 | { | 158 | { |
159 | ctrl_outl(vpn | PMB_V, mk_pmb_addr(pos)); | 159 | ctrl_outl(vpn | PMB_V, mk_pmb_addr(pos)); |
160 | 160 | ||
@@ -171,14 +171,14 @@ void __set_pmb_entry(unsigned long vpn, unsigned long ppn, | |||
171 | ctrl_outl(ppn | flags | PMB_V, mk_pmb_data(pos)); | 171 | ctrl_outl(ppn | flags | PMB_V, mk_pmb_data(pos)); |
172 | } | 172 | } |
173 | 173 | ||
174 | void __uses_jump_to_uncached set_pmb_entry(struct pmb_entry *pmbe) | 174 | static void __uses_jump_to_uncached set_pmb_entry(struct pmb_entry *pmbe) |
175 | { | 175 | { |
176 | jump_to_uncached(); | 176 | jump_to_uncached(); |
177 | __set_pmb_entry(pmbe->vpn, pmbe->ppn, pmbe->flags, pmbe->entry); | 177 | __set_pmb_entry(pmbe->vpn, pmbe->ppn, pmbe->flags, pmbe->entry); |
178 | back_to_cached(); | 178 | back_to_cached(); |
179 | } | 179 | } |
180 | 180 | ||
181 | void __uses_jump_to_uncached clear_pmb_entry(struct pmb_entry *pmbe) | 181 | static void __uses_jump_to_uncached clear_pmb_entry(struct pmb_entry *pmbe) |
182 | { | 182 | { |
183 | unsigned int entry = pmbe->entry; | 183 | unsigned int entry = pmbe->entry; |
184 | unsigned long addr; | 184 | unsigned long addr; |
@@ -327,7 +327,7 @@ static void pmb_cache_ctor(void *pmb) | |||
327 | memset(pmb, 0, sizeof(struct pmb_entry)); | 327 | memset(pmb, 0, sizeof(struct pmb_entry)); |
328 | } | 328 | } |
329 | 329 | ||
330 | static int __uses_jump_to_uncached pmb_init(void) | 330 | int __uses_jump_to_uncached pmb_init(void) |
331 | { | 331 | { |
332 | unsigned int nr_entries = ARRAY_SIZE(pmb_init_map); | 332 | unsigned int nr_entries = ARRAY_SIZE(pmb_init_map); |
333 | unsigned int entry, i; | 333 | unsigned int entry, i; |
@@ -364,7 +364,6 @@ static int __uses_jump_to_uncached pmb_init(void) | |||
364 | 364 | ||
365 | return 0; | 365 | return 0; |
366 | } | 366 | } |
367 | arch_initcall(pmb_init); | ||
368 | 367 | ||
369 | static int pmb_seq_show(struct seq_file *file, void *iter) | 368 | static int pmb_seq_show(struct seq_file *file, void *iter) |
370 | { | 369 | { |