Skip to content

Commit

Permalink
sparc32: move kmap_init() to highmem.c
Browse files Browse the repository at this point in the history
Try to keep highmem support in a more central place.

Signed-off-by: Sam Ravnborg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
sravnborg authored and davem330 committed Jul 26, 2012
1 parent d8a1b2b commit 9a4d5b9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
1 change: 0 additions & 1 deletion arch/sparc/include/asm/highmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
17 changes: 17 additions & 0 deletions arch/sparc/mm/highmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 0 additions & 13 deletions arch/sparc/mm/init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 9a4d5b9

Please sign in to comment.