direct-io.hg

view tools/libxc/xc_sedf.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 * xc_sedf.c
3 *
4 * API for manipulating parameters of the Simple EDF scheduler.
5 *
6 * changes by Stephan Diestelhorst
7 * based on code
8 * by Mark Williamson, Copyright (c) 2004 Intel Research Cambridge.
9 */
11 #include "xc_private.h"
13 int xc_sedf_domain_set(
14 int xc_handle,
15 uint32_t domid,
16 uint64_t period,
17 uint64_t slice,
18 uint64_t latency,
19 uint16_t extratime,
20 uint16_t weight)
21 {
22 DECLARE_DOMCTL;
23 struct xen_domctl_sched_sedf *p = &domctl.u.scheduler_op.u.sedf;
25 domctl.cmd = XEN_DOMCTL_scheduler_op;
26 domctl.domain = (domid_t)domid;
27 domctl.u.scheduler_op.sched_id = XEN_SCHEDULER_SEDF;
28 domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_putinfo;
30 p->period = period;
31 p->slice = slice;
32 p->latency = latency;
33 p->extratime = extratime;
34 p->weight = weight;
35 return do_domctl(xc_handle, &domctl);
36 }
38 int xc_sedf_domain_get(
39 int xc_handle,
40 uint32_t domid,
41 uint64_t *period,
42 uint64_t *slice,
43 uint64_t *latency,
44 uint16_t *extratime,
45 uint16_t *weight)
46 {
47 DECLARE_DOMCTL;
48 int ret;
49 struct xen_domctl_sched_sedf *p = &domctl.u.scheduler_op.u.sedf;
51 domctl.cmd = XEN_DOMCTL_scheduler_op;
52 domctl.domain = (domid_t)domid;
53 domctl.u.scheduler_op.sched_id = XEN_SCHEDULER_SEDF;
54 domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_getinfo;
56 ret = do_domctl(xc_handle, &domctl);
58 *period = p->period;
59 *slice = p->slice;
60 *latency = p->latency;
61 *extratime = p->extratime;
62 *weight = p->weight;
63 return ret;
64 }