svn commit: r259702 - head/sys/amd64/vmm/io
Neel Natu
neel at FreeBSD.org
Sun Dec 22 00:08:01 UTC 2013
Author: neel
Date: Sun Dec 22 00:08:00 2013
New Revision: 259702
URL: http://svnweb.freebsd.org/changeset/base/259702
Log:
Consolidate the virtual apic initialization in a single function: vlapic_reset()
Modified:
head/sys/amd64/vmm/io/vlapic.c
Modified: head/sys/amd64/vmm/io/vlapic.c
==============================================================================
--- head/sys/amd64/vmm/io/vlapic.c Sun Dec 22 00:07:40 2013 (r259701)
+++ head/sys/amd64/vmm/io/vlapic.c Sun Dec 22 00:08:00 2013 (r259702)
@@ -334,33 +334,24 @@ vlapic_update_errors(struct vlapic *vlap
}
static void
-vlapic_init_ipi(struct vlapic *vlapic)
+vlapic_reset(struct vlapic *vlapic)
{
- struct LAPIC *lapic = &vlapic->apic;
+ struct LAPIC *lapic;
+
+ lapic = &vlapic->apic;
+ bzero(lapic, sizeof(struct LAPIC));
+
lapic->version = VLAPIC_VERSION;
lapic->version |= (VLAPIC_MAXLVT_ENTRIES << MAXLVTSHIFT);
lapic->dfr = 0xffffffff;
lapic->svr = APIC_SVR_VECTOR;
vlapic_mask_lvts(&lapic->lvt_timer, VLAPIC_MAXLVT_ENTRIES+1);
-}
-
-static int
-vlapic_reset(struct vlapic *vlapic)
-{
- struct LAPIC *lapic = &vlapic->apic;
-
- memset(lapic, 0, sizeof(*lapic));
- lapic->apr = vlapic->vcpuid;
- vlapic_init_ipi(vlapic);
vlapic_set_dcr(vlapic, 0);
if (vlapic->vcpuid == 0)
vlapic->boot_state = BS_RUNNING; /* BSP */
else
vlapic->boot_state = BS_INIT; /* AP */
-
- return 0;
-
}
void
More information about the svn-src-head
mailing list