Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1b2e2b73 authored by Russell King's avatar Russell King Committed by Russell King
Browse files

[ARM] Cleanup arch/arm/mm a little



Move top_pmd into arch/arm/mm/mm.h - nothing outside arch/arm/mm
references it.

Move the repeated definition of TOP_PTE into mm/mm.h, as well as
a few function prototypes.

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent e478bec0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@
#include <asm/pgtable.h>
#include <asm/tlbflush.h>

#include "mm.h"

/*
 * 0xffff8000 to 0xffffffff is reserved for any ARM architecture
 * specific hacks for copying pages efficiently.
@@ -27,8 +29,6 @@
#define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \
				  L_PTE_CACHEABLE)

#define TOP_PTE(x)	pte_offset_kernel(top_pmd, x)

static DEFINE_SPINLOCK(minicache_lock);

/*
+2 −2
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
#include <asm/tlbflush.h>
#include <asm/cacheflush.h>

#include "mm.h"

#if SHMLBA > 16384
#error FIX ME
#endif
@@ -24,8 +26,6 @@
#define from_address	(0xffff8000)
#define to_address	(0xffffc000)

#define TOP_PTE(x)	pte_offset_kernel(top_pmd, x)

static DEFINE_SPINLOCK(v6_lock);

/*
+2 −2
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@
#include <asm/pgtable.h>
#include <asm/tlbflush.h>

#include "mm.h"

/*
 * 0xffff8000 to 0xffffffff is reserved for any ARM architecture
 * specific hacks for copying pages efficiently.
@@ -29,8 +31,6 @@
#define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \
				  L_PTE_CACHEABLE)

#define TOP_PTE(x)	pte_offset_kernel(top_pmd, x)

static DEFINE_SPINLOCK(minicache_lock);

/*
+2 −2
Original line number Diff line number Diff line
@@ -15,12 +15,12 @@
#include <asm/system.h>
#include <asm/tlbflush.h>

#include "mm.h"

#ifdef CONFIG_CPU_CACHE_VIPT

#define ALIAS_FLUSH_START	0xffff4000

#define TOP_PTE(x)	pte_offset_kernel(top_pmd, x)

static void flush_pfn_alias(unsigned long pfn, unsigned long vaddr)
{
	unsigned long to = ALIAS_FLUSH_START + (CACHE_COLOUR(vaddr) << PAGE_SHIFT);
+7 −13
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@
#include <asm/mach/arch.h>
#include <asm/mach/map.h>

#include "mm.h"

DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);

extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
@@ -44,6 +46,11 @@ static struct meminfo meminfo __initdata = { 0, };
 */
struct page *empty_zero_page;

/*
 * The pmd table for the upper-most set of pages.
 */
pmd_t *top_pmd;

void show_mem(void)
{
	int free = 0, total = 0, reserved = 0;
@@ -83,16 +90,6 @@ void show_mem(void)
	printk("%d pages swap cached\n", cached);
}

static inline pmd_t *pmd_off(pgd_t *pgd, unsigned long virt)
{
	return pmd_offset(pgd, virt);
}

static inline pmd_t *pmd_off_k(unsigned long virt)
{
	return pmd_off(pgd_offset_k(virt), virt);
}

#define for_each_nodebank(iter,mi,no)			\
	for (iter = 0; iter < mi->nr_banks; iter++)	\
		if (mi->bank[iter].node == no)
@@ -229,9 +226,6 @@ static __init void reserve_node_zero(pg_data_t *pgdat)
		reserve_bootmem_node(pgdat, PHYS_OFFSET, res_size);
}

void __init build_mem_type_table(void);
void __init create_mapping(struct map_desc *md);

static unsigned long __init
bootmem_init_node(int node, int initrd_node, struct meminfo *mi)
{
Loading