FreeBSD/sys/dev/uart/uart_dev_ns8250.c
/*
 * Clear pending interrupts. THRE is cleared by reading IIR. Data
 * that may have been received gets lost here.
 */
Clear pending interrupts. THRE is cleared by reading IIR. Data
that may have been received gets lost here.
Clear pending interrupts . THRE is cleared by reading IIR . Data that may have been received gets lost here .
static void
ns8250_clrint(struct uart_bas *bas)
{
	uint8_t iir, lsr;
	iir = uart_getreg(bas, REG_IIR);
	while ((iir & IIR_NOPEND) == 0) {
		iir &= IIR_IMASK;
		if (iir == IIR_RLS) {
			lsr = uart_getreg(bas, REG_LSR);
			if (lsr & (LSR_BI|LSR_FE|LSR_PE))
				(void)uart_getreg(bas, REG_DATA);
		} else if (iir == IIR_RXRDY || iir == IIR_RXTOUT)
			(void)uart_getreg(bas, REG_DATA);
		else if (iir == IIR_MLSC)
			(void)uart_getreg(bas, REG_MSR);
		uart_barrier(bas);
		iir = uart_getreg(bas, REG_IIR);
	}
}
static void ns8250_clrint ( struct uart_bas * bas ) { uint8_t iir , lsr ; iir = uart_getreg ( bas , REG_IIR ) ; while ( ( iir & IIR_NOPEND ) == 0 ) { iir &= IIR_IMASK ; if ( iir == IIR_RLS ) { lsr = uart_getreg ( bas , REG_LSR ) ; if ( lsr & ( LSR_BI | LSR_FE | LSR_PE ) ) ( void ) uart_getreg ( bas , REG_DATA ) ; } else if ( iir == IIR_RXRDY || iir == IIR_RXTOUT ) ( void ) uart_getreg ( bas , REG_DATA ) ; else if ( iir == IIR_MLSC ) ( void ) uart_getreg ( bas , REG_MSR ) ; uart_barrier ( bas ) ; iir = uart_getreg ( bas , REG_IIR ) ; } }
Clear pending interrupts.
Clear pending interrupts .