timer.c (255726) | timer.c (256073) |
---|---|
1/*- 2 * Copyright (c) 2009 Adrian Chadd 3 * Copyright (c) 2012 Spectra Logic Corporation 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 18 unchanged lines hidden (view full) --- 27 */ 28 29/** 30 * \file dev/xen/timer/timer.c 31 * \brief A timer driver for the Xen hypervisor's PV clock. 32 */ 33 34#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2009 Adrian Chadd 3 * Copyright (c) 2012 Spectra Logic Corporation 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 18 unchanged lines hidden (view full) --- 27 */ 28 29/** 30 * \file dev/xen/timer/timer.c 31 * \brief A timer driver for the Xen hypervisor's PV clock. 32 */ 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: head/sys/dev/xen/timer/timer.c 255726 2013-09-20 05:06:03Z gibbs $"); | 35__FBSDID("$FreeBSD: head/sys/dev/xen/timer/timer.c 256073 2013-10-05 23:11:01Z gibbs $"); |
36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/bus.h> 40#include <sys/kernel.h> 41#include <sys/module.h> 42#include <sys/time.h> 43#include <sys/timetc.h> --- 347 unchanged lines hidden (view full) --- 391 * \returns 0 392 */ 393static int 394xentimer_et_start(struct eventtimer *et, 395 sbintime_t first, sbintime_t period) 396{ 397 int error = 0, i = 0; 398 struct xentimer_softc *sc = et->et_priv; | 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/bus.h> 40#include <sys/kernel.h> 41#include <sys/module.h> 42#include <sys/time.h> 43#include <sys/timetc.h> --- 347 unchanged lines hidden (view full) --- 391 * \returns 0 392 */ 393static int 394xentimer_et_start(struct eventtimer *et, 395 sbintime_t first, sbintime_t period) 396{ 397 int error = 0, i = 0; 398 struct xentimer_softc *sc = et->et_priv; |
399 int cpu = PCPU_GET(acpi_id); | 399 int cpu = PCPU_GET(vcpu_id); |
400 struct xentimer_pcpu_data *pcpu = DPCPU_PTR(xentimer_pcpu); 401 uint64_t first_in_ns, next_time; 402 403 /* See sbttots() for this formula. */ 404 first_in_ns = (((first >> 32) * NSEC_IN_SEC) + 405 (((uint64_t)NSEC_IN_SEC * (uint32_t)first) >> 32)); 406 407 /* --- 20 unchanged lines hidden (view full) --- 428} 429 430/** 431 * \brief Cancel the event timer's currently running timer, if any. 432 */ 433static int 434xentimer_et_stop(struct eventtimer *et) 435{ | 400 struct xentimer_pcpu_data *pcpu = DPCPU_PTR(xentimer_pcpu); 401 uint64_t first_in_ns, next_time; 402 403 /* See sbttots() for this formula. */ 404 first_in_ns = (((first >> 32) * NSEC_IN_SEC) + 405 (((uint64_t)NSEC_IN_SEC * (uint32_t)first) >> 32)); 406 407 /* --- 20 unchanged lines hidden (view full) --- 428} 429 430/** 431 * \brief Cancel the event timer's currently running timer, if any. 432 */ 433static int 434xentimer_et_stop(struct eventtimer *et) 435{ |
436 int cpu = PCPU_GET(acpi_id); | 436 int cpu = PCPU_GET(vcpu_id); |
437 struct xentimer_pcpu_data *pcpu = DPCPU_PTR(xentimer_pcpu); 438 439 pcpu->timer = 0; 440 return (xentimer_vcpu_stop_timer(cpu)); 441} 442 443/** 444 * \brief Attach a Xen PV timer driver instance. --- 152 unchanged lines hidden --- | 437 struct xentimer_pcpu_data *pcpu = DPCPU_PTR(xentimer_pcpu); 438 439 pcpu->timer = 0; 440 return (xentimer_vcpu_stop_timer(cpu)); 441} 442 443/** 444 * \brief Attach a Xen PV timer driver instance. --- 152 unchanged lines hidden --- |