Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Oct 2008 06:38:41 +0000 (UTC)
From:      Kip Macy <kmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r184111 - head/sys/i386/xen
Message-ID:  <200810210638.m9L6cf39091305@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kmacy
Date: Tue Oct 21 06:38:40 2008
New Revision: 184111
URL: http://svn.freebsd.org/changeset/base/184111

Log:
  Add routine for initializing AP clock

Modified:
  head/sys/i386/xen/clock.c

Modified: head/sys/i386/xen/clock.c
==============================================================================
--- head/sys/i386/xen/clock.c	Tue Oct 21 06:38:05 2008	(r184110)
+++ head/sys/i386/xen/clock.c	Tue Oct 21 06:38:40 2008	(r184111)
@@ -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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810210638.m9L6cf39091305>