Lines Matching refs:ip
175 struct fc_resource *ip, *np; in gp2_fc_ops_free_handle() local
189 for (ip = rp->head; ip != NULL; ip = np) { in gp2_fc_ops_free_handle()
190 np = ip->next; in gp2_fc_ops_free_handle()
191 switch (ip->type) { in gp2_fc_ops_free_handle()
194 " map handle - %p\n", ip->fc_map_handle); in gp2_fc_ops_free_handle()
203 ip->fc_contig_virt, ip->fc_contig_len); in gp2_fc_ops_free_handle()
206 (uint64_t)ip->fc_contig_virt, in gp2_fc_ops_free_handle()
207 ip->fc_contig_len, "gptwo-contigousmem", in gp2_fc_ops_free_handle()
213 "unknown resource type %d\n", ip->type); in gp2_fc_ops_free_handle()
216 fc_rem_resource(rp, ip); in gp2_fc_ops_free_handle()
217 kmem_free(ip, sizeof (struct fc_resource)); in gp2_fc_ops_free_handle()
259 struct fc_resource *ip; in gfc_map_in() local
300 ip = kmem_zalloc(sizeof (struct fc_resource), KM_SLEEP); in gfc_map_in()
301 ip->type = RT_MAP; in gfc_map_in()
302 ip->fc_map_virt = virt; in gfc_map_in()
303 ip->fc_map_len = len; in gfc_map_in()
304 ip->fc_map_handle = h; in gfc_map_in()
305 fc_add_resource(rp, ip); in gfc_map_in()
318 struct fc_resource *ip; in gfc_map_out() local
334 for (ip = rp->head; ip != NULL; ip = ip->next) { in gfc_map_out()
335 if (ip->type != RT_MAP) in gfc_map_out()
337 if (ip->fc_map_virt != virt) in gfc_map_out()
339 if (ip->fc_map_len == len) in gfc_map_out()
344 if (ip == NULL) in gfc_map_out()
348 gp2_unmap_phys(&ip->fc_map_handle); in gfc_map_out()
353 fc_rem_resource(rp, ip); in gfc_map_out()
354 kmem_free(ip, sizeof (struct fc_resource)); in gfc_map_out()
371 struct fc_resource *ip; in gfc_register_fetch() local
402 for (ip = rp->head; ip != NULL; ip = ip->next) { in gfc_register_fetch()
403 if (ip->type == RT_MAP) { in gfc_register_fetch()
404 if ((virt >= (caddr_t)ip->fc_map_virt) && ((virt + len) <= in gfc_register_fetch()
405 ((caddr_t)ip->fc_map_virt + ip->fc_map_len))) in gfc_register_fetch()
407 } else if (ip->type == RT_CONTIGIOUS) { in gfc_register_fetch()
408 if ((virt >= (caddr_t)ip->fc_contig_virt) && ((virt + len) in gfc_register_fetch()
409 <= ((caddr_t)ip->fc_contig_virt + ip->fc_contig_len))) in gfc_register_fetch()
415 if (ip == NULL) { in gfc_register_fetch()
422 if (ip->type == RT_MAP) in gfc_register_fetch()
429 if (ip->type == RT_MAP) in gfc_register_fetch()
436 if (ip->type == RT_MAP) in gfc_register_fetch()
443 if (ip->type == RT_MAP) in gfc_register_fetch()
477 struct fc_resource *ip; in gfc_register_store() local
506 for (ip = rp->head; ip != NULL; ip = ip->next) { in gfc_register_store()
507 if (ip->type == RT_MAP) { in gfc_register_store()
508 if ((virt >= (caddr_t)ip->fc_map_virt) && ((virt + len) <= in gfc_register_store()
509 ((caddr_t)ip->fc_map_virt + ip->fc_map_len))) in gfc_register_store()
511 } else if (ip->type == RT_CONTIGIOUS) { in gfc_register_store()
512 if ((virt >= (caddr_t)ip->fc_contig_virt) && ((virt + len) in gfc_register_store()
513 <= ((caddr_t)ip->fc_contig_virt + ip->fc_contig_len))) in gfc_register_store()
519 if (ip == NULL) in gfc_register_store()
525 if (ip->type == RT_MAP) in gfc_register_store()
527 else if (ip->type == RT_CONTIGIOUS) in gfc_register_store()
531 if (ip->type == RT_MAP) in gfc_register_store()
533 else if (ip->type == RT_CONTIGIOUS) in gfc_register_store()
537 if (ip->type == RT_MAP) in gfc_register_store()
539 else if (ip->type == RT_CONTIGIOUS) in gfc_register_store()
543 if (ip->type == RT_MAP) in gfc_register_store()
545 else if (ip->type == RT_CONTIGIOUS) in gfc_register_store()
662 struct fc_resource *ip; in gfc_claim_memory() local
712 ip = kmem_zalloc(sizeof (struct fc_resource), KM_SLEEP); in gfc_claim_memory()
713 ip->type = RT_CONTIGIOUS; in gfc_claim_memory()
714 ip->fc_contig_virt = (void *)answer; in gfc_claim_memory()
715 ip->fc_contig_len = size; in gfc_claim_memory()
716 fc_add_resource(rp, ip); in gfc_claim_memory()
730 struct fc_resource *ip; in gfc_release_memory() local
747 for (ip = rp->head; ip != NULL; ip = ip->next) { in gfc_release_memory()
748 if (ip->type != RT_CONTIGIOUS) in gfc_release_memory()
750 if (ip->fc_contig_virt != (void *)(uintptr_t)vaddr) in gfc_release_memory()
752 if (ip->fc_contig_len == size) in gfc_release_memory()
757 if (ip == NULL) in gfc_release_memory()
767 fc_rem_resource(rp, ip); in gfc_release_memory()
768 kmem_free(ip, sizeof (struct fc_resource)); in gfc_release_memory()
785 struct fc_resource *ip; in gfc_vtop() local
799 for (ip = rp->head; ip != NULL; ip = ip->next) { in gfc_vtop()
800 if (ip->type != RT_CONTIGIOUS) in gfc_vtop()
802 if (ip->fc_contig_virt == (void *)(uintptr_t)vaddr) in gfc_vtop()
807 if (ip == NULL) in gfc_vtop()