Lines Matching full:id
82 static unsigned int steal_context_smp(unsigned int id) in steal_context_smp() argument
92 mm = context_mm[id]; in steal_context_smp()
98 id++; in steal_context_smp()
99 if (id > last_context) in steal_context_smp()
100 id = first_context; in steal_context_smp()
103 pr_hardcont(" | steal %d from 0x%p", id, mm); in steal_context_smp()
106 mm->context.id = MMU_NO_CONTEXT; in steal_context_smp()
116 __set_bit(id, stale_map[i]); in steal_context_smp()
119 return id; in steal_context_smp()
139 static unsigned int steal_context_up(unsigned int id) in steal_context_up() argument
145 mm = context_mm[id]; in steal_context_up()
147 pr_hardcont(" | steal %d from 0x%p", id, mm); in steal_context_up()
153 mm->context.id = MMU_NO_CONTEXT; in steal_context_up()
156 __clear_bit(id, stale_map[cpu]); in steal_context_up()
158 return id; in steal_context_up()
164 unsigned int id, nrf, nact; in context_check_map() local
167 for (id = first_context; id <= last_context; id++) { in context_check_map()
168 int used = test_bit(id, context_map); in context_check_map()
171 if (used != (context_mm[id] != NULL)) in context_check_map()
173 id, used ? "used" : "free", context_mm[id]); in context_check_map()
174 if (context_mm[id] != NULL) in context_check_map()
175 nact += context_mm[id]->context.active; in context_check_map()
194 unsigned int i, id, cpu = smp_processor_id(); in switch_mmu_context() local
200 pr_hard("[%d] activating context for mm @%p, active=%d, id=%d", in switch_mmu_context()
201 cpu, next, next->context.active, next->context.id); in switch_mmu_context()
216 id = next->context.id; in switch_mmu_context()
217 if (likely(id != MMU_NO_CONTEXT)) { in switch_mmu_context()
219 if (context_mm[id] != next) in switch_mmu_context()
220 pr_err("MMU: mm 0x%p has id %d but context_mm[%d] says 0x%p\n", in switch_mmu_context()
221 next, id, id, context_mm[id]); in switch_mmu_context()
227 id = next_context; in switch_mmu_context()
228 if (id > last_context) in switch_mmu_context()
229 id = first_context; in switch_mmu_context()
236 id = steal_context_smp(id); in switch_mmu_context()
237 if (id == MMU_NO_CONTEXT) in switch_mmu_context()
242 id = steal_context_up(id); in switch_mmu_context()
248 while (__test_and_set_bit(id, map)) { in switch_mmu_context()
249 id = find_next_zero_bit(map, last_context+1, id); in switch_mmu_context()
250 if (id > last_context) in switch_mmu_context()
251 id = first_context; in switch_mmu_context()
254 next_context = id + 1; in switch_mmu_context()
255 context_mm[id] = next; in switch_mmu_context()
256 next->context.id = id; in switch_mmu_context()
257 pr_hardcont(" | new id=%d,nrf=%d", id, nr_free_contexts); in switch_mmu_context()
265 if (test_bit(id, stale_map[cpu])) { in switch_mmu_context()
267 id, cpu_first_thread_sibling(cpu), in switch_mmu_context()
275 __clear_bit(id, stale_map[i]); in switch_mmu_context()
280 pr_hardcont(" -> %d\n", id); in switch_mmu_context()
281 set_context(id, next->pgd); in switch_mmu_context()
292 mm->context.id = MMU_NO_CONTEXT; in init_new_context()
309 unsigned int id; in destroy_context() local
311 if (mm->context.id == MMU_NO_CONTEXT) in destroy_context()
317 id = mm->context.id; in destroy_context()
318 if (id != MMU_NO_CONTEXT) { in destroy_context()
319 __clear_bit(id, context_map); in destroy_context()
320 mm->context.id = MMU_NO_CONTEXT; in destroy_context()
324 context_mm[id] = NULL; in destroy_context()