aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorStuart Menefy <stuart.menefy@st.com>2006-11-20 23:53:44 -0500
committerPaul Mundt <lethal@linux-sh.org>2006-12-05 20:45:38 -0500
commit6e4662ff49c6b94e16a47bfddb920576963b5a20 (patch)
treeb53bcf136cc8df9e09f63f06321cad3622694c70 /arch/sh
parentb5a1bcbee434b843c8850a968d9a6c7541f1be9d (diff)
sh: Use MMU.TTB register as pointer to current pgd.
Add TTB accessor functions and give it a sensible default value. We will use this later for optimizing the fault path. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/mm/init.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index 8b275166f400..8c8d39118387 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -155,9 +155,6 @@ extern char __init_begin, __init_end;
155 155
156/* 156/*
157 * paging_init() sets up the page tables 157 * paging_init() sets up the page tables
158 *
159 * This routines also unmaps the page at virtual kernel address 0, so
160 * that we can trap those pesky NULL-reference errors in the kernel.
161 */ 158 */
162void __init paging_init(void) 159void __init paging_init(void)
163{ 160{
@@ -180,14 +177,11 @@ void __init paging_init(void)
180 */ 177 */
181 { 178 {
182 unsigned long max_dma, low, start_pfn; 179 unsigned long max_dma, low, start_pfn;
183 pgd_t *pg_dir;
184 int i;
185
186 /* We don't need kernel mapping as hardware support that. */
187 pg_dir = swapper_pg_dir;
188 180
189 for (i = 0; i < PTRS_PER_PGD; i++) 181 /* We don't need to map the kernel through the TLB, as
190 pgd_val(pg_dir[i]) = 0; 182 * it is permanatly mapped using P1. So clear the
183 * entire pgd. */
184 memset(swapper_pg_dir, 0, sizeof(swapper_pg_dir));
191 185
192 /* Turn on the MMU */ 186 /* Turn on the MMU */
193 enable_mmu(); 187 enable_mmu();
@@ -206,6 +200,10 @@ void __init paging_init(void)
206 } 200 }
207 } 201 }
208 202
203 /* Set an initial value for the MMU.TTB so we don't have to
204 * check for a null value. */
205 set_TTB(swapper_pg_dir);
206
209#elif defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4) 207#elif defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4)
210 /* 208 /*
211 * If we don't have CONFIG_MMU set and the processor in question 209 * If we don't have CONFIG_MMU set and the processor in question