aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/i8259.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-07-05 08:31:29 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-07-05 08:31:29 +0100
commit52ff658b7e69e45f00679b7f1a29d25ab7ed7f8e (patch)
tree879b8c70575e6963c2778e10b23583664dcc1cc1 /xen/arch/x86/i8259.c
parent19fbbfffdc2e8ad2c20f577e2a3e9b46a8a9e1da (diff)
downloadxen-52ff658b7e69e45f00679b7f1a29d25ab7ed7f8e.tar.gz
xen-52ff658b7e69e45f00679b7f1a29d25ab7ed7f8e.tar.bz2
xen-52ff658b7e69e45f00679b7f1a29d25ab7ed7f8e.zip
x2APIC: improve enabling logic
This patch masks PIC and IOAPIC RTE's before x2APIC enabling, unmask and restore them after x2APIC enabling. It also really enables interrupt remapping before x2APIC enabling instead of just checking interrupt remapping setting. This patch also handles all x2APIC configuration including BIOS settings and command line settings. Especially, it handles that BIOS hands over in x2APIC mode (when there is apic id > 255). It checks if x2APIC is already enabled by BIOS. If already enabled, it will disable interrupt remapping and queued invalidation first, then enable them again. Signed-off-by: Weidong Han <weidong.han@intel.com>
Diffstat (limited to 'xen/arch/x86/i8259.c')
-rw-r--r--xen/arch/x86/i8259.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/xen/arch/x86/i8259.c b/xen/arch/x86/i8259.c
index 2474f7864d..bd9c956ef2 100644
--- a/xen/arch/x86/i8259.c
+++ b/xen/arch/x86/i8259.c
@@ -175,6 +175,26 @@ int i8259A_irq_pending(unsigned int irq)
return ret;
}
+void mask_8259A(void)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&i8259A_lock, flags);
+ outb(0xff, 0xA1);
+ outb(0xff, 0x21);
+ spin_unlock_irqrestore(&i8259A_lock, flags);
+}
+
+void unmask_8259A(void)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&i8259A_lock, flags);
+ outb(cached_A1, 0xA1);
+ outb(cached_21, 0x21);
+ spin_unlock_irqrestore(&i8259A_lock, flags);
+}
+
/*
* This function assumes to be called rarely. Switching between
* 8259A registers is slow.