ia64/xen-unstable

view xen/include/asm-ia64/vtm.h @ 5704:9b73afea874e

Certain types of event channel are now auto-bound to vcpu0 by Xen.
Make sure that xenolinux agrees with this.
author sos22@douglas.cl.cam.ac.uk
date Fri Jul 08 15:35:43 2005 +0000 (2005-07-08)
parents 6ce01dc5f62f
children c055d76ec559
line source
2 /* -*- Mode:C; c-basic-offset:4; tab-width:4; indent-tabs-mode:nil -*- */
3 /*
4 * vtm.h: virtual timer head file.
5 * Copyright (c) 2004, Intel Corporation.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms and conditions of the GNU General Public License,
9 * version 2, as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18 * Place - Suite 330, Boston, MA 02111-1307 USA.
19 *
20 * Yaozu Dong (Eddie Dong) (Eddie.dong@intel.com)
21 */
23 #ifndef _VTM_H_
24 #define _VTM_H_
26 #include <xen/ac_timer.h>
27 #include <xen/types.h>
29 #define MAX_JUMP_STEP (5000) /* 500ms, max jump step */
30 #define MIN_GUEST_RUNNING_TIME (0) /* 10ms for guest os to run */
31 #define ITV_VECTOR_MASK (0xff)
33 typedef struct vtime {
34 long vtm_offset; // guest ITC = host ITC + vtm_offset
35 uint64_t vtm_local_drift;
36 uint64_t last_itc;
37 /*
38 * Local drift (temporary) after guest suspension
39 * In case of long jump amount of ITC after suspension,
40 * guest ITC = host ITC + vtm_offset - vtm_local_drift;
41 * so that the duration passed saw in guest ITC is limited to
42 * cfg_max_jump that will make all kind of device driver happy.
43 */
45 // next all uses ITC tick as unit
46 uint64_t cfg_max_jump; // max jump within one time suspendsion
47 uint64_t cfg_min_grun; // min guest running time since last jump
48 // uint64_t latest_read_itc; // latest guest read ITC
49 struct ac_timer vtm_timer;
50 // int triggered;
53 uint64_t guest_running_time; // guest running time since last switch
54 //uint64_t vtm_last_suspending_time;
55 //uint64_t switch_in_time;
56 //uint64_t switch_out_time;
57 //uint64_t itc_freq;
59 } vtime_t;
61 #define ITV_VECTOR(itv) (itv&0xff)
62 #define ITV_IRQ_MASK(itv) (itv&(1<<16))
64 #define VTM_FIRED(vtm) ((vtm)->triggered)
66 extern void vtm_init();
67 #endif /* _STATS_H_ */