summaryrefslogtreecommitdiffstats
path: root/arch/cris/mm/tlb.c
diff options
context:
space:
mode:
authorMikael Starvik <mikael.starvik@axis.com>2005-07-27 11:44:39 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-27 16:26:00 -0700
commit4f18cfbf0990bfc2e8e7706eeb9e5bef898ae923 (patch)
treeb6bd033aac034e5d3cb83be8efb03506135866b2 /arch/cris/mm/tlb.c
parent7cf32cad153d63ac4f6f2d5dd16ddd32ad72d578 (diff)
[PATCH] CRIS update: mm
Memory management patches. * SMP support. * Non-executable stack (on v32). * 4-level page tables. * Added simple Thread Local Storage support. Signed-off-by: Mikael Starvik <starvik@axis.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/cris/mm/tlb.c')
-rw-r--r--arch/cris/mm/tlb.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/arch/cris/mm/tlb.c b/arch/cris/mm/tlb.c
index 23eca5ad738..0df390a656c 100644
--- a/arch/cris/mm/tlb.c
+++ b/arch/cris/mm/tlb.c
@@ -29,18 +29,6 @@
struct mm_struct *page_id_map[NUM_PAGEID];
static int map_replace_ptr = 1; /* which page_id_map entry to replace next */
-/*
- * Initialize the context related info for a new mm_struct
- * instance.
- */
-
-int
-init_new_context(struct task_struct *tsk, struct mm_struct *mm)
-{
- mm->context = NO_CONTEXT;
- return 0;
-}
-
/* the following functions are similar to those used in the PPC port */
static inline void
@@ -60,12 +48,12 @@ alloc_context(struct mm_struct *mm)
*/
flush_tlb_mm(old_mm);
- old_mm->context = NO_CONTEXT;
+ old_mm->context.page_id = NO_CONTEXT;
}
/* insert it into the page_id_map */
- mm->context = map_replace_ptr;
+ mm->context.page_id = map_replace_ptr;
page_id_map[map_replace_ptr] = mm;
map_replace_ptr++;
@@ -81,7 +69,7 @@ alloc_context(struct mm_struct *mm)
void
get_mmu_context(struct mm_struct *mm)
{
- if(mm->context == NO_CONTEXT)
+ if(mm->context.page_id == NO_CONTEXT)
alloc_context(mm);
}
@@ -96,11 +84,10 @@ get_mmu_context(struct mm_struct *mm)
void
destroy_context(struct mm_struct *mm)
{
- if(mm->context != NO_CONTEXT) {
- D(printk("destroy_context %d (%p)\n", mm->context, mm));
+ if(mm->context.page_id != NO_CONTEXT) {
+ D(printk("destroy_context %d (%p)\n", mm->context.page_id, mm));
flush_tlb_mm(mm); /* TODO this might be redundant ? */
- page_id_map[mm->context] = NULL;
- /* mm->context = NO_CONTEXT; redundant.. mm will be freed */
+ page_id_map[mm->context.page_id] = NULL;
}
}