ia64/xen-unstable

view tools/libxc/xc_fbvtsched.c @ 2422:2274a0386cc9

bitkeeper revision 1.1159.69.5 (4138e882jA1YaR_OfTfNHe_uT4PDIg)

trivial
author iap10@labyrinth.cl.cam.ac.uk
date Fri Sep 03 21:56:18 2004 +0000 (2004-09-03)
parents 083178f6cdfa
children
line source
1 /******************************************************************************
2 * xc_fbvtsched.c
3 *
4 * API for manipulating parameters of the Fair Borrowed Virtual Time scheduler.
5 *
6 * Copyright (c) 2004, G. Milos
7 * Based on K. Fraiser's xc_bvtsched.c
8 */
10 #include "xc_private.h"
12 int xc_fbvtsched_global_set(int xc_handle,
13 unsigned long ctx_allow)
14 {
15 dom0_op_t op;
17 op.cmd = DOM0_SCHEDCTL;
18 op.u.schedctl.sched_id = SCHED_FBVT;
19 op.u.schedctl.direction = SCHED_INFO_PUT;
20 op.u.schedctl.u.fbvt.ctx_allow = ctx_allow;
22 return do_dom0_op(xc_handle, &op);
23 }
25 int xc_fbvtsched_global_get(int xc_handle,
26 unsigned long *ctx_allow)
27 {
28 dom0_op_t op;
29 int ret;
31 op.cmd = DOM0_SCHEDCTL;
32 op.u.schedctl.sched_id = SCHED_FBVT;
33 op.u.schedctl.direction = SCHED_INFO_GET;
35 ret = do_dom0_op(xc_handle, &op);
37 *ctx_allow = op.u.schedctl.u.fbvt.ctx_allow;
39 return ret;
40 }
42 int xc_fbvtsched_domain_set(int xc_handle,
43 u32 domid,
44 unsigned long mcuadv,
45 unsigned long warp,
46 unsigned long warpl,
47 unsigned long warpu)
48 {
49 dom0_op_t op;
50 struct fbvt_adjdom *fbvtadj = &op.u.adjustdom.u.fbvt;
52 op.cmd = DOM0_ADJUSTDOM;
53 op.u.adjustdom.domain = (domid_t)domid;
54 op.u.adjustdom.sched_id = SCHED_FBVT;
55 op.u.adjustdom.direction = SCHED_INFO_PUT;
57 fbvtadj->mcu_adv = mcuadv;
58 fbvtadj->warp = warp;
59 fbvtadj->warpl = warpl;
60 fbvtadj->warpu = warpu;
61 return do_dom0_op(xc_handle, &op);
62 }
65 int xc_fbvtsched_domain_get(int xc_handle,
66 u32 domid,
67 unsigned long *mcuadv,
68 unsigned long *warp,
69 unsigned long *warpl,
70 unsigned long *warpu)
71 {
73 dom0_op_t op;
74 int ret;
75 struct fbvt_adjdom *adjptr = &op.u.adjustdom.u.fbvt;
77 op.cmd = DOM0_ADJUSTDOM;
78 op.u.adjustdom.domain = (domid_t)domid;
79 op.u.adjustdom.sched_id = SCHED_FBVT;
80 op.u.adjustdom.direction = SCHED_INFO_GET;
82 ret = do_dom0_op(xc_handle, &op);
84 *mcuadv = adjptr->mcu_adv;
85 *warp = adjptr->warp;
86 *warpl = adjptr->warpl;
87 *warpu = adjptr->warpu;
88 return ret;
89 }