summaryrefslogtreecommitdiffstats
path: root/sys/amd64/amd64/mp_machdep.c
diff options
context:
space:
mode:
authorroyger <royger@FreeBSD.org>2014-06-16 08:43:03 +0000
committerroyger <royger@FreeBSD.org>2014-06-16 08:43:03 +0000
commit7c7f3fb2d000c0584e6a496d374e00f708ed9844 (patch)
treebad88a87c2bb4d2feaa6b0de59821f5c2a2f1465 /sys/amd64/amd64/mp_machdep.c
parent6a8d0be3956efd157e8cae29391bc54ab94faaec (diff)
downloadFreeBSD-src-7c7f3fb2d000c0584e6a496d374e00f708ed9844.zip
FreeBSD-src-7c7f3fb2d000c0584e6a496d374e00f708ed9844.tar.gz
amd64/i386: introduce APIC hooks for different APIC implementations.
This is needed for Xen PV(H) guests, since there's no hardware lapic available on this kind of domains. This commit should not change functionality. Sponsored by: Citrix Systems R&D Reviewed by: jhb Approved by: gibbs amd64/include/cpu.h: amd64/amd64/mp_machdep.c: i386/include/cpu.h: i386/i386/mp_machdep.c: - Remove lapic_ipi_vectored hook from cpu_ops, since it's now implemented in the lapic hooks. amd64/amd64/mp_machdep.c: i386/i386/mp_machdep.c: - Use lapic_ipi_vectored directly, since it's now an inline function that will call the appropiate hook. x86/x86/local_apic.c: - Prefix bare metal public lapic functions with native_ and mark them as static. - Define default implementation of apic_ops. x86/include/apicvar.h: - Declare the apic_ops structure and create inline functions to access the hooks, so the change is transparent to existing users of the lapic_ functions. x86/xen/hvm.c: - Switch to use the new apic_ops.
Diffstat (limited to 'sys/amd64/amd64/mp_machdep.c')
-rw-r--r--sys/amd64/amd64/mp_machdep.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index 6e59645..9b12449 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -125,9 +125,7 @@ static u_long *ipi_hardclock_counts[MAXCPU];
#endif
/* Default cpu_ops implementation. */
-struct cpu_ops cpu_ops = {
- .ipi_vectored = lapic_ipi_vectored
-};
+struct cpu_ops cpu_ops;
extern inthand_t IDTVEC(fast_syscall), IDTVEC(fast_syscall32);
@@ -1125,7 +1123,7 @@ ipi_send_cpu(int cpu, u_int ipi)
if (old_pending)
return;
}
- cpu_ops.ipi_vectored(ipi, cpu_apic_ids[cpu]);
+ lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]);
}
/*
@@ -1395,7 +1393,7 @@ ipi_all_but_self(u_int ipi)
CPU_OR_ATOMIC(&ipi_nmi_pending, &other_cpus);
CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi);
- cpu_ops.ipi_vectored(ipi, APIC_IPI_DEST_OTHERS);
+ lapic_ipi_vectored(ipi, APIC_IPI_DEST_OTHERS);
}
int
OpenPOWER on IntegriCloud