Lines Matching refs:id
71 static unsigned int steal_context_smp(unsigned int id) in steal_context_smp() argument
82 mm = context_mm[id]; in steal_context_smp()
88 id++; in steal_context_smp()
89 if (id > last_context) in steal_context_smp()
90 id = first_context; in steal_context_smp()
94 smp_processor_id(), id, mm); in steal_context_smp()
97 mm->context.id = MMU_NO_CONTEXT; in steal_context_smp()
101 __set_bit(id, stale_map[cpu]); in steal_context_smp()
102 return id; in steal_context_smp()
120 static unsigned int steal_context_up(unsigned int id) in steal_context_up() argument
126 mm = context_mm[id]; in steal_context_up()
128 pr_debug("[%d] steal context %d from mm @%p\n", cpu, id, mm); in steal_context_up()
131 mm->context.id = MMU_NO_CONTEXT; in steal_context_up()
137 __clear_bit(id, stale_map[cpu]); in steal_context_up()
139 return id; in steal_context_up()
145 unsigned int id, nrf, nact; in context_check_map() local
148 for (id = first_context; id <= last_context; id++) { in context_check_map()
149 int used = test_bit(id, context_map); in context_check_map()
152 if (used != (context_mm[id] != NULL)) in context_check_map()
154 id, used ? "used" : "free", context_mm[id]); in context_check_map()
155 if (context_mm[id] != NULL) in context_check_map()
156 nact += context_mm[id]->context.active; in context_check_map()
175 unsigned int id, cpu = smp_processor_id(); in switch_mmu_context() local
183 cpu, next, next->context.active, next->context.id); in switch_mmu_context()
200 id = next->context.id; in switch_mmu_context()
201 if (likely(id != MMU_NO_CONTEXT)) in switch_mmu_context()
205 id = next_context; in switch_mmu_context()
206 if (id > last_context) in switch_mmu_context()
207 id = first_context; in switch_mmu_context()
214 id = steal_context_smp(id); in switch_mmu_context()
218 id = steal_context_up(id); in switch_mmu_context()
224 while (__test_and_set_bit(id, map)) { in switch_mmu_context()
225 id = find_next_zero_bit(map, last_context+1, id); in switch_mmu_context()
226 if (id > last_context) in switch_mmu_context()
227 id = first_context; in switch_mmu_context()
230 next_context = id + 1; in switch_mmu_context()
231 context_mm[id] = next; in switch_mmu_context()
232 next->context.id = id; in switch_mmu_context()
236 cpu, id, nr_free_contexts); in switch_mmu_context()
245 if (test_bit(id, stale_map[cpu])) { in switch_mmu_context()
247 cpu, id, next); in switch_mmu_context()
251 __clear_bit(id, stale_map[cpu]); in switch_mmu_context()
255 set_context(id, next->pgd); in switch_mmu_context()
264 mm->context.id = MMU_NO_CONTEXT; in init_new_context()
275 unsigned int id; in destroy_context() local
277 if (mm->context.id == MMU_NO_CONTEXT) in destroy_context()
283 id = mm->context.id; in destroy_context()
284 if (id != MMU_NO_CONTEXT) { in destroy_context()
285 __clear_bit(id, context_map); in destroy_context()
286 mm->context.id = MMU_NO_CONTEXT; in destroy_context()
289 context_mm[id] = NULL; in destroy_context()