Lines Matching +full:tsc +full:- +full:irq
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
49 #include <xen/xen-os.h>
70 /* 18446744073 = int(2^64 / NSEC_IN_SC) = 1 ns in 64-bit fractions */
107 if (devclass_get_device(devclass_find(driver->name), 0)) in xentimer_identify()
110 BUS_ADD_CHILD(parent, 0, driver->name, 0); in xentimer_identify()
119 * - Vector callback support by the hypervisor, in order to deliver in xentimer_probe()
121 * - Access to the hypervisor shared info page, in order to look up in xentimer_probe()
123 * - The hypervisor must say its PV clock is "safe" to use. in xentimer_probe()
124 * - The hypervisor must support VCPUOP hypercalls. in xentimer_probe()
125 * - The maximum number of CPUs supported by FreeBSD must not exceed in xentimer_probe()
161 time = (struct pvclock_vcpu_time_info *) &vcpu->time; in xen_fetch_vcpu_time()
189 * \note This value is updated when Domain-0 shifts its clock to follow
198 wc = (struct pvclock_wall_clock *) &src->wc_version; in xen_fetch_wallclock()
210 ts->tv_sec = uptime / NSEC_IN_SEC; in xen_fetch_uptime()
211 ts->tv_nsec = uptime % NSEC_IN_SEC; in xen_fetch_uptime()
229 settime.u.settime64.secs = ts->tv_sec; in xentimer_settime()
230 settime.u.settime64.nsecs = ts->tv_nsec; in xentimer_settime()
249 * uptime-since-hypervisor-start (in nsec.) They need to be combined
276 pcpu->last_processed = xen_fetch_vcpu_time(DPCPU_GET(vcpu_info)); in xentimer_intr()
277 if (pcpu->timer != 0 && sc->et.et_active) in xentimer_intr()
278 sc->et.et_event_cb(&sc->et, sc->et.et_arg); in xentimer_intr()
318 struct xentimer_softc *sc = et->et_priv; in xentimer_et_start()
327 KASSERT(td->td_critnest != 0, in xentimer_et_start()
338 device_get_nameunit(sc->dev), error, next_time); in xentimer_et_start()
340 pcpu->timer = next_time; in xentimer_et_start()
353 pcpu->timer = 0; in xentimer_et_stop()
371 sc->dev = dev; in xentimer_attach()
386 NULL, sc, INTR_TYPE_CLK, &pcpu->irq_handle); in xentimer_attach()
392 xen_intr_describe(pcpu->irq_handle, "c%d", i); in xentimer_attach()
396 sc->et.et_name = "XENTIMER"; in xentimer_attach()
397 sc->et.et_quality = XENTIMER_QUALITY; in xentimer_attach()
398 sc->et.et_flags = ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU; in xentimer_attach()
399 sc->et.et_frequency = NSEC_IN_SEC; in xentimer_attach()
401 sc->et.et_min_period = (XENTIMER_MIN_PERIOD_IN_NSEC * in xentimer_attach()
403 sc->et.et_max_period = ((sbintime_t)4 << 32); in xentimer_attach()
404 sc->et.et_start = xentimer_et_start; in xentimer_attach()
405 sc->et.et_stop = xentimer_et_stop; in xentimer_attach()
406 sc->et.et_priv = sc; in xentimer_attach()
407 et_register(&sc->et); in xentimer_attach()
410 sc->tc.tc_name = "XENTIMER"; in xentimer_attach()
411 sc->tc.tc_quality = XENTIMER_QUALITY; in xentimer_attach()
423 * sc->tc.tc_flags = TC_FLAGS_SUSPEND_SAFE; in xentimer_attach()
427 * scales TSC frequencies using a fraction that represents time in in xentimer_attach()
430 sc->tc.tc_frequency = NSEC_IN_SEC; in xentimer_attach()
431 sc->tc.tc_counter_mask = ~0u; in xentimer_attach()
432 sc->tc.tc_get_timecount = xentimer_get_timecount; in xentimer_attach()
433 sc->tc.tc_priv = sc; in xentimer_attach()
434 tc_init(&sc->tc); in xentimer_attach()
446 /* Implement Xen PV clock teardown - XXX see hpet_detach ? */ in xentimer_detach()
450 * 3. need to deregister virtual IRQ event channels in xentimer_detach()
461 xentimer_et_start(&sc->et, sc->et.et_min_period, 0); in xentimer_percpu_resume()
520 struct vcpu_info *vcpu = &HYPERVISOR_shared_info->vcpu_info[0]; in xen_delay()