ia64/xen-unstable

view extras/mini-os/include/time.h @ 19836:d9890e67d2b7

tools: add SHAREDIR to buildmakevars2file

c/s 19818 dropped SHAREDIR from xen/util/path.py, which broke the "xm
new" command. This patch adds SHAREDIR back to the new
buildmakevars2file-closure function.

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 25 13:05:10 2009 +0100 (2009-06-25)
parents 707e10c9a487
children
line source
1 /* -*- Mode:C; c-basic-offset:4; tab-width:4 -*-
2 ****************************************************************************
3 * (C) 2003 - Rolf Neugebauer - Intel Research Cambridge
4 * (C) 2005 - Grzegorz Milos - Intel Research Cambridge
5 ****************************************************************************
6 *
7 * File: time.h
8 * Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
9 * Changes: Grzegorz Milos (gm281@cam.ac.uk)
10 * Robert Kaiser (kaiser@informatik.fh-wiesbaden.de)
11 *
12 * Date: Jul 2003, changes: Jun 2005, Sep 2006
13 *
14 * Environment: Xen Minimal OS
15 * Description: Time and timer functions
16 *
17 ****************************************************************************
18 */
20 #ifndef _MINIOS_TIME_H_
21 #define _MINIOS_TIME_H_
22 #include <mini-os/types.h>
24 /*
25 * System Time
26 * 64 bit value containing the nanoseconds elapsed since boot time.
27 * This value is adjusted by frequency drift.
28 * NOW() returns the current time.
29 * The other macros are for convenience to approximate short intervals
30 * of real time into system time
31 */
32 typedef s64 s_time_t;
33 #define NOW() ((s_time_t)monotonic_clock())
34 #define SECONDS(_s) (((s_time_t)(_s)) * 1000000000UL )
35 #define TENTHS(_ts) (((s_time_t)(_ts)) * 100000000UL )
36 #define HUNDREDTHS(_hs) (((s_time_t)(_hs)) * 10000000UL )
37 #define MILLISECS(_ms) (((s_time_t)(_ms)) * 1000000UL )
38 #define MICROSECS(_us) (((s_time_t)(_us)) * 1000UL )
39 #define Time_Max ((s_time_t) 0x7fffffffffffffffLL)
40 #define FOREVER Time_Max
41 #define NSEC_TO_USEC(_nsec) ((_nsec) / 1000UL)
42 #define NSEC_TO_MSEC(_nsec) ((_nsec) / 1000000ULL)
43 #define NSEC_TO_SEC(_nsec) ((_nsec) / 1000000000ULL)
45 /* wall clock time */
46 typedef long time_t;
47 typedef long suseconds_t;
49 #include <sys/time.h>
51 #ifdef HAVE_LIBC
52 #include_next <time.h>
53 #endif
55 /* prototypes */
56 void init_time(void);
57 void fini_time(void);
58 s_time_t get_s_time(void);
59 s_time_t get_v_time(void);
60 u64 monotonic_clock(void);
61 void block_domain(s_time_t until);
63 #endif /* _MINIOS_TIME_H_ */