direct-io.hg

view tools/libxc/xc_csched.c @ 12988:e080700efa56

[TOOLS] Fix the build. Clearly demarcate PPC-specific stuff.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Wed Dec 13 10:23:53 2006 +0000 (2006-12-13)
parents 86d26e6ec89b
children
line source
1 /****************************************************************************
2 * (C) 2006 - Emmanuel Ackaouy - XenSource Inc.
3 ****************************************************************************
4 *
5 * File: xc_csched.c
6 * Author: Emmanuel Ackaouy
7 *
8 * Description: XC Interface to the credit scheduler
9 *
10 */
11 #include "xc_private.h"
14 int
15 xc_sched_credit_domain_set(
16 int xc_handle,
17 uint32_t domid,
18 struct xen_domctl_sched_credit *sdom)
19 {
20 DECLARE_DOMCTL;
22 domctl.cmd = XEN_DOMCTL_scheduler_op;
23 domctl.domain = (domid_t) domid;
24 domctl.u.scheduler_op.sched_id = XEN_SCHEDULER_CREDIT;
25 domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_putinfo;
26 domctl.u.scheduler_op.u.credit = *sdom;
28 return do_domctl(xc_handle, &domctl);
29 }
31 int
32 xc_sched_credit_domain_get(
33 int xc_handle,
34 uint32_t domid,
35 struct xen_domctl_sched_credit *sdom)
36 {
37 DECLARE_DOMCTL;
38 int err;
40 domctl.cmd = XEN_DOMCTL_scheduler_op;
41 domctl.domain = (domid_t) domid;
42 domctl.u.scheduler_op.sched_id = XEN_SCHEDULER_CREDIT;
43 domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_getinfo;
45 err = do_domctl(xc_handle, &domctl);
46 if ( err == 0 )
47 *sdom = domctl.u.scheduler_op.u.credit;
49 return err;
50 }