Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/gicv3_its.c
Show First 20 Lines • Show All 1,072 Lines • ▼ Show 20 Lines | gicv3_its_alloc_msi(device_t dev, device_t child, int count, int maxcount, | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
gicv3_its_release_msi(device_t dev, device_t child, int count, | gicv3_its_release_msi(device_t dev, device_t child, int count, | ||||
struct intr_irqsrc **isrc) | struct intr_irqsrc **isrc) | ||||
{ | { | ||||
struct gicv3_its_softc *sc; | |||||
struct gicv3_its_irqsrc *girq; | struct gicv3_its_irqsrc *girq; | ||||
struct its_dev *its_dev; | struct its_dev *its_dev; | ||||
int i; | int i; | ||||
sc = device_get_softc(dev); | |||||
its_dev = its_device_find(dev, child); | its_dev = its_device_find(dev, child); | ||||
KASSERT(its_dev != NULL, | KASSERT(its_dev != NULL, | ||||
("gicv3_its_release_msi: Releasing a MSI interrupt with " | ("gicv3_its_release_msi: Releasing a MSI interrupt with " | ||||
"no ITS device")); | "no ITS device")); | ||||
KASSERT(its_dev->lpis.lpi_busy >= count, | KASSERT(its_dev->lpis.lpi_busy >= count, | ||||
("gicv3_its_release_msi: Releasing more interrupts than " | ("gicv3_its_release_msi: Releasing more interrupts than " | ||||
"were allocated: releasing %d, allocated %d", count, | "were allocated: releasing %d, allocated %d", count, | ||||
Show All 38 Lines | gicv3_its_alloc_msix(device_t dev, device_t child, device_t *pic, | ||||
*isrcp = (struct intr_irqsrc *)girq; | *isrcp = (struct intr_irqsrc *)girq; | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
gicv3_its_release_msix(device_t dev, device_t child, struct intr_irqsrc *isrc) | gicv3_its_release_msix(device_t dev, device_t child, struct intr_irqsrc *isrc) | ||||
{ | { | ||||
struct gicv3_its_softc *sc; | |||||
struct gicv3_its_irqsrc *girq; | struct gicv3_its_irqsrc *girq; | ||||
struct its_dev *its_dev; | struct its_dev *its_dev; | ||||
sc = device_get_softc(dev); | |||||
its_dev = its_device_find(dev, child); | its_dev = its_device_find(dev, child); | ||||
KASSERT(its_dev != NULL, | KASSERT(its_dev != NULL, | ||||
("gicv3_its_release_msix: Releasing a MSI-X interrupt with " | ("gicv3_its_release_msix: Releasing a MSI-X interrupt with " | ||||
"no ITS device")); | "no ITS device")); | ||||
KASSERT(its_dev->lpis.lpi_busy > 0, | KASSERT(its_dev->lpis.lpi_busy > 0, | ||||
("gicv3_its_release_msix: Releasing more interrupts than " | ("gicv3_its_release_msix: Releasing more interrupts than " | ||||
"were allocated: allocated %d", its_dev->lpis.lpi_busy)); | "were allocated: allocated %d", its_dev->lpis.lpi_busy)); | ||||
▲ Show 20 Lines • Show All 219 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static uint64_t | static uint64_t | ||||
its_cmd_prepare(struct its_cmd *cmd, struct its_cmd_desc *desc) | its_cmd_prepare(struct its_cmd *cmd, struct its_cmd_desc *desc) | ||||
{ | { | ||||
uint64_t target; | uint64_t target; | ||||
uint8_t cmd_type; | uint8_t cmd_type; | ||||
u_int size; | u_int size; | ||||
boolean_t error; | |||||
error = FALSE; | |||||
cmd_type = desc->cmd_type; | cmd_type = desc->cmd_type; | ||||
target = ITS_TARGET_NONE; | target = ITS_TARGET_NONE; | ||||
switch (cmd_type) { | switch (cmd_type) { | ||||
case ITS_CMD_MOVI: /* Move interrupt ID to another collection */ | case ITS_CMD_MOVI: /* Move interrupt ID to another collection */ | ||||
target = desc->cmd_desc_movi.col->col_target; | target = desc->cmd_desc_movi.col->col_target; | ||||
cmd_format_command(cmd, ITS_CMD_MOVI); | cmd_format_command(cmd, ITS_CMD_MOVI); | ||||
cmd_format_id(cmd, desc->cmd_desc_movi.id); | cmd_format_id(cmd, desc->cmd_desc_movi.id); | ||||
▲ Show 20 Lines • Show All 272 Lines • Show Last 20 Lines |