aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-ppc/mmu_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-ppc/mmu_context.h')
-rw-r--r--include/asm-ppc/mmu_context.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/include/asm-ppc/mmu_context.h b/include/asm-ppc/mmu_context.h
index 4f152cca13c1..4454ecf1aed5 100644
--- a/include/asm-ppc/mmu_context.h
+++ b/include/asm-ppc/mmu_context.h
@@ -71,7 +71,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
71#else 71#else
72 72
73/* PPC 6xx, 7xx CPUs */ 73/* PPC 6xx, 7xx CPUs */
74#define NO_CONTEXT ((mm_context_t) -1) 74#define NO_CONTEXT ((unsigned long) -1)
75#define LAST_CONTEXT 32767 75#define LAST_CONTEXT 32767
76#define FIRST_CONTEXT 1 76#define FIRST_CONTEXT 1
77#endif 77#endif
@@ -86,7 +86,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
86 * can be used for debugging on all processors (if you happen to have 86 * can be used for debugging on all processors (if you happen to have
87 * an Abatron). 87 * an Abatron).
88 */ 88 */
89extern void set_context(mm_context_t context, pgd_t *pgd); 89extern void set_context(unsigned long contextid, pgd_t *pgd);
90 90
91/* 91/*
92 * Bitmap of contexts in use. 92 * Bitmap of contexts in use.
@@ -99,7 +99,7 @@ extern unsigned long context_map[];
99 * Its use is an optimization only, we can't rely on this context 99 * Its use is an optimization only, we can't rely on this context
100 * number to be free, but it usually will be. 100 * number to be free, but it usually will be.
101 */ 101 */
102extern mm_context_t next_mmu_context; 102extern unsigned long next_mmu_context;
103 103
104/* 104/*
105 * If we don't have sufficient contexts to give one to every task 105 * If we don't have sufficient contexts to give one to every task
@@ -118,9 +118,9 @@ extern void steal_context(void);
118 */ 118 */
119static inline void get_mmu_context(struct mm_struct *mm) 119static inline void get_mmu_context(struct mm_struct *mm)
120{ 120{
121 mm_context_t ctx; 121 unsigned long ctx;
122 122
123 if (mm->context != NO_CONTEXT) 123 if (mm->context.id != NO_CONTEXT)
124 return; 124 return;
125#ifdef FEW_CONTEXTS 125#ifdef FEW_CONTEXTS
126 while (atomic_dec_if_positive(&nr_free_contexts) < 0) 126 while (atomic_dec_if_positive(&nr_free_contexts) < 0)
@@ -133,7 +133,7 @@ static inline void get_mmu_context(struct mm_struct *mm)
133 ctx = 0; 133 ctx = 0;
134 } 134 }
135 next_mmu_context = (ctx + 1) & LAST_CONTEXT; 135 next_mmu_context = (ctx + 1) & LAST_CONTEXT;
136 mm->context = ctx; 136 mm->context.id = ctx;
137#ifdef FEW_CONTEXTS 137#ifdef FEW_CONTEXTS
138 context_mm[ctx] = mm; 138 context_mm[ctx] = mm;
139#endif 139#endif
@@ -142,7 +142,12 @@ static inline void get_mmu_context(struct mm_struct *mm)
142/* 142/*
143 * Set up the context for a new address space. 143 * Set up the context for a new address space.
144 */ 144 */
145#define init_new_context(tsk,mm) (((mm)->context = NO_CONTEXT), 0) 145static inline int init_new_context(struct task_struct *t, struct mm_struct *mm)
146{
147 mm->context.id = NO_CONTEXT;
148 mm->context.vdso_base = 0;
149 return 0;
150}
146 151
147/* 152/*
148 * We're finished using the context for an address space. 153 * We're finished using the context for an address space.
@@ -150,9 +155,9 @@ static inline void get_mmu_context(struct mm_struct *mm)
150static inline void destroy_context(struct mm_struct *mm) 155static inline void destroy_context(struct mm_struct *mm)
151{ 156{
152 preempt_disable(); 157 preempt_disable();
153 if (mm->context != NO_CONTEXT) { 158 if (mm->context.id != NO_CONTEXT) {
154 clear_bit(mm->context, context_map); 159 clear_bit(mm->context.id, context_map);
155 mm->context = NO_CONTEXT; 160 mm->context.id = NO_CONTEXT;
156#ifdef FEW_CONTEXTS 161#ifdef FEW_CONTEXTS
157 atomic_inc(&nr_free_contexts); 162 atomic_inc(&nr_free_contexts);
158#endif 163#endif
@@ -180,7 +185,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
180 185
181 /* Setup new userspace context */ 186 /* Setup new userspace context */
182 get_mmu_context(next); 187 get_mmu_context(next);
183 set_context(next->context, next->pgd); 188 set_context(next->context.id, next->pgd);
184} 189}
185 190
186#define deactivate_mm(tsk,mm) do { } while (0) 191#define deactivate_mm(tsk,mm) do { } while (0)