ia64/xen-unstable

view extras/mini-os/h/time.h @ 4146:f2d61710e4d9

bitkeeper revision 1.1236.25.24 (42366e9aQ71LQ8uCB-Y1IwVNqx5eqA)

Merge djm@kirby.fc.hp.com://home/djm/src/xen/xeno-unstable-ia64.bk
into sportsman.spdomain:/home/djm/xeno-unstable-ia64.bk
author djm@sportsman.spdomain
date Tue Mar 15 05:11:54 2005 +0000 (2005-03-15)
parents 71f9c171157e
children
line source
1 /* -*- Mode:C; c-basic-offset:4; tab-width:4 -*-
2 ****************************************************************************
3 * (C) 2003 - 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: Jul 2003
11 *
12 * Environment: Xen Minimal OS
13 * Description: Time and timer functions
14 *
15 ****************************************************************************
16 * $Id: h-insert.h,v 1.4 2002/11/08 16:03:55 rn Exp $
17 ****************************************************************************
18 */
20 #ifndef _TIME_H_
21 #define _TIME_H_
23 /*
24 * System Time
25 * 64 bit value containing the nanoseconds elapsed since boot time.
26 * This value is adjusted by frequency drift.
27 * NOW() returns the current time.
28 * The other macros are for convenience to approximate short intervals
29 * of real time into system time
30 */
31 typedef s64 s_time_t;
32 #define NOW() ((s_time_t)get_s_time())
33 #define SECONDS(_s) (((s_time_t)(_s)) * 1000000000UL )
34 #define TENTHS(_ts) (((s_time_t)(_ts)) * 100000000UL )
35 #define HUNDREDTHS(_hs) (((s_time_t)(_hs)) * 10000000UL )
36 #define MILLISECS(_ms) (((s_time_t)(_ms)) * 1000000UL )
37 #define MICROSECS(_us) (((s_time_t)(_us)) * 1000UL )
38 #define Time_Max ((s_time_t) 0x7fffffffffffffffLL)
39 #define FOREVER Time_Max
42 /* wall clock time */
43 typedef long time_t;
44 typedef long suseconds_t;
45 struct timeval {
46 time_t tv_sec; /* seconds */
47 suseconds_t tv_usec; /* microseconds */
48 };
51 /* prototypes */
52 void init_time(void);
53 s_time_t get_s_time(void);
54 s_time_t get_v_time(void);
55 void gettimeofday(struct timeval *tv);
57 #endif /* _TIME_H_ */