示例#1
0
文件: mpic.c 项目: fengsi/freebsd
uint32_t
mv_mpic_get_msi(void)
{
    uint32_t cause;
    uint8_t bit_off;

    cause = MPIC_DRBL_READ(mv_mpic_sc, 0);

    if (cause)
        bit_off = ffs(cause) - 1;
    else
        return (-1);

    debugf("%s: irq:%x cause:%x\n", __func__, bit_off, cause);

    cause &= ~(1 << bit_off);
    MPIC_DRBL_WRITE(mv_mpic_sc, 0, cause);

    return (MSI_IRQ + bit_off);
}
示例#2
0
uint32_t
mv_mpic_get_msi(void)
{
	uint32_t cause;
	uint8_t bit_off;

	KASSERT(mv_mpic_sc->drbl_bst != NULL, ("No doorbell in mv_mpic_get_msi"));
	cause = MPIC_DRBL_READ(mv_mpic_sc, 0);

	if (cause)
		bit_off = ffs(cause) - 1;
	else
		return (-1);

	debugf("%s: irq:%x cause:%x\n", __func__, bit_off, cause);

	cause &= ~(1 << bit_off);
	MPIC_DRBL_WRITE(mv_mpic_sc, 0, cause);

	return (MSI_IRQ + bit_off);
}