debuggers.hg

view xen/include/xen/time.h @ 3683:1c55bbe02576

bitkeeper revision 1.1159.212.84 (42033fc2Q0eAAtQcKyCf8cXCt_Fgfg)

Common-code cleanups, for ia64.
Signed-off-by: keir.fraser@cl.cam.ac.uk
author kaf24@scramble.cl.cam.ac.uk
date Fri Feb 04 09:26:26 2005 +0000 (2005-02-04)
parents ac42e731eebc
children bbe8541361dd
line source
1 /* -*- Mode:C; c-basic-offset:4; tab-width:4 -*-
2 ****************************************************************************
3 * (C) 2002 - Rolf Neugebauer - Intel Research Cambridge
4 ****************************************************************************
5 *
6 * File: time.h
7 * Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
8 * Changes:
9 *
10 * Date: Nov 2002
11 *
12 * Environment: Xen Hypervisor
13 * Description: This file provides a one stop shop for all time related
14 * issues within the hypervisor.
15 *
16 * The Hypervisor provides the following notions of time:
17 * Cycle Counter Time, System Time, Wall Clock Time, and
18 * Domain Virtual Time.
19 *
20 ****************************************************************************
21 * $Id: h-insert.h,v 1.4 2002/11/08 16:03:55 rn Exp $
22 ****************************************************************************
23 */
27 #ifndef __XEN_TIME_H__
28 #define __XEN_TIME_H__
30 #include <xen/types.h>
31 #include <public/xen.h>
32 #include <asm/time.h>
34 extern int init_xen_time();
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 domain *d);
59 extern void do_settime(unsigned long secs, unsigned long usecs,
60 u64 system_time_base);
62 #endif /* __XEN_TIME_H__ */