aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_sedf.c
diff options
context:
space:
mode:
authorsd386@font.cl.cam.ac.uk <sd386@font.cl.cam.ac.uk>2005-01-17 13:38:54 +0000
committersd386@font.cl.cam.ac.uk <sd386@font.cl.cam.ac.uk>2005-01-17 13:38:54 +0000
commit990e73cba7fc82ed9990f90899214769cd6257d1 (patch)
treee9c6bea02a5e4a3d48f82e1f8f8507f940abd1e5 /tools/libxc/xc_sedf.c
parent18bbf10459e256dc78df99306b6faa820b636936 (diff)
downloadxen-990e73cba7fc82ed9990f90899214769cd6257d1.tar.gz
xen-990e73cba7fc82ed9990f90899214769cd6257d1.tar.bz2
xen-990e73cba7fc82ed9990f90899214769cd6257d1.zip
bitkeeper revision 1.1159.221.1 (41ebbfeezjfpGp20MD6f6Xl2r6Wd3Q)
Added new simple EDF scheduler
Diffstat (limited to 'tools/libxc/xc_sedf.c')
-rw-r--r--tools/libxc/xc_sedf.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/tools/libxc/xc_sedf.c b/tools/libxc/xc_sedf.c
new file mode 100644
index 0000000000..92c052fe23
--- /dev/null
+++ b/tools/libxc/xc_sedf.c
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * xc_sedf.c
+ *
+ * API for manipulating parameters of the Simple EDF scheduler.
+ *
+ * changes by Stephan Diestelhorst
+ * based on code
+ * by Mark Williamson, Copyright (c) 2004 Intel Research Cambridge.
+ */
+
+#include "xc_private.h"
+
+int xc_sedf_domain_set(int xc_handle,
+ u32 domid, u64 period, u64 slice)
+{
+ dom0_op_t op;
+ struct sedf_adjdom *p = &op.u.adjustdom.u.sedf;
+
+ op.cmd = DOM0_ADJUSTDOM;
+ op.u.adjustdom.domain = (domid_t)domid;
+ op.u.adjustdom.sched_id = SCHED_SEDF;
+ op.u.adjustdom.direction = SCHED_INFO_PUT;
+
+ p->period = period;
+ p->slice = slice;
+ return do_dom0_op(xc_handle, &op);
+}
+
+int xc_sedf_domain_get(int xc_handle, u32 domid, u64 *period, u64 *slice)
+{
+ dom0_op_t op;
+ int ret;
+ struct sedf_adjdom *p = &op.u.adjustdom.u.sedf;
+
+ op.cmd = DOM0_ADJUSTDOM;
+ op.u.adjustdom.domain = (domid_t)domid;
+ op.u.adjustdom.sched_id = SCHED_SEDF;
+ op.u.adjustdom.direction = SCHED_INFO_GET;
+
+ ret = do_dom0_op(xc_handle, &op);
+
+ *period = p->period;
+ *slice = p->slice;
+ return ret;
+}