From: Suresh Siddha Subject: x64, x2apic/intr-remap: 8259 specific mask/unmask routines References: fate #303948 and fate #303984 Patch-Mainline: queued for .28 Commit-ID: d94d93ca5cc36cd78c532def62772c98fe8ba5d7 Signed-off-by: Thomas Renninger 8259 specific mask/unmask routines which be used later while enabling interrupt-remapping. Signed-off-by: Suresh Siddha Cc: akpm@linux-foundation.org Cc: arjan@linux.intel.com Cc: andi@firstfloor.org Cc: ebiederm@xmission.com Cc: jbarnes@virtuousgeek.org Cc: steiner@sgi.com Signed-off-by: Ingo Molnar --- arch/x86/kernel/i8259.c | 24 ++++++++++++++++++++++++ include/asm-x86/i8259.h | 3 +++ 2 files changed, 27 insertions(+) Index: linux-2.6.26/arch/x86/kernel/i8259.c =================================================================== --- linux-2.6.26.orig/arch/x86/kernel/i8259.c +++ linux-2.6.26/arch/x86/kernel/i8259.c @@ -282,6 +282,30 @@ static int __init i8259A_init_sysfs(void 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: linux-2.6.26/include/asm-x86/i8259.h =================================================================== --- linux-2.6.26.orig/include/asm-x86/i8259.h +++ linux-2.6.26/include/asm-x86/i8259.h @@ -57,4 +57,7 @@ static inline void outb_pic(unsigned cha extern struct irq_chip i8259A_chip; +extern void mask_8259A(void); +extern void unmask_8259A(void); + #endif /* __ASM_I8259_H__ */