ia64/xen-unstable

view tools/libxc/xc_bvtsched.c @ 1820:3d4f8eb89670

bitkeeper revision 1.1106.1.2 (40faa780dekT3E5arFwcbQDu1MbX6g)

Cleaned up Xen's instruction emulator.
author kaf24@scramble.cl.cam.ac.uk
date Sun Jul 18 16:38:24 2004 +0000 (2004-07-18)
parents 236a9f2698a3
children 1ac7603a60bd
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 dom0_op_t 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 dom0_op_t 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 u32 domid,
43 unsigned long mcuadv,
44 unsigned long warp,
45 unsigned long warpl,
46 unsigned long warpu)
47 {
48 dom0_op_t op;
49 struct bvt_adjdom *bvtadj = &op.u.adjustdom.u.bvt;
51 op.cmd = DOM0_ADJUSTDOM;
52 op.u.adjustdom.domain = (domid_t)domid;
53 op.u.adjustdom.sched_id = SCHED_BVT;
54 op.u.adjustdom.direction = SCHED_INFO_PUT;
56 bvtadj->mcu_adv = mcuadv;
57 bvtadj->warp = warp;
58 bvtadj->warpl = warpl;
59 bvtadj->warpu = warpu;
60 return do_dom0_op(xc_handle, &op);
61 }
64 int xc_bvtsched_domain_get(int xc_handle,
65 u32 domid,
66 unsigned long *mcuadv,
67 unsigned long *warp,
68 unsigned long *warpl,
69 unsigned long *warpu)
70 {
72 dom0_op_t op;
73 int ret;
74 struct bvt_adjdom *adjptr = &op.u.adjustdom.u.bvt;
76 op.cmd = DOM0_ADJUSTDOM;
77 op.u.adjustdom.domain = (domid_t)domid;
78 op.u.adjustdom.sched_id = SCHED_BVT;
79 op.u.adjustdom.direction = SCHED_INFO_GET;
81 ret = do_dom0_op(xc_handle, &op);
83 *mcuadv = adjptr->mcu_adv;
84 *warp = adjptr->warp;
85 *warpl = adjptr->warpl;
86 *warpu = adjptr->warpu;
87 return ret;
88 }