summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2008-10-21 06:38:40 +0000
committerkmacy <kmacy@FreeBSD.org>2008-10-21 06:38:40 +0000
commit84e725f1e7c12b4a710346250c985a5864f4f87f (patch)
tree4136c2b5cfd6a3c8b62d7285f74dc7fd6ef9efb1 /sys
parent63a2525f2b46846287c1133bd42738f26f279276 (diff)
downloadFreeBSD-src-84e725f1e7c12b4a710346250c985a5864f4f87f.zip
FreeBSD-src-84e725f1e7c12b4a710346250c985a5864f4f87f.tar.gz
Add routine for initializing AP clock
Diffstat (limited to 'sys')
-rw-r--r--sys/i386/xen/clock.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/sys/i386/xen/clock.c b/sys/i386/xen/clock.c
index 7361c72..b754800 100644
--- a/sys/i386/xen/clock.c
+++ b/sys/i386/xen/clock.c
@@ -766,27 +766,28 @@ cpu_initclocks(void)
}
/* should fast clock be enabled ? */
+
}
-/*
- *
- * XXX
- */
-#if 0 && defined(SMP)
-void
-ap_cpu_initclocks(void)
+int
+ap_cpu_initclocks(int cpu)
{
- int irq;
- int cpu = smp_processor_id();
-
- per_cpu(processed_system_time, cpu) = processed_system_time;
+ int time_irq;
+
+ xen_set_periodic_tick.period_ns = NS_PER_TICK;
- irq = bind_virq_to_irq(VIRQ_TIMER);
- PCPU_SET(time_irq, irq);
- PANIC_IF(intr_add_handler("clk", irq, (driver_filter_t *)clkintr, NULL,
- NULL, INTR_TYPE_CLK | INTR_FAST, NULL));
+ HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, cpu,
+ &xen_set_periodic_tick);
+
+ if ((time_irq = bind_virq_to_irqhandler(VIRQ_TIMER, cpu, "clk",
+ (driver_filter_t *)clkintr, NULL,
+ INTR_TYPE_CLK | INTR_FAST)) < 0) {
+ panic("failed to register clock interrupt\n");
+ }
+
+ return (0);
}
-#endif
+
void
cpu_startprofclock(void)
OpenPOWER on IntegriCloud