aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorStuart Menefy <stuart.menefy@st.com>2006-11-21 13:53:44 +0900
committerPaul Mundt <lethal@linux-sh.org>2006-12-06 10:45:38 +0900
commit6e4662ff49c6b94e16a47bfddb920576963b5a20 (patch)
treeb53bcf136cc8df9e09f63f06321cad3622694c70 /arch
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')
-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 8b275166f40..8c8d3911838 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -155,9 +155,6 @@ extern char __init_begin, __init_end;
/*
* paging_init() sets up the page tables
- *
- * This routines also unmaps the page at virtual kernel address 0, so
- * that we can trap those pesky NULL-reference errors in the kernel.
*/
void __init paging_init(void)
{
@@ -180,14 +177,11 @@ void __init paging_init(void)
*/
{
unsigned long max_dma, low, start_pfn;
- pgd_t *pg_dir;
- int i;
-
- /* We don't need kernel mapping as hardware support that. */
- pg_dir = swapper_pg_dir;
- for (i = 0; i < PTRS_PER_PGD; i++)
- pgd_val(pg_dir[i]) = 0;
+ /* We don't need to map the kernel through the TLB, as
+ * it is permanatly mapped using P1. So clear the
+ * entire pgd. */
+ memset(swapper_pg_dir, 0, sizeof(swapper_pg_dir));
/* Turn on the MMU */
enable_mmu();
@@ -206,6 +200,10 @@ void __init paging_init(void)
}
}
+ /* Set an initial value for the MMU.TTB so we don't have to
+ * check for a null value. */
+ set_TTB(swapper_pg_dir);
+
#elif defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4)
/*
* If we don't have CONFIG_MMU set and the processor in question