Commit 8386aebb authored by Matt Fleming's avatar Matt Fleming Committed by Paul Mundt

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: default avatarMatt Fleming <matt@console-pimps.org>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent b336f124
...@@ -64,16 +64,10 @@ struct pmb_entry { ...@@ -64,16 +64,10 @@ struct pmb_entry {
}; };
/* arch/sh/mm/pmb.c */ /* arch/sh/mm/pmb.c */
int __set_pmb_entry(unsigned long vpn, unsigned long ppn,
unsigned long flags, int *entry);
int set_pmb_entry(struct pmb_entry *pmbe);
void clear_pmb_entry(struct pmb_entry *pmbe);
struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn,
unsigned long flags);
void pmb_free(struct pmb_entry *pmbe);
long pmb_remap(unsigned long virt, unsigned long phys, long pmb_remap(unsigned long virt, unsigned long phys,
unsigned long size, unsigned long flags); unsigned long size, unsigned long flags);
void pmb_unmap(unsigned long addr); void pmb_unmap(unsigned long addr);
int pmb_init(void);
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* __MMU_H */ #endif /* __MMU_H */
...@@ -453,6 +453,10 @@ void __init setup_arch(char **cmdline_p) ...@@ -453,6 +453,10 @@ void __init setup_arch(char **cmdline_p)
paging_init(); paging_init();
#ifdef CONFIG_PMB
pmb_init();
#endif
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
plat_smp_setup(); plat_smp_setup();
#endif #endif
......
...@@ -115,7 +115,7 @@ repeat: ...@@ -115,7 +115,7 @@ repeat:
return pos; return pos;
} }
struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn, static struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn,
unsigned long flags) unsigned long flags)
{ {
struct pmb_entry *pmbe; struct pmb_entry *pmbe;
...@@ -141,7 +141,7 @@ struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn, ...@@ -141,7 +141,7 @@ struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn,
return pmbe; return pmbe;
} }
void pmb_free(struct pmb_entry *pmbe) static void pmb_free(struct pmb_entry *pmbe)
{ {
spin_lock_irq(&pmb_list_lock); spin_lock_irq(&pmb_list_lock);
pmb_list_del(pmbe); pmb_list_del(pmbe);
...@@ -153,7 +153,7 @@ void pmb_free(struct pmb_entry *pmbe) ...@@ -153,7 +153,7 @@ void pmb_free(struct pmb_entry *pmbe)
/* /*
* Must be in P2 for __set_pmb_entry() * Must be in P2 for __set_pmb_entry()
*/ */
void __set_pmb_entry(unsigned long vpn, unsigned long ppn, static void __set_pmb_entry(unsigned long vpn, unsigned long ppn,
unsigned long flags, int pos) unsigned long flags, int pos)
{ {
ctrl_outl(vpn | PMB_V, mk_pmb_addr(pos)); ctrl_outl(vpn | PMB_V, mk_pmb_addr(pos));
...@@ -171,14 +171,14 @@ void __set_pmb_entry(unsigned long vpn, unsigned long ppn, ...@@ -171,14 +171,14 @@ void __set_pmb_entry(unsigned long vpn, unsigned long ppn,
ctrl_outl(ppn | flags | PMB_V, mk_pmb_data(pos)); ctrl_outl(ppn | flags | PMB_V, mk_pmb_data(pos));
} }
void __uses_jump_to_uncached set_pmb_entry(struct pmb_entry *pmbe) static void __uses_jump_to_uncached set_pmb_entry(struct pmb_entry *pmbe)
{ {
jump_to_uncached(); jump_to_uncached();
__set_pmb_entry(pmbe->vpn, pmbe->ppn, pmbe->flags, pmbe->entry); __set_pmb_entry(pmbe->vpn, pmbe->ppn, pmbe->flags, pmbe->entry);
back_to_cached(); back_to_cached();
} }
void __uses_jump_to_uncached clear_pmb_entry(struct pmb_entry *pmbe) static void __uses_jump_to_uncached clear_pmb_entry(struct pmb_entry *pmbe)
{ {
unsigned int entry = pmbe->entry; unsigned int entry = pmbe->entry;
unsigned long addr; unsigned long addr;
...@@ -327,7 +327,7 @@ static void pmb_cache_ctor(void *pmb) ...@@ -327,7 +327,7 @@ static void pmb_cache_ctor(void *pmb)
memset(pmb, 0, sizeof(struct pmb_entry)); memset(pmb, 0, sizeof(struct pmb_entry));
} }
static int __uses_jump_to_uncached pmb_init(void) int __uses_jump_to_uncached pmb_init(void)
{ {
unsigned int nr_entries = ARRAY_SIZE(pmb_init_map); unsigned int nr_entries = ARRAY_SIZE(pmb_init_map);
unsigned int entry, i; unsigned int entry, i;
...@@ -364,7 +364,6 @@ static int __uses_jump_to_uncached pmb_init(void) ...@@ -364,7 +364,6 @@ static int __uses_jump_to_uncached pmb_init(void)
return 0; return 0;
} }
arch_initcall(pmb_init);
static int pmb_seq_show(struct seq_file *file, void *iter) static int pmb_seq_show(struct seq_file *file, void *iter)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment