Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/iommu/intel_intrmap.c
Show First 20 Lines • Show All 228 Lines • ▼ Show 20 Lines | KASSERT(unit != NULL && unit->ir_enabled, | ||||
("unmap: cookie %d unit %p", idx, unit)); | ("unmap: cookie %d unit %p", idx, unit)); | ||||
return (dmar_ir_free_irte(unit, idx)); | return (dmar_ir_free_irte(unit, idx)); | ||||
} | } | ||||
static struct dmar_unit * | static struct dmar_unit * | ||||
dmar_ir_find(device_t src, uint16_t *rid, int *is_dmar) | dmar_ir_find(device_t src, uint16_t *rid, int *is_dmar) | ||||
{ | { | ||||
devclass_t src_class; | devclass_t src_class; | ||||
struct dmar_unit *unit; | struct iommu_unit *unit; | ||||
struct dmar_unit *dmar; | |||||
/* | /* | ||||
* We need to determine if the interrupt source generates FSB | * We need to determine if the interrupt source generates FSB | ||||
* interrupts. If yes, it is either DMAR, in which case | * interrupts. If yes, it is either DMAR, in which case | ||||
* interrupts are not remapped. Or it is HPET, and interrupts | * interrupts are not remapped. Or it is HPET, and interrupts | ||||
* are remapped. For HPET, source id is reported by HPET | * are remapped. For HPET, source id is reported by HPET | ||||
* record in DMAR ACPI table. | * record in DMAR ACPI table. | ||||
*/ | */ | ||||
if (is_dmar != NULL) | if (is_dmar != NULL) | ||||
*is_dmar = FALSE; | *is_dmar = FALSE; | ||||
src_class = device_get_devclass(src); | src_class = device_get_devclass(src); | ||||
if (src_class == devclass_find("dmar")) { | if (src_class == devclass_find("dmar")) { | ||||
unit = NULL; | dmar = NULL; | ||||
if (is_dmar != NULL) | if (is_dmar != NULL) | ||||
*is_dmar = TRUE; | *is_dmar = TRUE; | ||||
} else if (src_class == devclass_find("hpet")) { | } else if (src_class == devclass_find("hpet")) { | ||||
unit = dmar_find_hpet(src, rid); | dmar = dmar_find_hpet(src, rid); | ||||
} else { | } else { | ||||
unit = dmar_find(src, bootverbose); | unit = iommu_find(src, bootverbose); | ||||
dmar = (struct dmar_unit *)unit; | |||||
if (unit != NULL && rid != NULL) | if (unit != NULL && rid != NULL) | ||||
dmar_get_requester(src, rid); | iommu_get_requester(src, rid); | ||||
} | } | ||||
return (unit); | return (dmar); | ||||
} | } | ||||
static void | static void | ||||
dmar_ir_program_irte(struct dmar_unit *unit, u_int idx, uint64_t low, | dmar_ir_program_irte(struct dmar_unit *unit, u_int idx, uint64_t low, | ||||
uint16_t rid) | uint16_t rid) | ||||
{ | { | ||||
dmar_irte_t *irte; | dmar_irte_t *irte; | ||||
uint64_t high; | uint64_t high; | ||||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |