Esempio n. 1
0
static void
ntb_handle_legacy_interrupt(void *arg)
{
	struct ntb_softc *ntb = arg;
	unsigned int i = 0;
	uint64_t pdb64;
	uint16_t pdb16;

	if (ntb->type == NTB_SOC) {
		pdb64 = ntb_reg_read(8, ntb->reg_ofs.pdb);

		while (pdb64) {
			i = ffs(pdb64);
			pdb64 &= pdb64 - 1;
			handle_soc_irq(&ntb->db_cb[i]);
		}
	} else {
		pdb16 = ntb_reg_read(2, ntb->reg_ofs.pdb);

		if ((pdb16 & XEON_DB_HW_LINK) != 0) {
			handle_xeon_event_irq(ntb);
			pdb16 &= ~XEON_DB_HW_LINK;
		}

		while (pdb16 != 0) {
			i = ffs(pdb16);
			pdb16 &= pdb16 - 1;
			handle_xeon_irq(&ntb->db_cb[i]);
		}
	}

}
Esempio n. 2
0
static void
ntb_handle_legacy_interrupt(void *arg)
{
	struct ntb_softc *ntb = arg;
	unsigned int i;
	uint64_t ldb;

	ldb = db_ioread(ntb, ntb->reg_ofs.ldb);

	if (ntb->type == NTB_XEON && (ldb & XEON_DB_HW_LINK) != 0) {
		handle_xeon_event_irq(ntb);
		ldb &= ~XEON_DB_HW_LINK;
	}

	while (ldb != 0) {
		i = ffs(ldb);
		ldb &= ldb - 1;
		if (ntb->type == NTB_SOC)
			handle_soc_irq(&ntb->db_cb[i]);
		else
			handle_xeon_irq(&ntb->db_cb[i]);
	}
}