ia64/xen-unstable

view tools/libxc/xc_atropos.c @ 1624:236a9f2698a3

bitkeeper revision 1.1029 (40e1c6ce1NufVIrsLOg06kNbotFFZA)

Merge ssh://xenbk@gandalf.hpl.hp.com//var/bk/xeno-unstable.bk
into scramble.cl.cam.ac.uk:/local/scratch/kaf24/hp.bk
author kaf24@scramble.cl.cam.ac.uk
date Tue Jun 29 19:45:18 2004 +0000 (2004-06-29)
parents 7a572a6fa64d
children
line source
1 /******************************************************************************
2 * xc_atropos.c
3 *
4 * API for manipulating parameters of the Atropos scheduler.
5 *
6 * by Mark Williamson, Copyright (c) 2004 Intel Research Cambridge.
7 */
9 #include "xc_private.h"
11 int xc_atropos_domain_set(int xc_handle,
12 u32 domid, u64 period, u64 slice, u64 latency,
13 int xtratime)
14 {
15 dom0_op_t op;
16 struct atropos_adjdom *p = &op.u.adjustdom.u.atropos;
18 op.cmd = DOM0_ADJUSTDOM;
19 op.u.adjustdom.domain = (domid_t)domid;
20 op.u.adjustdom.sched_id = SCHED_ATROPOS;
21 op.u.adjustdom.direction = SCHED_INFO_PUT;
23 p->nat_period = period;
24 p->nat_slice = slice;
25 p->latency = latency;
26 p->xtratime = xtratime;
28 return do_dom0_op(xc_handle, &op);
29 }
31 int xc_atropos_domain_get(int xc_handle, u32 domid, u64 *period,
32 u64 *slice, u64 *latency, int *xtratime)
33 {
34 dom0_op_t op;
35 int ret;
36 struct atropos_adjdom *p = &op.u.adjustdom.u.atropos;
38 op.cmd = DOM0_ADJUSTDOM;
39 op.u.adjustdom.domain = (domid_t)domid;
40 op.u.adjustdom.sched_id = SCHED_ATROPOS;
41 op.u.adjustdom.direction = SCHED_INFO_GET;
43 ret = do_dom0_op(xc_handle, &op);
45 *period = p->nat_period;
46 *slice = p->nat_slice;
47 *latency = p->latency;
48 *xtratime = p->xtratime;
50 return ret;
51 }