ia64/xen-unstable

view tools/libxc/xc_bvtsched.c @ 8964:8946b6dcd49e

Fix x86_64 Xen build.

event_callback_cs and failsafe_callback_cs are x86_32 only.

Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
author Ian.Campbell@xensource.com
date Wed Feb 22 17:26:39 2006 +0000 (2006-02-22)
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 }