summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-07-13 22:19:35 -0700
committerIngo Molnar <mingo@elte.hu>2008-07-14 09:02:54 +0200
commit94a8c3c2437c8946f1b6c8e0b2c560a7db8ed3c6 (patch)
tree7bad615005b6047306336e8f688edcf1c6bb74dd /arch
parentf910a9dc7c865896815e2a95fe33363e9522f277 (diff)
downloadlinux-94a8c3c2437c8946f1b6c8e0b2c560a7db8ed3c6.tar.gz
linux-94a8c3c2437c8946f1b6c8e0b2c560a7db8ed3c6.tar.bz2
linux-94a8c3c2437c8946f1b6c8e0b2c560a7db8ed3c6.zip
x86: let 32bit use apic_ops too - fix
fix for pv - clean up the namespace there too. Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Cc: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/paravirt.c5
-rw-r--r--arch/x86/kernel/vmi_32.c51
-rw-r--r--arch/x86/xen/enlighten.c19
3 files changed, 57 insertions, 18 deletions
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 4f29ff847ebe..e0f139106c7e 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -360,11 +360,6 @@ struct pv_cpu_ops pv_cpu_ops = {
struct pv_apic_ops pv_apic_ops = {
#ifdef CONFIG_X86_LOCAL_APIC
-#ifndef CONFIG_X86_64
- .apic_write = native_apic_mem_write,
- .apic_write_atomic = native_apic_mem_write_atomic,
- .apic_read = native_apic_mem_read,
-#endif
.setup_boot_clock = setup_boot_APIC_clock,
.setup_secondary_clock = setup_secondary_APIC_clock,
.startup_ipi_hook = paravirt_nop,
diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c
index b15346092b7b..cf3074354553 100644
--- a/arch/x86/kernel/vmi_32.c
+++ b/arch/x86/kernel/vmi_32.c
@@ -676,6 +676,50 @@ static inline int __init probe_vmi_rom(void)
return 0;
}
+#ifdef CONFIG_X86_LOCAL_APIC
+static u32 vmi_apic_read(u32 reg)
+{
+ return 0;
+}
+
+static void vmi_apic_write(u32 reg, u32 val)
+{
+ /* Warn to see if there's any stray references */
+ WARN_ON(1);
+}
+
+static u64 vmi_apic_icr_read(void)
+{
+ return 0;
+}
+
+static void vmi_apic_icr_write(u32 low, u32 id)
+{
+ /* Warn to see if there's any stray references */
+ WARN_ON(1);
+}
+
+static void vmi_apic_wait_icr_idle(void)
+{
+ return;
+}
+
+static u32 vmi_safe_apic_wait_icr_idle(void)
+{
+ return 0;
+}
+
+static struct apic_ops vmi_basic_apic_ops = {
+ .read = vmi_apic_read,
+ .write = vmi_apic_write,
+ .write_atomic = vmi_apic_write,
+ .icr_read = vmi_apic_icr_read,
+ .icr_write = vmi_apic_icr_write,
+ .wait_icr_idle = vmi_apic_wait_icr_idle,
+ .safe_wait_icr_idle = vmi_safe_apic_wait_icr_idle,
+};
+#endif
+
/*
* VMI setup common to all processors
*/
@@ -904,9 +948,10 @@ static inline int __init activate_vmi(void)
#endif
#ifdef CONFIG_X86_LOCAL_APIC
- para_fill(pv_apic_ops.apic_read, APICRead);
- para_fill(pv_apic_ops.apic_write, APICWrite);
- para_fill(pv_apic_ops.apic_write_atomic, APICWrite);
+ para_fill(vmi_basic_apic_ops.read, APICRead);
+ para_fill(vmi_basic_apic_ops.write, APICWrite);
+ para_fill(vmi_basic_apic_ops.write_atomic, APICWrite);
+ apic_ops = &vmi_basic_apic_ops;
#endif
/*
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 54e255667530..d11dda7ebd7a 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -559,7 +559,6 @@ static void xen_apic_write(u32 reg, u32 val)
WARN_ON(1);
}
-#ifdef CONFIG_X86_64
static u64 xen_apic_icr_read(void)
{
return 0;
@@ -576,6 +575,11 @@ static void xen_apic_wait_icr_idle(void)
return;
}
+static u32 xen_safe_apic_wait_icr_idle(void)
+{
+ return 0;
+}
+
static struct apic_ops xen_basic_apic_ops = {
.read = xen_apic_read,
.write = xen_apic_write,
@@ -583,9 +587,8 @@ static struct apic_ops xen_basic_apic_ops = {
.icr_read = xen_apic_icr_read,
.icr_write = xen_apic_icr_write,
.wait_icr_idle = xen_apic_wait_icr_idle,
- .safe_wait_icr_idle = xen_apic_wait_icr_idle,
+ .safe_wait_icr_idle = xen_safe_apic_wait_icr_idle,
};
-#endif
#endif
@@ -1159,11 +1162,6 @@ static const struct pv_irq_ops xen_irq_ops __initdata = {
static const struct pv_apic_ops xen_apic_ops __initdata = {
#ifdef CONFIG_X86_LOCAL_APIC
-#ifndef CONFIG_X86_64
- .apic_write = xen_apic_write,
- .apic_write_atomic = xen_apic_write,
- .apic_read = xen_apic_read,
-#endif
.setup_boot_clock = paravirt_nop,
.setup_secondary_clock = paravirt_nop,
.startup_ipi_hook = paravirt_nop,
@@ -1322,9 +1320,10 @@ asmlinkage void __init xen_start_kernel(void)
pv_irq_ops = xen_irq_ops;
pv_apic_ops = xen_apic_ops;
pv_mmu_ops = xen_mmu_ops;
-#ifdef CONFIG_X86_64
+
+#ifdef CONFIG_X86_LOCAL_APIC
/*
- * for 64bit, set up the basic apic ops aswell.
+ * set up the basic apic ops.
*/
apic_ops = &xen_basic_apic_ops;
#endif