ia64/xen-unstable

view xen/include/xen/time.h @ 15948:2477e94450aa

cpufreq: Support cpufreq updates on AMD hardware by dom0 kernel.
Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Thu Sep 20 14:15:45 2007 +0100 (2007-09-20)
parents 35e38c9048c8
children becd9b77f951
line source
1 /******************************************************************************
2 * time.h
3 *
4 * Copyright (c) 2002-2003 Rolf Neugebauer
5 * Copyright (c) 2002-2005 K A Fraser
6 */
8 #ifndef __XEN_TIME_H__
9 #define __XEN_TIME_H__
11 #include <xen/types.h>
12 #include <public/xen.h>
13 #include <asm/time.h>
15 extern int init_xen_time(void);
17 extern unsigned long cpu_khz;
19 struct domain;
21 /*
22 * System Time
23 * 64 bit value containing the nanoseconds elapsed since boot time.
24 * This value is adjusted by frequency drift.
25 * NOW() returns the current time.
26 * The other macros are for convenience to approximate short intervals
27 * of real time into system time
28 */
30 typedef s64 s_time_t;
32 s_time_t get_s_time(void);
33 unsigned long get_localtime(struct domain *d);
35 struct tm {
36 int tm_sec; /* seconds */
37 int tm_min; /* minutes */
38 int tm_hour; /* hours */
39 int tm_mday; /* day of the month */
40 int tm_mon; /* month */
41 int tm_year; /* year */
42 int tm_wday; /* day of the week */
43 int tm_yday; /* day in the year */
44 int tm_isdst; /* daylight saving time */
45 };
46 struct tm gmtime(unsigned long t);
48 #define NOW() ((s_time_t)get_s_time())
49 #define SECONDS(_s) ((s_time_t)((_s) * 1000000000ULL))
50 #define MILLISECS(_ms) ((s_time_t)((_ms) * 1000000ULL))
51 #define MICROSECS(_us) ((s_time_t)((_us) * 1000ULL))
53 extern void update_vcpu_system_time(struct vcpu *v);
54 extern void update_domain_wallclock_time(struct domain *d);
56 extern void do_settime(
57 unsigned long secs, unsigned long nsecs, u64 system_time_base);
59 extern void send_timer_event(struct vcpu *v);
61 #endif /* __XEN_TIME_H__ */
63 /*
64 * Local variables:
65 * mode: C
66 * c-set-style: "BSD"
67 * c-basic-offset: 4
68 * tab-width: 4
69 * indent-tabs-mode: nil
70 * End:
71 */