ia64/xen-unstable

view tools/libxc/xc_bvtsched.c @ 6946:e703abaf6e3d

Add behaviour to the remove methods to remove the transaction's path itself. This allows us to write Remove(path) to remove the specified path rather than having to slice the path ourselves.
author emellor@ewan
date Sun Sep 18 14:42:13 2005 +0100 (2005-09-18)
parents 1ac7603a60bd
children b3a255e88810
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 u32 mcuadv,
44 int warpback,
45 s32 warpvalue,
46 long long warpl,
47 long long warpu)
48 {
49 dom0_op_t 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 u32 domid,
68 u32 *mcuadv,
69 int *warpback,
70 s32 *warpvalue,
71 long long *warpl,
72 long long *warpu)
73 {
75 dom0_op_t 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 }