ia64/xen-unstable

view xen/include/xen/time.h @ 19800:78962f85c562

IOMMU: Add two generic functions to vendor neutral interface

Add 2 generic functions into the vendor neutral iommu interface, The
reason is that from changeset 19732, there is only one global flag
"iommu_enabled" that controls iommu enablement for both vtd and amd
systems, so we need different code paths for vtd and amd iommu systems
if this flag has been turned on. Also, the early checking of
"iommu_enabled" in iommu_setup() is removed to prevent iommu
functionalities from been disabled on amd systems.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jun 19 08:41:50 2009 +0100 (2009-06-19)
parents eed39afde7dd
children
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);
16 extern void cstate_restore_tsc(void);
18 extern unsigned long cpu_khz;
20 struct domain;
22 /*
23 * System Time
24 * 64 bit value containing the nanoseconds elapsed since boot time.
25 * This value is adjusted by frequency drift.
26 * NOW() returns the current time.
27 * The other macros are for convenience to approximate short intervals
28 * of real time into system time
29 */
31 typedef s64 s_time_t;
33 s_time_t get_s_time(void);
34 unsigned long get_localtime(struct domain *d);
36 struct tm {
37 int tm_sec; /* seconds */
38 int tm_min; /* minutes */
39 int tm_hour; /* hours */
40 int tm_mday; /* day of the month */
41 int tm_mon; /* month */
42 int tm_year; /* year */
43 int tm_wday; /* day of the week */
44 int tm_yday; /* day in the year */
45 int tm_isdst; /* daylight saving time */
46 };
47 struct tm gmtime(unsigned long t);
49 #define SYSTEM_TIME_HZ 1000000000ULL
50 #define NOW() ((s_time_t)get_s_time())
51 #define SECONDS(_s) ((s_time_t)((_s) * 1000000000ULL))
52 #define MILLISECS(_ms) ((s_time_t)((_ms) * 1000000ULL))
53 #define MICROSECS(_us) ((s_time_t)((_us) * 1000ULL))
54 #define STIME_MAX ((s_time_t)((uint64_t)~0ull>>1))
56 extern void update_vcpu_system_time(struct vcpu *v);
57 extern void update_domain_wallclock_time(struct domain *d);
59 extern void do_settime(
60 unsigned long secs, unsigned long nsecs, u64 system_time_base);
62 extern void send_timer_event(struct vcpu *v);
64 void domain_set_time_offset(struct domain *d, int32_t time_offset_seconds);
66 #endif /* __XEN_TIME_H__ */
68 /*
69 * Local variables:
70 * mode: C
71 * c-set-style: "BSD"
72 * c-basic-offset: 4
73 * tab-width: 4
74 * indent-tabs-mode: nil
75 * End:
76 */