MCPcopy Create free account
hub / github.com/F-Stack/f-stack / its_device_release

Function its_device_release

freebsd/arm64/arm64/gicv3_its.c:1195–1222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1193}
1194
1195static void
1196its_device_release(device_t dev, struct its_dev *its_dev)
1197{
1198 struct gicv3_its_softc *sc;
1199
1200 KASSERT(its_dev->lpis.lpi_busy == 0,
1201 ("its_device_release: Trying to release an inuse ITS device"));
1202
1203 /* Unmap device in ITS */
1204 its_cmd_mapd(dev, its_dev, 0);
1205
1206 sc = device_get_softc(dev);
1207
1208 /* Remove the device from the list of devices */
1209 mtx_lock_spin(&sc->sc_its_dev_lock);
1210 TAILQ_REMOVE(&sc->sc_its_dev_list, its_dev, entry);
1211 mtx_unlock_spin(&sc->sc_its_dev_lock);
1212
1213 /* Free ITT */
1214 KASSERT(its_dev->itt != 0, ("Invalid ITT in valid ITS device"));
1215 contigfree((void *)its_dev->itt, its_dev->itt_size, M_GICV3_ITS);
1216
1217 /* Free the IRQ allocation */
1218 vmem_free(sc->sc_irq_alloc, its_dev->lpis.lpi_base,
1219 its_dev->lpis.lpi_num);
1220
1221 free(its_dev, M_GICV3_ITS);
1222}
1223
1224static struct gicv3_its_irqsrc *
1225gicv3_its_alloc_irqsrc(device_t dev, struct gicv3_its_softc *sc, u_int irq)

Callers 2

gicv3_its_release_msiFunction · 0.85
gicv3_its_release_msixFunction · 0.85

Calls 5

its_cmd_mapdFunction · 0.85
device_get_softcFunction · 0.85
contigfreeFunction · 0.85
vmem_freeFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected