/* The generic VIA interrupt routines (shamelessly stolen from Alan Cox's via6522.c :-), disable/pending masks added.  */
irqreturn_t via1_irq(int, void *)
/* The generic VIA interrupt routines (shamelessly stolen from Alan Cox's via6522.c :-), disable/pending masks added.  */
irqreturn_t via1_irq(int, void *)
{
	int irq_num;
	unsigned char irq_bit, events;
	events = via1[vIFR] & via1[vIER] & 0x7F;
	if (!events)
		return IRQ_NONE;
	irq_num = VIA1_SOURCE_BASE;
	irq_bit = 1;
	do {
		if (events & irq_bit) {
			via1[vIFR] = irq_bit;
			m68k_handle_int(irq_num);
		}
		++irq_num;
		irq_bit <<= 1;
	} while (events >= irq_bit);
	return IRQ_HANDLED;
}