diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2012-07-26 07:02:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-26 19:46:17 -0400 |
commit | 9a4d5b93cb67b63d896579f416109274235a7a65 (patch) | |
tree | 5ea825ceebd3e62396befb1a76607c4eb5719da7 /arch/sparc | |
parent | d8a1b2b94ca5fe219b3c77389e2424145c24c668 (diff) |
sparc32: move kmap_init() to highmem.c
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>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/include/asm/highmem.h | 1 | ||||
-rw-r--r-- | arch/sparc/mm/highmem.c | 17 | ||||
-rw-r--r-- | 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 @@ | |||
28 | /* declarations for highmem.c */ | 28 | /* declarations for highmem.c */ |
29 | extern unsigned long highstart_pfn, highend_pfn; | 29 | extern unsigned long highstart_pfn, highend_pfn; |
30 | 30 | ||
31 | extern pte_t *kmap_pte; | ||
32 | extern pgprot_t kmap_prot; | 31 | extern pgprot_t kmap_prot; |
33 | extern pte_t *pkmap_page_table; | 32 | extern pte_t *pkmap_page_table; |
34 | 33 | ||
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 @@ | |||
31 | #include <asm/pgalloc.h> | 31 | #include <asm/pgalloc.h> |
32 | #include <asm/vaddrs.h> | 32 | #include <asm/vaddrs.h> |
33 | 33 | ||
34 | pgprot_t kmap_prot; | ||
35 | |||
36 | static pte_t *kmap_pte; | ||
37 | |||
38 | void __init kmap_init(void) | ||
39 | { | ||
40 | unsigned long address; | ||
41 | pmd_t *dir; | ||
42 | |||
43 | address = __fix_to_virt(FIX_KMAP_BEGIN); | ||
44 | dir = pmd_offset(pgd_offset_k(address), address); | ||
45 | |||
46 | /* cache the first kmap pte */ | ||
47 | kmap_pte = pte_offset_kernel(dir, address); | ||
48 | kmap_prot = __pgprot(SRMMU_ET_PTE | SRMMU_PRIV | SRMMU_CACHE); | ||
49 | } | ||
50 | |||
34 | void *kmap_atomic(struct page *page) | 51 | void *kmap_atomic(struct page *page) |
35 | { | 52 | { |
36 | unsigned long vaddr; | 53 | 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; | |||
52 | 52 | ||
53 | unsigned long highstart_pfn, highend_pfn; | 53 | unsigned long highstart_pfn, highend_pfn; |
54 | 54 | ||
55 | pte_t *kmap_pte; | ||
56 | pgprot_t kmap_prot; | ||
57 | |||
58 | #define kmap_get_fixmap_pte(vaddr) \ | ||
59 | pte_offset_kernel(pmd_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)) | ||
60 | |||
61 | void __init kmap_init(void) | ||
62 | { | ||
63 | /* cache the first kmap pte */ | ||
64 | kmap_pte = kmap_get_fixmap_pte(__fix_to_virt(FIX_KMAP_BEGIN)); | ||
65 | kmap_prot = __pgprot(SRMMU_ET_PTE | SRMMU_PRIV | SRMMU_CACHE); | ||
66 | } | ||
67 | |||
68 | void show_mem(unsigned int filter) | 55 | void show_mem(unsigned int filter) |
69 | { | 56 | { |
70 | printk("Mem-info:\n"); | 57 | printk("Mem-info:\n"); |