/* This function assumes to be called rarely. Switching between 8259A registers is slow. This has to be protected by the irq controller spinlock before being called.  */
static int i8259A_irq_real(unsigned int irq)
/* This function assumes to be called rarely. Switching between 8259A registers is slow. This has to be protected by the irq controller spinlock before being called.  */
static int i8259A_irq_real(unsigned int irq)
{
	int value;
	int irqmask = 1 << irq;
	if (irq < 8) {
		outb(0x0B, PIC_MASTER_CMD);
		value = inb(PIC_MASTER_CMD) & irqmask;
		outb(0x0A, PIC_MASTER_CMD);
		return value;
	}
	outb(0x0B, PIC_SLAVE_CMD);
	value = inb(PIC_SLAVE_CMD) & (irqmask >> 8);
	outb(0x0A, PIC_SLAVE_CMD);
	return value;
}