1 From: Suresh Siddha <suresh.b.siddha@intel.com>
2 Subject: x64, x2apic/intr-remap: 8259 specific mask/unmask routines
3 References: fate #303948 and fate #303984
4 Patch-Mainline: queued for .28
5 Commit-ID: d94d93ca5cc36cd78c532def62772c98fe8ba5d7
7 Signed-off-by: Thomas Renninger <trenn@suse.de>
9 8259 specific mask/unmask routines which be used later while enabling
12 Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
13 Cc: akpm@linux-foundation.org
14 Cc: arjan@linux.intel.com
15 Cc: andi@firstfloor.org
16 Cc: ebiederm@xmission.com
17 Cc: jbarnes@virtuousgeek.org
19 Signed-off-by: Ingo Molnar <mingo@elte.hu>
22 arch/x86/kernel/i8259.c | 24 ++++++++++++++++++++++++
23 include/asm-x86/i8259.h | 3 +++
24 2 files changed, 27 insertions(+)
26 Index: linux-2.6.26/arch/x86/kernel/i8259.c
27 ===================================================================
28 --- linux-2.6.26.orig/arch/x86/kernel/i8259.c
29 +++ linux-2.6.26/arch/x86/kernel/i8259.c
30 @@ -282,6 +282,30 @@ static int __init i8259A_init_sysfs(void
32 device_initcall(i8259A_init_sysfs);
34 +void mask_8259A(void)
36 + unsigned long flags;
38 + spin_lock_irqsave(&i8259A_lock, flags);
40 + outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */
41 + outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-2 */
43 + spin_unlock_irqrestore(&i8259A_lock, flags);
46 +void unmask_8259A(void)
48 + unsigned long flags;
50 + spin_lock_irqsave(&i8259A_lock, flags);
52 + outb(cached_master_mask, PIC_MASTER_IMR); /* restore master IRQ mask */
53 + outb(cached_slave_mask, PIC_SLAVE_IMR); /* restore slave IRQ mask */
55 + spin_unlock_irqrestore(&i8259A_lock, flags);
58 void init_8259A(int auto_eoi)
61 Index: linux-2.6.26/include/asm-x86/i8259.h
62 ===================================================================
63 --- linux-2.6.26.orig/include/asm-x86/i8259.h
64 +++ linux-2.6.26/include/asm-x86/i8259.h
65 @@ -57,4 +57,7 @@ static inline void outb_pic(unsigned cha
67 extern struct irq_chip i8259A_chip;
69 +extern void mask_8259A(void);
70 +extern void unmask_8259A(void);
72 #endif /* __ASM_I8259_H__ */