From 9a4d5b93cb67b63d896579f416109274235a7a65 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Thu, 26 Jul 2012 11:02:27 +0000 Subject: sparc32: move kmap_init() to highmem.c Try to keep highmem support in a more central place. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller --- arch/sparc/include/asm/highmem.h | 1 - arch/sparc/mm/highmem.c | 17 +++++++++++++++++ arch/sparc/mm/init_32.c | 13 ------------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/arch/sparc/include/asm/highmem.h b/arch/sparc/include/asm/highmem.h index 639338353909..4f9e15c757e2 100644 --- a/arch/sparc/include/asm/highmem.h +++ b/arch/sparc/include/asm/highmem.h @@ -28,7 +28,6 @@ /* declarations for highmem.c */ extern unsigned long highstart_pfn, highend_pfn; -extern pte_t *kmap_pte; extern pgprot_t kmap_prot; extern pte_t *pkmap_page_table; diff --git a/arch/sparc/mm/highmem.c b/arch/sparc/mm/highmem.c index 4d5f8b3c4090..449f864f0cef 100644 --- a/arch/sparc/mm/highmem.c +++ b/arch/sparc/mm/highmem.c @@ -31,6 +31,23 @@ #include #include +pgprot_t kmap_prot; + +static pte_t *kmap_pte; + +void __init kmap_init(void) +{ + unsigned long address; + pmd_t *dir; + + address = __fix_to_virt(FIX_KMAP_BEGIN); + dir = pmd_offset(pgd_offset_k(address), address); + + /* cache the first kmap pte */ + kmap_pte = pte_offset_kernel(dir, address); + kmap_prot = __pgprot(SRMMU_ET_PTE | SRMMU_PRIV | SRMMU_CACHE); +} + void *kmap_atomic(struct page *page) { unsigned long vaddr; diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c index 020d2afa0030..9f1162fbad37 100644 --- a/arch/sparc/mm/init_32.c +++ b/arch/sparc/mm/init_32.c @@ -52,19 +52,6 @@ extern unsigned int sparc_ramdisk_size; unsigned long highstart_pfn, highend_pfn; -pte_t *kmap_pte; -pgprot_t kmap_prot; - -#define kmap_get_fixmap_pte(vaddr) \ - pte_offset_kernel(pmd_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)) - -void __init kmap_init(void) -{ - /* cache the first kmap pte */ - kmap_pte = kmap_get_fixmap_pte(__fix_to_virt(FIX_KMAP_BEGIN)); - kmap_prot = __pgprot(SRMMU_ET_PTE | SRMMU_PRIV | SRMMU_CACHE); -} - void show_mem(unsigned int filter) { printk("Mem-info:\n"); -- cgit v1.2.3