ia64/xen-unstable

annotate xen/include/xen/time.h @ 1211:a235ded07b12

bitkeeper revision 1.822 (40600a0a9K2f7dR0Ky2OCGfBDHTTmQ)

Many files:
xeno -> xen renames.
author kaf24@scramble.cl.cam.ac.uk
date Tue Mar 23 09:57:30 2004 +0000 (2004-03-23)
parents 9f85adafc1e1
children 55825bcb964e
rev   line source
kaf24@1210 1 /* -*- Mode:C; c-basic-offset:4; tab-width:4 -*-
kaf24@1210 2 ****************************************************************************
kaf24@1210 3 * (C) 2002 - Rolf Neugebauer - Intel Research Cambridge
kaf24@1210 4 ****************************************************************************
kaf24@1210 5 *
kaf24@1210 6 * File: time.h
kaf24@1210 7 * Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
kaf24@1210 8 * Changes:
kaf24@1210 9 *
kaf24@1210 10 * Date: Nov 2002
kaf24@1210 11 *
kaf24@1210 12 * Environment: Xen Hypervisor
kaf24@1210 13 * Description: This file provides a one stop shop for all time related
kaf24@1210 14 * issues within the hypervisor.
kaf24@1210 15 *
kaf24@1210 16 * The Hypervisor provides the following notions of time:
kaf24@1210 17 * Cycle Counter Time, System Time, Wall Clock Time, and
kaf24@1210 18 * Domain Virtual Time.
kaf24@1210 19 *
kaf24@1210 20 ****************************************************************************
kaf24@1210 21 * $Id: h-insert.h,v 1.4 2002/11/08 16:03:55 rn Exp $
kaf24@1210 22 ****************************************************************************
kaf24@1210 23 */
kaf24@1210 24
kaf24@1210 25
kaf24@1210 26
kaf24@1211 27 #ifndef __XEN_TIME_H__
kaf24@1211 28 #define __XEN_TIME_H__
kaf24@1210 29
kaf24@1210 30 #include <asm/ptrace.h> /* XXX Only used for do_timer which should be moved */
kaf24@1210 31 #include <asm/time.h> /* pull in architecture specific time definition */
kaf24@1210 32 #include <xen/types.h>
kaf24@1210 33 #include <hypervisor-ifs/hypervisor-if.h>
kaf24@1210 34
kaf24@1210 35 /*
kaf24@1210 36 * Init time
kaf24@1210 37 */
kaf24@1210 38 extern int init_xen_time();
kaf24@1210 39
kaf24@1210 40
kaf24@1210 41 /*
kaf24@1210 42 * System Time
kaf24@1210 43 * 64 bit value containing the nanoseconds elapsed since boot time.
kaf24@1210 44 * This value is adjusted by frequency drift.
kaf24@1210 45 * NOW() returns the current time.
kaf24@1210 46 * The other macros are for convenience to approximate short intervals
kaf24@1210 47 * of real time into system time
kaf24@1210 48 */
kaf24@1210 49
kaf24@1210 50 s_time_t get_s_time(void);
kaf24@1210 51
kaf24@1210 52 #define NOW() ((s_time_t)get_s_time())
kaf24@1210 53 #define SECONDS(_s) (((s_time_t)(_s)) * 1000000000ULL )
kaf24@1210 54 #define MILLISECS(_ms) (((s_time_t)(_ms)) * 1000000ULL )
kaf24@1210 55 #define MICROSECS(_us) (((s_time_t)(_us)) * 1000ULL )
kaf24@1210 56 #define Time_Max ((s_time_t) 0x7fffffffffffffffLL)
kaf24@1210 57 #define FOREVER Time_Max
kaf24@1210 58
kaf24@1210 59 /* Wall Clock Time */
kaf24@1210 60 struct timeval {
kaf24@1210 61 long tv_sec; /* seconds */
kaf24@1210 62 long tv_usec; /* microseconds */
kaf24@1210 63 };
kaf24@1210 64
kaf24@1210 65 extern void update_dom_time(shared_info_t *si);
kaf24@1210 66 extern void do_settime(unsigned long secs, unsigned long usecs,
kaf24@1210 67 u64 system_time_base);
kaf24@1210 68 extern void do_timer(struct pt_regs *regs);
kaf24@1210 69
kaf24@1211 70 #endif /* __XEN_TIME_H__ */