mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
Valgrind cannot see when a hypercall has initialised entries in a data structure, so appropriate memsets have been placed before using dom0_op_t, privcmd_hypercall_t, and a couple of miscellaneous blocks passed into this layer. This initialises the block so that valgrind considers it to be valid, but the data therein will be immediately overwritten by the hypercall, all being well. These changes are semantically neutral if -DVALGRIND is not set. Signed-off-by: Ewan Mellor <ewan@xensource.com>
52 lines
1.5 KiB
C
52 lines
1.5 KiB
C
/******************************************************************************
|
|
* 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,
|
|
uint32_t domid, uint64_t period, uint64_t slice,uint64_t latency, uint16_t extratime,uint16_t weight)
|
|
{
|
|
DECLARE_DOM0_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;
|
|
p->latency = latency;
|
|
p->extratime = extratime;
|
|
p->weight = weight;
|
|
return do_dom0_op(xc_handle, &op);
|
|
}
|
|
|
|
int xc_sedf_domain_get(int xc_handle, uint32_t domid, uint64_t *period, uint64_t *slice, uint64_t* latency, uint16_t* extratime, uint16_t* weight)
|
|
{
|
|
DECLARE_DOM0_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;
|
|
*latency = p->latency;
|
|
*extratime = p->extratime;
|
|
*weight = p->weight;
|
|
return ret;
|
|
}
|