| 245 | } |
| 246 | |
| 247 | static void |
| 248 | dmar_release_resources(device_t dev, struct dmar_unit *unit) |
| 249 | { |
| 250 | int i; |
| 251 | |
| 252 | iommu_fini_busdma(&unit->iommu); |
| 253 | dmar_fini_irt(unit); |
| 254 | dmar_fini_qi(unit); |
| 255 | dmar_fini_fault_log(unit); |
| 256 | for (i = 0; i < DMAR_INTR_TOTAL; i++) |
| 257 | dmar_release_intr(dev, unit, i); |
| 258 | if (unit->regs != NULL) { |
| 259 | bus_deactivate_resource(dev, SYS_RES_MEMORY, unit->reg_rid, |
| 260 | unit->regs); |
| 261 | bus_release_resource(dev, SYS_RES_MEMORY, unit->reg_rid, |
| 262 | unit->regs); |
| 263 | unit->regs = NULL; |
| 264 | } |
| 265 | if (unit->domids != NULL) { |
| 266 | delete_unrhdr(unit->domids); |
| 267 | unit->domids = NULL; |
| 268 | } |
| 269 | if (unit->ctx_obj != NULL) { |
| 270 | vm_object_deallocate(unit->ctx_obj); |
| 271 | unit->ctx_obj = NULL; |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | static int |
| 276 | dmar_alloc_irq(device_t dev, struct dmar_unit *unit, int idx) |
no test coverage detected