ia64/xen-unstable

view xen/include/xen/time.h @ 6552:a9873d384da4

Merge.
author adsharma@los-vmm.sc.intel.com
date Thu Aug 25 12:24:48 2005 -0700 (2005-08-25)
parents 112d44270733 fa0754a9f64f
children dfaf788ab18c
line source
1 /****************************************************************************
2 * (C) 2002 - Rolf Neugebauer - Intel Research Cambridge
3 ****************************************************************************
4 *
5 * File: time.h
6 * Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
7 * Changes:
8 *
9 * Date: Nov 2002
10 *
11 * Environment: Xen Hypervisor
12 * Description: This file provides a one stop shop for all time related
13 * issues within the hypervisor.
14 *
15 * The Hypervisor provides the following notions of time:
16 * Cycle Counter Time, System Time, Wall Clock Time, and
17 * Domain Virtual Time.
18 *
19 ****************************************************************************
20 * $Id: h-insert.h,v 1.4 2002/11/08 16:03:55 rn Exp $
21 ****************************************************************************
22 */
26 #ifndef __XEN_TIME_H__
27 #define __XEN_TIME_H__
29 #include <xen/types.h>
30 #include <public/xen.h>
31 #include <asm/time.h>
33 extern int init_xen_time(void);
34 extern void init_percpu_time(void);
36 extern unsigned long cpu_khz;
38 struct domain;
40 /*
41 * System Time
42 * 64 bit value containing the nanoseconds elapsed since boot time.
43 * This value is adjusted by frequency drift.
44 * NOW() returns the current time.
45 * The other macros are for convenience to approximate short intervals
46 * of real time into system time
47 */
49 typedef s64 s_time_t;
51 s_time_t get_s_time(void);
53 #define NOW() ((s_time_t)get_s_time())
54 #define SECONDS(_s) ((s_time_t)((_s) * 1000000000ULL))
55 #define MILLISECS(_ms) ((s_time_t)((_ms) * 1000000ULL))
56 #define MICROSECS(_us) ((s_time_t)((_us) * 1000ULL))
58 extern void update_dom_time(struct vcpu *v);
59 extern void do_settime(
60 unsigned long secs, unsigned long nsecs, u64 system_time_base);
62 #endif /* __XEN_TIME_H__ */
64 /*
65 * Local variables:
66 * mode: C
67 * c-set-style: "BSD"
68 * c-basic-offset: 4
69 * tab-width: 4
70 * indent-tabs-mode: nil
71 * End:
72 */