Commit 4386c096 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/mm: Rename map_page() to map_kernel_page() on 32-bit

These two functions implement the same semantics, so unify their naming so we
can share code that calls them. The longer name is more descriptive so use it.
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Acked-by: default avatarBalbir Singh <bsingharora@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent d2485644
...@@ -297,6 +297,8 @@ static inline void __ptep_set_access_flags(struct mm_struct *mm, ...@@ -297,6 +297,8 @@ static inline void __ptep_set_access_flags(struct mm_struct *mm,
extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep, extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep,
pmd_t **pmdp); pmd_t **pmdp);
int map_kernel_page(unsigned long va, phys_addr_t pa, int flags);
/* Generic accessors to PTE bits */ /* Generic accessors to PTE bits */
static inline int pte_write(pte_t pte) { return !!(pte_val(pte) & _PAGE_RW);} static inline int pte_write(pte_t pte) { return !!(pte_val(pte) & _PAGE_RW);}
static inline int pte_dirty(pte_t pte) { return !!(pte_val(pte) & _PAGE_DIRTY); } static inline int pte_dirty(pte_t pte) { return !!(pte_val(pte) & _PAGE_DIRTY); }
......
...@@ -340,6 +340,8 @@ static inline void __ptep_set_access_flags(struct mm_struct *mm, ...@@ -340,6 +340,8 @@ static inline void __ptep_set_access_flags(struct mm_struct *mm,
extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep, extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep,
pmd_t **pmdp); pmd_t **pmdp);
int map_kernel_page(unsigned long va, phys_addr_t pa, int flags);
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
#endif /* __ASM_POWERPC_NOHASH_32_PGTABLE_H */ #endif /* __ASM_POWERPC_NOHASH_32_PGTABLE_H */
...@@ -88,7 +88,7 @@ static void mmu_mapin_immr(void) ...@@ -88,7 +88,7 @@ static void mmu_mapin_immr(void)
int offset; int offset;
for (offset = 0; offset < IMMR_SIZE; offset += PAGE_SIZE) for (offset = 0; offset < IMMR_SIZE; offset += PAGE_SIZE)
map_page(v + offset, p + offset, f); map_kernel_page(v + offset, p + offset, f);
} }
/* Address of instructions to patch */ /* Address of instructions to patch */
......
...@@ -227,7 +227,7 @@ __dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t ...@@ -227,7 +227,7 @@ __dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t
do { do {
SetPageReserved(page); SetPageReserved(page);
map_page(vaddr, page_to_phys(page), map_kernel_page(vaddr, page_to_phys(page),
pgprot_val(pgprot_noncached(PAGE_KERNEL))); pgprot_val(pgprot_noncached(PAGE_KERNEL)));
page++; page++;
vaddr += PAGE_SIZE; vaddr += PAGE_SIZE;
......
...@@ -313,11 +313,11 @@ void __init paging_init(void) ...@@ -313,11 +313,11 @@ void __init paging_init(void)
unsigned long end = __fix_to_virt(FIX_HOLE); unsigned long end = __fix_to_virt(FIX_HOLE);
for (; v < end; v += PAGE_SIZE) for (; v < end; v += PAGE_SIZE)
map_page(v, 0, 0); /* XXX gross */ map_kernel_page(v, 0, 0); /* XXX gross */
#endif #endif
#ifdef CONFIG_HIGHMEM #ifdef CONFIG_HIGHMEM
map_page(PKMAP_BASE, 0, 0); /* XXX gross */ map_kernel_page(PKMAP_BASE, 0, 0); /* XXX gross */
pkmap_page_table = virt_to_kpte(PKMAP_BASE); pkmap_page_table = virt_to_kpte(PKMAP_BASE);
kmap_pte = virt_to_kpte(__fix_to_virt(FIX_KMAP_BEGIN)); kmap_pte = virt_to_kpte(__fix_to_virt(FIX_KMAP_BEGIN));
......
...@@ -94,7 +94,6 @@ extern void _tlbia(void); ...@@ -94,7 +94,6 @@ extern void _tlbia(void);
#ifdef CONFIG_PPC32 #ifdef CONFIG_PPC32
extern void mapin_ram(void); extern void mapin_ram(void);
extern int map_page(unsigned long va, phys_addr_t pa, int flags);
extern void setbat(int index, unsigned long virt, phys_addr_t phys, extern void setbat(int index, unsigned long virt, phys_addr_t phys,
unsigned int size, pgprot_t prot); unsigned int size, pgprot_t prot);
......
...@@ -189,7 +189,7 @@ __ioremap_caller(phys_addr_t addr, unsigned long size, unsigned long flags, ...@@ -189,7 +189,7 @@ __ioremap_caller(phys_addr_t addr, unsigned long size, unsigned long flags,
err = 0; err = 0;
for (i = 0; i < size && err == 0; i += PAGE_SIZE) for (i = 0; i < size && err == 0; i += PAGE_SIZE)
err = map_page(v+i, p+i, flags); err = map_kernel_page(v+i, p+i, flags);
if (err) { if (err) {
if (slab_is_available()) if (slab_is_available())
vunmap((void *)v); vunmap((void *)v);
...@@ -215,7 +215,7 @@ void iounmap(volatile void __iomem *addr) ...@@ -215,7 +215,7 @@ void iounmap(volatile void __iomem *addr)
} }
EXPORT_SYMBOL(iounmap); EXPORT_SYMBOL(iounmap);
int map_page(unsigned long va, phys_addr_t pa, int flags) int map_kernel_page(unsigned long va, phys_addr_t pa, int flags)
{ {
pmd_t *pd; pmd_t *pd;
pte_t *pg; pte_t *pg;
...@@ -255,7 +255,7 @@ void __init __mapin_ram_chunk(unsigned long offset, unsigned long top) ...@@ -255,7 +255,7 @@ void __init __mapin_ram_chunk(unsigned long offset, unsigned long top)
ktext = ((char *)v >= _stext && (char *)v < etext) || ktext = ((char *)v >= _stext && (char *)v < etext) ||
((char *)v >= _sinittext && (char *)v < _einittext); ((char *)v >= _sinittext && (char *)v < _einittext);
f = ktext ? pgprot_val(PAGE_KERNEL_TEXT) : pgprot_val(PAGE_KERNEL); f = ktext ? pgprot_val(PAGE_KERNEL_TEXT) : pgprot_val(PAGE_KERNEL);
map_page(v, p, f); map_kernel_page(v, p, f);
#ifdef CONFIG_PPC_STD_MMU_32 #ifdef CONFIG_PPC_STD_MMU_32
if (ktext) if (ktext)
hash_preload(&init_mm, v, 0, 0x300); hash_preload(&init_mm, v, 0, 0x300);
...@@ -387,6 +387,6 @@ void __set_fixmap (enum fixed_addresses idx, phys_addr_t phys, pgprot_t flags) ...@@ -387,6 +387,6 @@ void __set_fixmap (enum fixed_addresses idx, phys_addr_t phys, pgprot_t flags)
return; return;
} }
map_page(address, phys, pgprot_val(flags)); map_kernel_page(address, phys, pgprot_val(flags));
fixmaps++; fixmaps++;
} }
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