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

Function dmar_load_irt_ptr

freebsd/x86/iommu/intel_utils.c:519–539  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517}
518
519int
520dmar_load_irt_ptr(struct dmar_unit *unit)
521{
522 uint64_t irta, s;
523 int error;
524
525 DMAR_ASSERT_LOCKED(unit);
526 irta = unit->irt_phys;
527 if (DMAR_X2APIC(unit))
528 irta |= DMAR_IRTA_EIME;
529 s = fls(unit->irte_cnt) - 2;
530 KASSERT(unit->irte_cnt >= 2 && s <= DMAR_IRTA_S_MASK &&
531 powerof2(unit->irte_cnt),
532 ("IRTA_REG_S overflow %x", unit->irte_cnt));
533 irta |= s;
534 dmar_write8(unit, DMAR_IRTA_REG, irta);
535 dmar_write4(unit, DMAR_GCMD_REG, unit->hw_gcmd | DMAR_GCMD_SIRTP);
536 DMAR_WAIT_UNTIL(((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_IRTPS)
537 != 0));
538 return (error);
539}
540
541int
542dmar_enable_ir(struct dmar_unit *unit)

Callers 1

dmar_init_irtFunction · 0.85

Calls 4

dmar_write8Function · 0.85
dmar_write4Function · 0.85
dmar_read4Function · 0.85
flsFunction · 0.50

Tested by

no test coverage detected