ia64/xen-unstable

annotate xen/include/xen/time.h @ 9284:5618b13ac97f

Unlike x86 and apparently ia64, PowerPC delivers timer interrupts as a
different exception than device interrupts. For PowerPC Xen, we emulate this
exception rather than delivering timer events as virtual IRQs. This patch
introduces no functional changes for x86 and ia64, but is a required change
for xen/arch/ppc.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Mar 15 11:06:45 2006 +0100 (2006-03-15)
parents 06d84bf87159
children 08aede767c63
rev   line source
kaf24@3914 1 /****************************************************************************
kaf24@1210 2 * (C) 2002 - Rolf Neugebauer - Intel Research Cambridge
kaf24@1210 3 ****************************************************************************
kaf24@1210 4 *
kaf24@1210 5 * File: time.h
kaf24@1210 6 * Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
kaf24@1210 7 * Changes:
kaf24@1210 8 *
kaf24@1210 9 * Date: Nov 2002
kaf24@1210 10 *
kaf24@1210 11 * Environment: Xen Hypervisor
kaf24@1210 12 * Description: This file provides a one stop shop for all time related
kaf24@1210 13 * issues within the hypervisor.
kaf24@1210 14 *
kaf24@1210 15 * The Hypervisor provides the following notions of time:
kaf24@1210 16 * Cycle Counter Time, System Time, Wall Clock Time, and
kaf24@1210 17 * Domain Virtual Time.
kaf24@1210 18 *
kaf24@1210 19 ****************************************************************************
kaf24@1210 20 * $Id: h-insert.h,v 1.4 2002/11/08 16:03:55 rn Exp $
kaf24@1210 21 ****************************************************************************
kaf24@1210 22 */
kaf24@1210 23
kaf24@1210 24
kaf24@1210 25
kaf24@1211 26 #ifndef __XEN_TIME_H__
kaf24@1211 27 #define __XEN_TIME_H__
kaf24@1210 28
kaf24@1210 29 #include <xen/types.h>
kaf24@2789 30 #include <public/xen.h>
kaf24@3645 31 #include <asm/time.h>
kaf24@1210 32
kaf24@5828 33 extern int init_xen_time(void);
kaf24@5828 34 extern void init_percpu_time(void);
kaf24@1210 35
kaf24@1488 36 extern unsigned long cpu_khz;
kaf24@1210 37
cl349@2922 38 struct domain;
cl349@2922 39
kaf24@1210 40 /*
kaf24@1210 41 * System Time
kaf24@1210 42 * 64 bit value containing the nanoseconds elapsed since boot time.
kaf24@1210 43 * This value is adjusted by frequency drift.
kaf24@1210 44 * NOW() returns the current time.
kaf24@1210 45 * The other macros are for convenience to approximate short intervals
kaf24@1210 46 * of real time into system time
kaf24@1210 47 */
kaf24@1210 48
kaf24@1488 49 typedef s64 s_time_t;
kaf24@1488 50
kaf24@1210 51 s_time_t get_s_time(void);
kaf24@1210 52
kaf24@1486 53 #define NOW() ((s_time_t)get_s_time())
kaf24@5940 54 #define SECONDS(_s) ((s_time_t)((_s) * 1000000000ULL))
kaf24@5940 55 #define MILLISECS(_ms) ((s_time_t)((_ms) * 1000000ULL))
kaf24@5940 56 #define MICROSECS(_us) ((s_time_t)((_us) * 1000ULL))
kaf24@1210 57
kaf24@5289 58 extern void update_dom_time(struct vcpu *v);
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
kaf24@1211 64 #endif /* __XEN_TIME_H__ */
kaf24@3914 65
kaf24@3914 66 /*
kaf24@3914 67 * Local variables:
kaf24@3914 68 * mode: C
kaf24@3914 69 * c-set-style: "BSD"
kaf24@3914 70 * c-basic-offset: 4
kaf24@3914 71 * tab-width: 4
kaf24@3914 72 * indent-tabs-mode: nil
kaf24@3988 73 * End:
kaf24@3914 74 */