• Home
  • Raw
  • Download

Lines Matching refs:id

113 static unsigned int steal_context_smp(unsigned int id)  in steal_context_smp()  argument
123 mm = context_mm[id]; in steal_context_smp()
129 id++; in steal_context_smp()
130 if (id > LAST_CONTEXT) in steal_context_smp()
131 id = FIRST_CONTEXT; in steal_context_smp()
134 pr_hardcont(" | steal %d from 0x%p", id, mm); in steal_context_smp()
137 mm->context.id = MMU_NO_CONTEXT; in steal_context_smp()
148 __set_bit(id, stale_map[i]); in steal_context_smp()
152 return id; in steal_context_smp()
173 unsigned int id; in steal_all_contexts() local
175 for (id = FIRST_CONTEXT; id <= LAST_CONTEXT; id++) { in steal_all_contexts()
177 mm = context_mm[id]; in steal_all_contexts()
179 pr_hardcont(" | steal %d from 0x%p", id, mm); in steal_all_contexts()
182 mm->context.id = MMU_NO_CONTEXT; in steal_all_contexts()
183 if (id != FIRST_CONTEXT) { in steal_all_contexts()
184 context_mm[id] = NULL; in steal_all_contexts()
185 __clear_bit(id, context_map); in steal_all_contexts()
191 __clear_bit(id, stale_map[cpu]); in steal_all_contexts()
208 static unsigned int steal_context_up(unsigned int id) in steal_context_up() argument
216 mm = context_mm[id]; in steal_context_up()
218 pr_hardcont(" | steal %d from 0x%p", id, mm); in steal_context_up()
224 mm->context.id = MMU_NO_CONTEXT; in steal_context_up()
228 __clear_bit(id, stale_map[cpu]); in steal_context_up()
231 return id; in steal_context_up()
237 unsigned int id, nrf, nact; in context_check_map() local
240 for (id = FIRST_CONTEXT; id <= LAST_CONTEXT; id++) { in context_check_map()
241 int used = test_bit(id, context_map); in context_check_map()
244 if (used != (context_mm[id] != NULL)) in context_check_map()
246 id, used ? "used" : "free", context_mm[id]); in context_check_map()
247 if (context_mm[id] != NULL) in context_check_map()
248 nact += context_mm[id]->context.active; in context_check_map()
268 unsigned int id; in switch_mmu_context() local
278 cpu, next, next->context.active, next->context.id); in switch_mmu_context()
293 id = next->context.id; in switch_mmu_context()
294 if (likely(id != MMU_NO_CONTEXT)) { in switch_mmu_context()
296 if (context_mm[id] != next) in switch_mmu_context()
298 next, id, id, context_mm[id]); in switch_mmu_context()
304 id = next_context; in switch_mmu_context()
305 if (id > LAST_CONTEXT) in switch_mmu_context()
306 id = FIRST_CONTEXT; in switch_mmu_context()
313 id = steal_context_smp(id); in switch_mmu_context()
314 if (id == MMU_NO_CONTEXT) in switch_mmu_context()
320 id = steal_all_contexts(); in switch_mmu_context()
322 id = steal_context_up(id); in switch_mmu_context()
328 while (__test_and_set_bit(id, map)) { in switch_mmu_context()
329 id = find_next_zero_bit(map, LAST_CONTEXT+1, id); in switch_mmu_context()
330 if (id > LAST_CONTEXT) in switch_mmu_context()
331 id = FIRST_CONTEXT; in switch_mmu_context()
334 next_context = id + 1; in switch_mmu_context()
335 context_mm[id] = next; in switch_mmu_context()
336 next->context.id = id; in switch_mmu_context()
337 pr_hardcont(" | new id=%d,nrf=%d", id, nr_free_contexts); in switch_mmu_context()
346 if (test_bit(id, stale_map[cpu])) { in switch_mmu_context()
348 id, cpu_first_thread_sibling(cpu), in switch_mmu_context()
357 __clear_bit(id, stale_map[i]); in switch_mmu_context()
363 pr_hardcont(" -> %d\n", id); in switch_mmu_context()
364 set_context(id, next->pgd); in switch_mmu_context()
383 if (mm->context.id == 0) in init_new_context()
386 mm->context.id = MMU_NO_CONTEXT; in init_new_context()
397 unsigned int id; in destroy_context() local
399 if (mm->context.id == MMU_NO_CONTEXT) in destroy_context()
405 id = mm->context.id; in destroy_context()
406 if (id != MMU_NO_CONTEXT) { in destroy_context()
407 __clear_bit(id, context_map); in destroy_context()
408 mm->context.id = MMU_NO_CONTEXT; in destroy_context()
412 context_mm[id] = NULL; in destroy_context()