Commit 9a4d5b93 authored by Sam Ravnborg's avatar Sam Ravnborg Committed by David S. Miller

sparc32: move kmap_init() to highmem.c

Try to keep highmem support in a more central place.
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d8a1b2b9
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
/* declarations for highmem.c */ /* declarations for highmem.c */
extern unsigned long highstart_pfn, highend_pfn; extern unsigned long highstart_pfn, highend_pfn;
extern pte_t *kmap_pte;
extern pgprot_t kmap_prot; extern pgprot_t kmap_prot;
extern pte_t *pkmap_page_table; extern pte_t *pkmap_page_table;
......
...@@ -31,6 +31,23 @@ ...@@ -31,6 +31,23 @@
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <asm/vaddrs.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) void *kmap_atomic(struct page *page)
{ {
unsigned long vaddr; unsigned long vaddr;
......
...@@ -52,19 +52,6 @@ extern unsigned int sparc_ramdisk_size; ...@@ -52,19 +52,6 @@ extern unsigned int sparc_ramdisk_size;
unsigned long highstart_pfn, highend_pfn; 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) void show_mem(unsigned int filter)
{ {
printk("Mem-info:\n"); printk("Mem-info:\n");
......
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