ia64/xen-unstable

view xen/include/xen/time.h @ 15314:35e38c9048c8

Add suspend/resume to devices owned by Xen.

Signed-off-by: Ke Yu <ke.yu@intel.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Mon Jun 11 15:44:48 2007 +0100 (2007-06-11)
parents 71e2a165aa7f
children 2477e94450aa
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);
35 extern unsigned long cpu_khz;
37 struct domain;
39 /*
40 * System Time
41 * 64 bit value containing the nanoseconds elapsed since boot time.
42 * This value is adjusted by frequency drift.
43 * NOW() returns the current time.
44 * The other macros are for convenience to approximate short intervals
45 * of real time into system time
46 */
48 typedef s64 s_time_t;
50 s_time_t get_s_time(void);
51 unsigned long get_localtime(struct domain *d);
53 struct tm {
54 int tm_sec; /* seconds */
55 int tm_min; /* minutes */
56 int tm_hour; /* hours */
57 int tm_mday; /* day of the month */
58 int tm_mon; /* month */
59 int tm_year; /* year */
60 int tm_wday; /* day of the week */
61 int tm_yday; /* day in the year */
62 int tm_isdst; /* daylight saving time */
63 };
64 struct tm gmtime(unsigned long t);
66 #define NOW() ((s_time_t)get_s_time())
67 #define SECONDS(_s) ((s_time_t)((_s) * 1000000000ULL))
68 #define MILLISECS(_ms) ((s_time_t)((_ms) * 1000000ULL))
69 #define MICROSECS(_us) ((s_time_t)((_us) * 1000ULL))
71 extern void update_vcpu_system_time(struct vcpu *v);
72 extern void update_domain_wallclock_time(struct domain *d);
74 extern void do_settime(
75 unsigned long secs, unsigned long nsecs, u64 system_time_base);
77 extern void send_timer_event(struct vcpu *v);
79 #endif /* __XEN_TIME_H__ */
81 /*
82 * Local variables:
83 * mode: C
84 * c-set-style: "BSD"
85 * c-basic-offset: 4
86 * tab-width: 4
87 * indent-tabs-mode: nil
88 * End:
89 */