8259 specific mask/unmask routines which be used later while enabling
interrupt-remapping.

Signed-off-by: Suresh Siddha
---

Index: tree-x86/arch/x86/kernel/i8259.c
================================================== =================
--- tree-x86.orig/arch/x86/kernel/i8259.c 2008-07-10 09:51:45.000000000 -0700
+++ tree-x86/arch/x86/kernel/i8259.c 2008-07-10 09:52:09.000000000 -0700
@@ -282,6 +282,30 @@

device_initcall(i8259A_init_sysfs);

+void mask_8259A(void)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&i8259A_lock, flags);
+
+ outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */
+ outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-2 */
+
+ spin_unlock_irqrestore(&i8259A_lock, flags);
+}
+
+void unmask_8259A(void)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&i8259A_lock, flags);
+
+ outb(cached_master_mask, PIC_MASTER_IMR); /* restore master IRQ mask */
+ outb(cached_slave_mask, PIC_SLAVE_IMR); /* restore slave IRQ mask */
+
+ spin_unlock_irqrestore(&i8259A_lock, flags);
+}
+
void init_8259A(int auto_eoi)
{
unsigned long flags;
Index: tree-x86/include/asm-x86/i8259.h
================================================== =================
--- tree-x86.orig/include/asm-x86/i8259.h 2008-07-10 09:51:45.000000000 -0700
+++ tree-x86/include/asm-x86/i8259.h 2008-07-10 09:52:09.000000000 -0700
@@ -57,4 +57,7 @@

extern struct irq_chip i8259A_chip;

+extern void mask_8259A(void);
+extern void unmask_8259A(void);
+
#endif /* __ASM_I8259_H__ */

--

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/