diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2011-11-22 12:30:29 -0500 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2011-12-08 05:30:39 -0500 |
commit | da02877987e6e173ebba137d4e1e155e1f1151cd (patch) | |
tree | 8035bb1fb7def068ed2fd13d5d11ec5857c7d338 /arch/arm/include/asm/proc-fns.h | |
parent | dcfdae04bd92e8a2ea155db0e21e3bddc09e0a89 (diff) |
ARM: LPAE: Page table maintenance for the 3-level format
This patch modifies the pgd/pmd/pte manipulation functions to support
the 3-level page table format. Since there is no need for an 'ext'
argument to cpu_set_pte_ext(), this patch conditionally defines a
different prototype for this function when CONFIG_ARM_LPAE.
The patch also introduces the L_PGD_SWAPPER flag to mark pgd entries
pointing to pmd tables pre-allocated in the swapper_pg_dir and avoid
trying to free them at run-time. This flag is 0 with the classic page
table format.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm/include/asm/proc-fns.h')
-rw-r--r-- | arch/arm/include/asm/proc-fns.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/include/asm/proc-fns.h b/arch/arm/include/asm/proc-fns.h index 9e92cb205e65..f3628fb3d2b3 100644 --- a/arch/arm/include/asm/proc-fns.h +++ b/arch/arm/include/asm/proc-fns.h | |||
@@ -65,7 +65,11 @@ extern struct processor { | |||
65 | * Set a possibly extended PTE. Non-extended PTEs should | 65 | * Set a possibly extended PTE. Non-extended PTEs should |
66 | * ignore 'ext'. | 66 | * ignore 'ext'. |
67 | */ | 67 | */ |
68 | #ifdef CONFIG_ARM_LPAE | ||
69 | void (*set_pte_ext)(pte_t *ptep, pte_t pte); | ||
70 | #else | ||
68 | void (*set_pte_ext)(pte_t *ptep, pte_t pte, unsigned int ext); | 71 | void (*set_pte_ext)(pte_t *ptep, pte_t pte, unsigned int ext); |
72 | #endif | ||
69 | 73 | ||
70 | /* Suspend/resume */ | 74 | /* Suspend/resume */ |
71 | unsigned int suspend_size; | 75 | unsigned int suspend_size; |
@@ -79,7 +83,11 @@ extern void cpu_proc_fin(void); | |||
79 | extern int cpu_do_idle(void); | 83 | extern int cpu_do_idle(void); |
80 | extern void cpu_dcache_clean_area(void *, int); | 84 | extern void cpu_dcache_clean_area(void *, int); |
81 | extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm); | 85 | extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm); |
86 | #ifdef CONFIG_ARM_LPAE | ||
87 | extern void cpu_set_pte_ext(pte_t *ptep, pte_t pte); | ||
88 | #else | ||
82 | extern void cpu_set_pte_ext(pte_t *ptep, pte_t pte, unsigned int ext); | 89 | extern void cpu_set_pte_ext(pte_t *ptep, pte_t pte, unsigned int ext); |
90 | #endif | ||
83 | extern void cpu_reset(unsigned long addr) __attribute__((noreturn)); | 91 | extern void cpu_reset(unsigned long addr) __attribute__((noreturn)); |
84 | 92 | ||
85 | /* These three are private to arch/arm/kernel/suspend.c */ | 93 | /* These three are private to arch/arm/kernel/suspend.c */ |
@@ -107,6 +115,18 @@ extern void cpu_resume(void); | |||
107 | 115 | ||
108 | #define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm) | 116 | #define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm) |
109 | 117 | ||
118 | #ifdef CONFIG_ARM_LPAE | ||
119 | #define cpu_get_pgd() \ | ||
120 | ({ \ | ||
121 | unsigned long pg, pg2; \ | ||
122 | __asm__("mrrc p15, 0, %0, %1, c2" \ | ||
123 | : "=r" (pg), "=r" (pg2) \ | ||
124 | : \ | ||
125 | : "cc"); \ | ||
126 | pg &= ~(PTRS_PER_PGD*sizeof(pgd_t)-1); \ | ||
127 | (pgd_t *)phys_to_virt(pg); \ | ||
128 | }) | ||
129 | #else | ||
110 | #define cpu_get_pgd() \ | 130 | #define cpu_get_pgd() \ |
111 | ({ \ | 131 | ({ \ |
112 | unsigned long pg; \ | 132 | unsigned long pg; \ |
@@ -115,6 +135,7 @@ extern void cpu_resume(void); | |||
115 | pg &= ~0x3fff; \ | 135 | pg &= ~0x3fff; \ |
116 | (pgd_t *)phys_to_virt(pg); \ | 136 | (pgd_t *)phys_to_virt(pg); \ |
117 | }) | 137 | }) |
138 | #endif | ||
118 | 139 | ||
119 | #endif | 140 | #endif |
120 | 141 | ||