sparc32: move kmap_init() to highmem.c
authorSam Ravnborg <sam@ravnborg.org>
Thu, 26 Jul 2012 11:02:27 +0000 (11:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 26 Jul 2012 23:46:17 +0000 (16:46 -0700)
Try to keep highmem support in a more central place.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/include/asm/highmem.h
arch/sparc/mm/highmem.c
arch/sparc/mm/init_32.c

index 639338353909f29ba994340a8ad6a10ef4543495..4f9e15c757e2f40ac9e4706afa6f31c03131b434 100644 (file)
@@ -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;
 
index 4d5f8b3c4090530b74ef42cab91e3020d7358a2c..449f864f0cefdb8918bf0002d40dc87ba2cb8db3 100644 (file)
 #include <asm/pgalloc.h>
 #include <asm/vaddrs.h>
 
+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;
index 020d2afa00300d5f7305a47f49895dd2c1f1856a..9f1162fbad37b025671c7325fb320438f1d5bda3 100644 (file)
@@ -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");