Lines Matching refs:id

85 static unsigned int steal_context_smp(unsigned int id)  in steal_context_smp()  argument
95 mm = context_mm[id]; in steal_context_smp()
101 id++; in steal_context_smp()
102 if (id > last_context) in steal_context_smp()
103 id = first_context; in steal_context_smp()
106 pr_hardcont(" | steal %d from 0x%p", id, mm); in steal_context_smp()
109 mm->context.id = MMU_NO_CONTEXT; in steal_context_smp()
120 __set_bit(id, stale_map[i]); in steal_context_smp()
124 return id; in steal_context_smp()
143 unsigned int id; in steal_all_contexts() local
145 for (id = first_context; id <= last_context; id++) { in steal_all_contexts()
147 mm = context_mm[id]; in steal_all_contexts()
149 pr_hardcont(" | steal %d from 0x%p", id, mm); in steal_all_contexts()
152 mm->context.id = MMU_NO_CONTEXT; in steal_all_contexts()
153 if (id != first_context) { in steal_all_contexts()
154 context_mm[id] = NULL; in steal_all_contexts()
155 __clear_bit(id, context_map); in steal_all_contexts()
160 __clear_bit(id, stale_map[cpu]); in steal_all_contexts()
176 static unsigned int steal_context_up(unsigned int id) in steal_context_up() argument
182 mm = context_mm[id]; in steal_context_up()
184 pr_hardcont(" | steal %d from 0x%p", id, mm); in steal_context_up()
190 mm->context.id = MMU_NO_CONTEXT; in steal_context_up()
193 __clear_bit(id, stale_map[cpu]); in steal_context_up()
195 return id; in steal_context_up()
201 unsigned int id, nrf, nact; in context_check_map() local
204 for (id = first_context; id <= last_context; id++) { in context_check_map()
205 int used = test_bit(id, context_map); in context_check_map()
208 if (used != (context_mm[id] != NULL)) in context_check_map()
210 id, used ? "used" : "free", context_mm[id]); in context_check_map()
211 if (context_mm[id] != NULL) in context_check_map()
212 nact += context_mm[id]->context.active; in context_check_map()
231 unsigned int i, id, cpu = smp_processor_id(); in switch_mmu_context() local
238 cpu, next, next->context.active, next->context.id); in switch_mmu_context()
253 id = next->context.id; in switch_mmu_context()
254 if (likely(id != MMU_NO_CONTEXT)) { in switch_mmu_context()
256 if (context_mm[id] != next) in switch_mmu_context()
258 next, id, id, context_mm[id]); in switch_mmu_context()
264 id = next_context; in switch_mmu_context()
265 if (id > last_context) in switch_mmu_context()
266 id = first_context; in switch_mmu_context()
273 id = steal_context_smp(id); in switch_mmu_context()
274 if (id == MMU_NO_CONTEXT) in switch_mmu_context()
280 id = steal_all_contexts(); in switch_mmu_context()
282 id = steal_context_up(id); in switch_mmu_context()
288 while (__test_and_set_bit(id, map)) { in switch_mmu_context()
289 id = find_next_zero_bit(map, last_context+1, id); in switch_mmu_context()
290 if (id > last_context) in switch_mmu_context()
291 id = first_context; in switch_mmu_context()
294 next_context = id + 1; in switch_mmu_context()
295 context_mm[id] = next; in switch_mmu_context()
296 next->context.id = id; in switch_mmu_context()
297 pr_hardcont(" | new id=%d,nrf=%d", id, nr_free_contexts); in switch_mmu_context()
305 if (test_bit(id, stale_map[cpu])) { in switch_mmu_context()
307 id, cpu_first_thread_sibling(cpu), in switch_mmu_context()
316 __clear_bit(id, stale_map[i]); in switch_mmu_context()
321 pr_hardcont(" -> %d\n", id); in switch_mmu_context()
322 set_context(id, next->pgd); in switch_mmu_context()
333 mm->context.id = MMU_NO_CONTEXT; in init_new_context()
350 unsigned int id; in destroy_context() local
352 if (mm->context.id == MMU_NO_CONTEXT) in destroy_context()
358 id = mm->context.id; in destroy_context()
359 if (id != MMU_NO_CONTEXT) { in destroy_context()
360 __clear_bit(id, context_map); in destroy_context()
361 mm->context.id = MMU_NO_CONTEXT; in destroy_context()
365 context_mm[id] = NULL; in destroy_context()