Lines Matching refs:vr
164 struct vga_resource *vr; in vga_pci_map_bios() local
243 vr = lookup_res(device_get_softc(dev), rid); in vga_pci_map_bios()
244 vga_pci_release_resource(dev, NULL, vr->vr_res); in vga_pci_map_bios()
266 vr = lookup_res(device_get_softc(dev), rid); in vga_pci_map_bios()
267 vga_pci_release_resource(dev, NULL, vr->vr_res); in vga_pci_map_bios()
274 struct vga_resource *vr; in vga_pci_unmap_bios() local
306 vr = lookup_res(device_get_softc(dev), rid); in vga_pci_unmap_bios()
307 KASSERT(vr->vr_res != NULL, ("vga_pci_unmap_bios: bios not mapped")); in vga_pci_unmap_bios()
308 KASSERT(rman_get_virtual(vr->vr_res) == bios, in vga_pci_unmap_bios()
310 vga_pci_release_resource(dev, NULL, vr->vr_res); in vga_pci_unmap_bios()
430 struct vga_resource *vr; in vga_pci_alloc_resource() local
439 vr = lookup_res(device_get_softc(dev), *rid); in vga_pci_alloc_resource()
440 if (vr == NULL) in vga_pci_alloc_resource()
442 if (vr->vr_res == NULL) in vga_pci_alloc_resource()
443 vr->vr_res = bus_alloc_resource(dev, type, rid, start, in vga_pci_alloc_resource()
445 if (vr->vr_res != NULL) in vga_pci_alloc_resource()
446 vr->vr_refs++; in vga_pci_alloc_resource()
447 return (vr->vr_res); in vga_pci_alloc_resource()
455 struct vga_resource *vr; in vga_pci_release_resource() local
465 vr = lookup_res(device_get_softc(dev), rman_get_rid(r)); in vga_pci_release_resource()
466 if (vr == NULL) in vga_pci_release_resource()
468 if (vr->vr_res == NULL) in vga_pci_release_resource()
470 KASSERT(vr->vr_res == r, ("vga_pci resource mismatch")); in vga_pci_release_resource()
471 if (vr->vr_refs > 1) { in vga_pci_release_resource()
472 vr->vr_refs--; in vga_pci_release_resource()
475 KASSERT(vr->vr_refs > 0, in vga_pci_release_resource()
479 vr->vr_res = NULL; in vga_pci_release_resource()
480 vr->vr_refs = 0; in vga_pci_release_resource()