diff options
author | Mikael Starvik <mikael.starvik@axis.com> | 2005-07-27 14:44:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-27 19:26:00 -0400 |
commit | 4f18cfbf0990bfc2e8e7706eeb9e5bef898ae923 (patch) | |
tree | b6bd033aac034e5d3cb83be8efb03506135866b2 /arch/cris/mm/tlb.c | |
parent | 7cf32cad153d63ac4f6f2d5dd16ddd32ad72d578 (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.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/arch/cris/mm/tlb.c b/arch/cris/mm/tlb.c index 23eca5ad7389..0df390a656cd 100644 --- a/arch/cris/mm/tlb.c +++ b/arch/cris/mm/tlb.c | |||
@@ -29,18 +29,6 @@ | |||
29 | struct mm_struct *page_id_map[NUM_PAGEID]; | 29 | struct mm_struct *page_id_map[NUM_PAGEID]; |
30 | static int map_replace_ptr = 1; /* which page_id_map entry to replace next */ | 30 | static int map_replace_ptr = 1; /* which page_id_map entry to replace next */ |
31 | 31 | ||
32 | /* | ||
33 | * Initialize the context related info for a new mm_struct | ||
34 | * instance. | ||
35 | */ | ||
36 | |||
37 | int | ||
38 | init_new_context(struct task_struct *tsk, struct mm_struct *mm) | ||
39 | { | ||
40 | mm->context = NO_CONTEXT; | ||
41 | return 0; | ||
42 | } | ||
43 | |||
44 | /* the following functions are similar to those used in the PPC port */ | 32 | /* the following functions are similar to those used in the PPC port */ |
45 | 33 | ||
46 | static inline void | 34 | static inline void |
@@ -60,12 +48,12 @@ alloc_context(struct mm_struct *mm) | |||
60 | */ | 48 | */ |
61 | flush_tlb_mm(old_mm); | 49 | flush_tlb_mm(old_mm); |
62 | 50 | ||
63 | old_mm->context = NO_CONTEXT; | 51 | old_mm->context.page_id = NO_CONTEXT; |
64 | } | 52 | } |
65 | 53 | ||
66 | /* insert it into the page_id_map */ | 54 | /* insert it into the page_id_map */ |
67 | 55 | ||
68 | mm->context = map_replace_ptr; | 56 | mm->context.page_id = map_replace_ptr; |
69 | page_id_map[map_replace_ptr] = mm; | 57 | page_id_map[map_replace_ptr] = mm; |
70 | 58 | ||
71 | map_replace_ptr++; | 59 | map_replace_ptr++; |
@@ -81,7 +69,7 @@ alloc_context(struct mm_struct *mm) | |||
81 | void | 69 | void |
82 | get_mmu_context(struct mm_struct *mm) | 70 | get_mmu_context(struct mm_struct *mm) |
83 | { | 71 | { |
84 | if(mm->context == NO_CONTEXT) | 72 | if(mm->context.page_id == NO_CONTEXT) |
85 | alloc_context(mm); | 73 | alloc_context(mm); |
86 | } | 74 | } |
87 | 75 | ||
@@ -96,11 +84,10 @@ get_mmu_context(struct mm_struct *mm) | |||
96 | void | 84 | void |
97 | destroy_context(struct mm_struct *mm) | 85 | destroy_context(struct mm_struct *mm) |
98 | { | 86 | { |
99 | if(mm->context != NO_CONTEXT) { | 87 | if(mm->context.page_id != NO_CONTEXT) { |
100 | D(printk("destroy_context %d (%p)\n", mm->context, mm)); | 88 | D(printk("destroy_context %d (%p)\n", mm->context.page_id, mm)); |
101 | flush_tlb_mm(mm); /* TODO this might be redundant ? */ | 89 | flush_tlb_mm(mm); /* TODO this might be redundant ? */ |
102 | page_id_map[mm->context] = NULL; | 90 | page_id_map[mm->context.page_id] = NULL; |
103 | /* mm->context = NO_CONTEXT; redundant.. mm will be freed */ | ||
104 | } | 91 | } |
105 | } | 92 | } |
106 | 93 | ||