ia64/xen-unstable

annotate 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
rev   line source
keir@15948 1 /******************************************************************************
keir@15948 2 * time.h
kaf24@1210 3 *
keir@15948 4 * Copyright (c) 2002-2003 Rolf Neugebauer
keir@15948 5 * Copyright (c) 2002-2005 K A Fraser
kaf24@1210 6 */
kaf24@1210 7
kaf24@1211 8 #ifndef __XEN_TIME_H__
kaf24@1211 9 #define __XEN_TIME_H__
kaf24@1210 10
kaf24@1210 11 #include <xen/types.h>
kaf24@2789 12 #include <public/xen.h>
kaf24@3645 13 #include <asm/time.h>
kaf24@1210 14
kaf24@5828 15 extern int init_xen_time(void);
keir@17550 16 extern void cstate_restore_tsc(void);
kaf24@1210 17
kaf24@1488 18 extern unsigned long cpu_khz;
kaf24@1210 19
cl349@2922 20 struct domain;
cl349@2922 21
kaf24@1210 22 /*
kaf24@1210 23 * System Time
kaf24@1210 24 * 64 bit value containing the nanoseconds elapsed since boot time.
kaf24@1210 25 * This value is adjusted by frequency drift.
kaf24@1210 26 * NOW() returns the current time.
kaf24@1210 27 * The other macros are for convenience to approximate short intervals
kaf24@1210 28 * of real time into system time
kaf24@1210 29 */
kaf24@1210 30
kaf24@1488 31 typedef s64 s_time_t;
kaf24@1488 32
kaf24@1210 33 s_time_t get_s_time(void);
kfraser@11890 34 unsigned long get_localtime(struct domain *d);
kfraser@11890 35
kfraser@11890 36 struct tm {
kfraser@11890 37 int tm_sec; /* seconds */
kfraser@11890 38 int tm_min; /* minutes */
kfraser@11890 39 int tm_hour; /* hours */
kfraser@11890 40 int tm_mday; /* day of the month */
kfraser@11890 41 int tm_mon; /* month */
kfraser@11890 42 int tm_year; /* year */
kfraser@11890 43 int tm_wday; /* day of the week */
kfraser@11890 44 int tm_yday; /* day in the year */
kfraser@11890 45 int tm_isdst; /* daylight saving time */
kfraser@11890 46 };
kfraser@11890 47 struct tm gmtime(unsigned long t);
kaf24@1210 48
keir@17720 49 #define SYSTEM_TIME_HZ 1000000000ULL
kaf24@1486 50 #define NOW() ((s_time_t)get_s_time())
kaf24@5940 51 #define SECONDS(_s) ((s_time_t)((_s) * 1000000000ULL))
kaf24@5940 52 #define MILLISECS(_ms) ((s_time_t)((_ms) * 1000000ULL))
kaf24@5940 53 #define MICROSECS(_us) ((s_time_t)((_us) * 1000ULL))
keir@18752 54 #define STIME_MAX ((s_time_t)((uint64_t)~0ull>>1))
kaf24@1210 55
kaf24@9592 56 extern void update_vcpu_system_time(struct vcpu *v);
kaf24@9592 57 extern void update_domain_wallclock_time(struct domain *d);
kaf24@9592 58
kaf24@4294 59 extern void do_settime(
kaf24@6048 60 unsigned long secs, unsigned long nsecs, u64 system_time_base);
kaf24@1210 61
kaf24@9284 62 extern void send_timer_event(struct vcpu *v);
kaf24@9284 63
keir@17951 64 void domain_set_time_offset(struct domain *d, int32_t time_offset_seconds);
keir@17951 65
kaf24@1211 66 #endif /* __XEN_TIME_H__ */
kaf24@3914 67
kaf24@3914 68 /*
kaf24@3914 69 * Local variables:
kaf24@3914 70 * mode: C
kaf24@3914 71 * c-set-style: "BSD"
kaf24@3914 72 * c-basic-offset: 4
kaf24@3914 73 * tab-width: 4
kaf24@3914 74 * indent-tabs-mode: nil
kaf24@3988 75 * End:
kaf24@3914 76 */