2 * include/asm-mips/i8259.h
4 * i8259A interrupt definitions.
6 * Copyright (C) 2003 Maciej W. Rozycki
7 * Copyright (C) 2003 Ralf Baechle <ralf@linux-mips.org>
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
17 #include <linux/compiler.h>
18 #include <linux/spinlock.h>
22 extern spinlock_t i8259A_lock
;
24 extern void init_i8259_irqs(void);
27 * Do the traditional i8259 interrupt polling thing. This is for the few
28 * cases where no better interrupt acknowledge method is available and we
29 * absolutely must touch the i8259.
31 static inline int i8259_irq(void)
35 spin_lock(&i8259A_lock
);
37 /* Perform an interrupt acknowledge cycle on controller 1. */
38 outb(0x0C, 0x20); /* prepare for poll */
42 * Interrupt is cascaded so perform interrupt
43 * acknowledge on controller 2.
45 outb(0x0C, 0xA0); /* prepare for poll */
46 irq
= (inb(0xA0) & 7) + 8;
49 if (unlikely(irq
== 7)) {
51 * This may be a spurious interrupt.
53 * Read the interrupt status register (ISR). If the most
54 * significant bit is not set then there is no valid
57 outb(0x0B, 0x20); /* ISR register */
62 spin_unlock(&i8259A_lock
);
67 #endif /* _ASM_I8259_H */