ia64/xen-unstable

view tools/libxc/xc_bvtsched.c @ 9488:0a6f5527ca4b

[IA64] set itv handoff as masked and enable reading irr[0-3]

Set initial vcpu itv handoff state to mask the timer vector.
This seems to match hardware and makes logical sense from a
spurious interrupt perspective. Enable vcpu_get_irr[0-3]
functions as they seem to work and have the proper backing.
This enables the check_sal_cache_flush() in arch/ia64/kernel.sal.c
to work unmodified, allowing us to remove the Xen changes from
the file (and thus the file from the sparse tree).

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author awilliam@xenbuild.aw
date Tue Apr 04 09:39:45 2006 -0600 (2006-04-04)
parents 602aefe7bd48
children 74ee53209cca
line source
1 /******************************************************************************
2 * xc_bvtsched.c
3 *
4 * API for manipulating parameters of the Borrowed Virtual Time scheduler.
5 *
6 * Copyright (c) 2003, K A Fraser.
7 */
9 #include "xc_private.h"
11 int xc_bvtsched_global_set(int xc_handle,
12 unsigned long ctx_allow)
13 {
14 DECLARE_DOM0_OP;
16 op.cmd = DOM0_SCHEDCTL;
17 op.u.schedctl.sched_id = SCHED_BVT;
18 op.u.schedctl.direction = SCHED_INFO_PUT;
19 op.u.schedctl.u.bvt.ctx_allow = ctx_allow;
21 return do_dom0_op(xc_handle, &op);
22 }
24 int xc_bvtsched_global_get(int xc_handle,
25 unsigned long *ctx_allow)
26 {
27 DECLARE_DOM0_OP;
28 int ret;
30 op.cmd = DOM0_SCHEDCTL;
31 op.u.schedctl.sched_id = SCHED_BVT;
32 op.u.schedctl.direction = SCHED_INFO_GET;
34 ret = do_dom0_op(xc_handle, &op);
36 *ctx_allow = op.u.schedctl.u.bvt.ctx_allow;
38 return ret;
39 }
41 int xc_bvtsched_domain_set(int xc_handle,
42 uint32_t domid,
43 uint32_t mcuadv,
44 int warpback,
45 int32_t warpvalue,
46 long long warpl,
47 long long warpu)
48 {
49 DECLARE_DOM0_OP;
50 struct bvt_adjdom *bvtadj = &op.u.adjustdom.u.bvt;
52 op.cmd = DOM0_ADJUSTDOM;
53 op.u.adjustdom.domain = (domid_t)domid;
54 op.u.adjustdom.sched_id = SCHED_BVT;
55 op.u.adjustdom.direction = SCHED_INFO_PUT;
57 bvtadj->mcu_adv = mcuadv;
58 bvtadj->warpback = warpback;
59 bvtadj->warpvalue = warpvalue;
60 bvtadj->warpl = warpl;
61 bvtadj->warpu = warpu;
62 return do_dom0_op(xc_handle, &op);
63 }
66 int xc_bvtsched_domain_get(int xc_handle,
67 uint32_t domid,
68 uint32_t *mcuadv,
69 int *warpback,
70 int32_t *warpvalue,
71 long long *warpl,
72 long long *warpu)
73 {
75 DECLARE_DOM0_OP;
76 int ret;
77 struct bvt_adjdom *adjptr = &op.u.adjustdom.u.bvt;
79 op.cmd = DOM0_ADJUSTDOM;
80 op.u.adjustdom.domain = (domid_t)domid;
81 op.u.adjustdom.sched_id = SCHED_BVT;
82 op.u.adjustdom.direction = SCHED_INFO_GET;
84 ret = do_dom0_op(xc_handle, &op);
86 *mcuadv = adjptr->mcu_adv;
87 *warpback = adjptr->warpback;
88 *warpvalue = adjptr->warpvalue;
89 *warpl = adjptr->warpl;
90 *warpu = adjptr->warpu;
91 return ret;
92 }