summaryrefslogtreecommitdiffstats
path: root/arch/sparc/mm/highmem.c
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2012-07-26 13:02:27 +0200
committerDavid S. Miller <davem@davemloft.net>2012-07-27 01:46:17 +0200
commit9a4d5b93cb67b63d896579f416109274235a7a65 (patch)
tree5ea825ceebd3e62396befb1a76607c4eb5719da7 /arch/sparc/mm/highmem.c
parentsparc32: move probe_memory() to srmmu.c (diff)
downloadlinux-9a4d5b93cb67b63d896579f416109274235a7a65.tar.xz
linux-9a4d5b93cb67b63d896579f416109274235a7a65.zip
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/mm/highmem.c')
-rw-r--r--arch/sparc/mm/highmem.c17
1 files changed, 17 insertions, 0 deletions
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 <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;