direct-io.hg

view tools/libxc/xc_csched.c @ 15534:da4c76340184

NativeDom 1:1 support for x86_64, 32bitbios reloc bug fix
author Guy Zana <guy@neocleus.com>
date Wed Sep 19 10:51:46 2007 +0200 (2007-09-19)
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 }