From 9198d09682e0ff9e4b99c1a500c60ec311f33516 Mon Sep 17 00:00:00 2001 From: kmacy Date: Mon, 29 Dec 2008 06:31:03 +0000 Subject: merge 186535, 186537, and 186538 from releng_7_xen Log: - merge in latest xenbus from dfr's xenhvm - fix race condition in xs_read_reply by converting tsleep to mtx_sleep Log: unmask evtchn in bind_{virq, ipi}_to_irq Log: - remove code for handling case of not being able to sleep - eliminate tsleep - make sleeps atomic --- sys/i386/xen/clock.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'sys/i386/xen/clock.c') diff --git a/sys/i386/xen/clock.c b/sys/i386/xen/clock.c index 3b4b6f3..db5b09c 100644 --- a/sys/i386/xen/clock.c +++ b/sys/i386/xen/clock.c @@ -78,11 +78,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include -#include +#include #include #include #include @@ -791,18 +791,20 @@ static struct vcpu_set_periodic_timer xen_set_periodic_tick; void cpu_initclocks(void) { - int time_irq; - + unsigned int time_irq; + int error; + xen_set_periodic_tick.period_ns = NS_PER_TICK; HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, 0, &xen_set_periodic_tick); - - if ((time_irq = bind_virq_to_irqhandler(VIRQ_TIMER, 0, "clk", - clkintr, NULL, - INTR_TYPE_CLK | INTR_FAST)) < 0) { + + error = bind_virq_to_irqhandler(VIRQ_TIMER, 0, "clk", + clkintr, NULL, NULL, + INTR_TYPE_CLK | INTR_FAST, &time_irq); + if (error) panic("failed to register clock interrupt\n"); - } + /* should fast clock be enabled ? */ @@ -811,18 +813,19 @@ cpu_initclocks(void) int ap_cpu_initclocks(int cpu) { - int time_irq; + unsigned int time_irq; + int error; xen_set_periodic_tick.period_ns = NS_PER_TICK; HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, cpu, &xen_set_periodic_tick); - - if ((time_irq = bind_virq_to_irqhandler(VIRQ_TIMER, cpu, "clk", - clkintr2, NULL, - INTR_TYPE_CLK | INTR_FAST)) < 0) { + error = bind_virq_to_irqhandler(VIRQ_TIMER, 0, "clk", + clkintr, NULL, NULL, + INTR_TYPE_CLK | INTR_FAST, &time_irq); + if (error) panic("failed to register clock interrupt\n"); - } + return (0); } -- cgit v1.1