Lines Matching defs:ccpu
131 int ccpu = cpu_number();
132 volatile uint8_t *cptr = cpu_datap(ccpu)->cpu_pmap_asid_coherentp;
133 assert(cptr == &(current_thread()->map->pmap->pmap_asid_coherency_vector[ccpu]));
139 void pmap_asid_invalidate_cpu(pmap_t tpmap, int ccpu) {
140 tpmap->pmap_asid_coherency_vector[ccpu] = 0xFF;
143 void pmap_asid_validate_cpu(pmap_t tpmap, int ccpu) {
144 tpmap->pmap_asid_coherency_vector[ccpu] = 0;
149 int ccpu = cpu_number();
162 cpu_datap(ccpu)->cpu_pmap_asid_coherentp =
163 cpu_datap(ccpu)->cpu_pmap_asid_coherentp_kernel =
164 &(kernel_pmap->pmap_asid_coherency_vector[ccpu]);
165 cpu_datap(ccpu)->cpu_asid_refcounts[0] = 1;
188 asid_t pmap_asid_allocate_asid(int ccpu) {
192 asid_ref_t *cpu_asid_refcounts = &cpu_datap(ccpu)->cpu_asid_refcounts[0];
195 if ((i = cpu_datap(ccpu)->cpu_asid_free_hint) != 0) {
198 cpu_datap(ccpu)->cpu_asid_free_hint = 0;
236 void pmap_asid_deallocate_asid(int ccpu, pmap_t tpmap) {
241 asid = tpmap->pmap_asid_cpus[ccpu];
246 lp = cpu_datap(ccpu)->cpu_asid_last_pmap_dispatched[asid];
248 assert(cpu_datap(ccpu)->cpu_asid_refcounts[asid] >= 1);
251 (void)__sync_bool_compare_and_swap(&cpu_datap(ccpu)->cpu_asid_last_pmap_dispatched[asid], tpmap, PMAP_INVALID);
253 if ((prior_count = __sync_fetch_and_sub(&cpu_datap(ccpu)->cpu_asid_refcounts[asid], 1)) == 1) {
254 cpu_datap(ccpu)->cpu_asid_free_hint = asid;
267 asid_t asid_for_pmap_cpu_tuple(pmap_t pmap, int ccpu) {
268 return pmap->pmap_asid_cpus[ccpu];
271 void pmap_asid_activate(pmap_t tpmap, int ccpu) {
272 asid_t new_asid = tpmap->pmap_asid_cpus[ccpu];
277 new_asid = tpmap->pmap_asid_cpus[ccpu] = pmap_asid_allocate_asid(ccpu);
280 cpu_datap(ccpu)->cpu_active_asid = new_asid;
282 pending_flush = (tpmap->pmap_asid_coherency_vector[ccpu] != 0);
284 last_pmap = cpu_datap(ccpu)->cpu_asid_last_pmap_dispatched[new_asid];
288 pmap_asid_validate_cpu(tpmap, ccpu);
291 cpu_datap(ccpu)->cpu_asid_last_pmap_dispatched[new_asid] = tpmap;
298 pending_flush = (tpmap->pmap_asid_coherency_vector[ccpu] != 0);
300 pmap_asid_validate_cpu(tpmap, ccpu);
305 cpu_datap(ccpu)->cpu_pmap_asid_coherentp = &(tpmap->pmap_asid_coherency_vector[ccpu]);