diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-08-17 15:02:06 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-08-17 15:02:06 -0400 |
commit | 65cec8e3db606608fd1f8dfc4a1c7c37bfba9173 (patch) | |
tree | b1e0ecd6380afa2286fffada08cddbd388640343 /arch/arm/include/asm/pgalloc.h | |
parent | 369842658a36bcea28ecb643ba4bdb53919330dd (diff) |
ARM: implement highpte
Add the ARM implementation of highpte, which allows PTE tables to be
placed in highmem. Unfortunately, we do not offer highpte support
when support for L2 cache is enabled.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/include/asm/pgalloc.h')
-rw-r--r-- | arch/arm/include/asm/pgalloc.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/arch/arm/include/asm/pgalloc.h b/arch/arm/include/asm/pgalloc.h index 3dcd64bf1824..b12cc98bbe04 100644 --- a/arch/arm/include/asm/pgalloc.h +++ b/arch/arm/include/asm/pgalloc.h | |||
@@ -36,6 +36,8 @@ extern void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd); | |||
36 | #define pgd_alloc(mm) get_pgd_slow(mm) | 36 | #define pgd_alloc(mm) get_pgd_slow(mm) |
37 | #define pgd_free(mm, pgd) free_pgd_slow(mm, pgd) | 37 | #define pgd_free(mm, pgd) free_pgd_slow(mm, pgd) |
38 | 38 | ||
39 | #define PGALLOC_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO) | ||
40 | |||
39 | /* | 41 | /* |
40 | * Allocate one PTE table. | 42 | * Allocate one PTE table. |
41 | * | 43 | * |
@@ -57,7 +59,7 @@ pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr) | |||
57 | { | 59 | { |
58 | pte_t *pte; | 60 | pte_t *pte; |
59 | 61 | ||
60 | pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); | 62 | pte = (pte_t *)__get_free_page(PGALLOC_GFP); |
61 | if (pte) { | 63 | if (pte) { |
62 | clean_dcache_area(pte, sizeof(pte_t) * PTRS_PER_PTE); | 64 | clean_dcache_area(pte, sizeof(pte_t) * PTRS_PER_PTE); |
63 | pte += PTRS_PER_PTE; | 65 | pte += PTRS_PER_PTE; |
@@ -71,10 +73,16 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
71 | { | 73 | { |
72 | struct page *pte; | 74 | struct page *pte; |
73 | 75 | ||
74 | pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0); | 76 | #ifdef CONFIG_HIGHPTE |
77 | pte = alloc_pages(PGALLOC_GFP | __GFP_HIGHMEM, 0); | ||
78 | #else | ||
79 | pte = alloc_pages(PGALLOC_GFP, 0); | ||
80 | #endif | ||
75 | if (pte) { | 81 | if (pte) { |
76 | void *page = page_address(pte); | 82 | if (!PageHighMem(pte)) { |
77 | clean_dcache_area(page, sizeof(pte_t) * PTRS_PER_PTE); | 83 | void *page = page_address(pte); |
84 | clean_dcache_area(page, sizeof(pte_t) * PTRS_PER_PTE); | ||
85 | } | ||
78 | pgtable_page_ctor(pte); | 86 | pgtable_page_ctor(pte); |
79 | } | 87 | } |
80 | 88 | ||