}
static void
-csched_free_pdata(struct scheduler *ops, void *pcpu, int cpu)
+csched_free_pdata(const struct scheduler *ops, void *pcpu, int cpu)
{
struct csched_private *prv = CSCHED_PRIV(ops);
struct csched_pcpu *spc = pcpu;
}
static void *
-csched_alloc_pdata(struct scheduler *ops, int cpu)
+csched_alloc_pdata(const struct scheduler *ops, int cpu)
{
struct csched_pcpu *spc;
struct csched_private *prv = CSCHED_PRIV(ops);
}
static int
-_csched_cpu_pick(struct scheduler *ops, struct vcpu *vc, bool_t commit)
+_csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t commit)
{
cpumask_t cpus;
cpumask_t idlers;
}
static int
-csched_cpu_pick(struct scheduler *ops, struct vcpu *vc)
+csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc)
{
return _csched_cpu_pick(ops, vc, 1);
}
csched_vcpu_acct(struct csched_private *prv, unsigned int cpu)
{
struct csched_vcpu * const svc = CSCHED_VCPU(current);
- struct scheduler *ops = per_cpu(scheduler, cpu);
+ const struct scheduler *ops = per_cpu(scheduler, cpu);
ASSERT( current->processor == cpu );
ASSERT( svc->sdom != NULL );
}
static void *
-csched_alloc_vdata(struct scheduler *ops, struct vcpu *vc, void *dd)
+csched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
{
struct csched_vcpu *svc;
}
static void
-csched_vcpu_insert(struct scheduler *ops, struct vcpu *vc)
+csched_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
{
struct csched_vcpu *svc = vc->sched_priv;
}
static void
-csched_free_vdata(struct scheduler *ops, void *priv)
+csched_free_vdata(const struct scheduler *ops, void *priv)
{
struct csched_private *prv = CSCHED_PRIV(ops);
struct csched_vcpu *svc = priv;
}
static void
-csched_vcpu_destroy(struct scheduler *ops, struct vcpu *vc)
+csched_vcpu_destroy(const struct scheduler *ops, struct vcpu *vc)
{
struct csched_vcpu * const svc = CSCHED_VCPU(vc);
struct csched_dom * const sdom = svc->sdom;
}
static void
-csched_vcpu_sleep(struct scheduler *ops, struct vcpu *vc)
+csched_vcpu_sleep(const struct scheduler *ops, struct vcpu *vc)
{
struct csched_vcpu * const svc = CSCHED_VCPU(vc);
}
static void
-csched_vcpu_wake(struct scheduler *ops, struct vcpu *vc)
+csched_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
{
struct csched_vcpu * const svc = CSCHED_VCPU(vc);
const unsigned int cpu = vc->processor;
static int
csched_dom_cntl(
- struct scheduler *ops,
+ const struct scheduler *ops,
struct domain *d,
struct xen_domctl_scheduler_op *op)
{
}
static void *
-csched_alloc_domdata(struct scheduler *ops, struct domain *dom)
+csched_alloc_domdata(const struct scheduler *ops, struct domain *dom)
{
struct csched_dom *sdom;
}
static int
-csched_dom_init(struct scheduler *ops, struct domain *dom)
+csched_dom_init(const struct scheduler *ops, struct domain *dom)
{
struct csched_dom *sdom;
}
static void
-csched_free_domdata(struct scheduler *ops, void *data)
+csched_free_domdata(const struct scheduler *ops, void *data)
{
xfree(data);
}
static void
-csched_dom_destroy(struct scheduler *ops, struct domain *dom)
+csched_dom_destroy(const struct scheduler *ops, struct domain *dom)
{
CSCHED_STAT_CRANK(dom_destroy);
csched_free_domdata(ops, CSCHED_DOM(dom));
* fast for the common case.
*/
static struct task_slice
-csched_schedule(struct scheduler *ops, s_time_t now)
+csched_schedule(const struct scheduler *ops, s_time_t now)
{
const int cpu = smp_processor_id();
struct list_head * const runq = RUNQ(cpu);
}
static void
-csched_dump_pcpu(struct scheduler *ops, int cpu)
+csched_dump_pcpu(const struct scheduler *ops, int cpu)
{
struct list_head *runq, *iter;
struct csched_pcpu *spc;
}
static void
-csched_dump(struct scheduler *ops)
+csched_dump(const struct scheduler *ops)
{
struct list_head *iter_sdom, *iter_svc;
struct csched_private *prv = CSCHED_PRIV(ops);
__initcall(csched_start_tickers);
static void
-csched_deinit(struct scheduler *ops)
+csched_deinit(const struct scheduler *ops)
{
struct csched_private *prv;
xfree(prv);
}
-static void csched_tick_suspend(struct scheduler *ops, unsigned int cpu)
+static void csched_tick_suspend(const struct scheduler *ops, unsigned int cpu)
{
struct csched_pcpu *spc;
stop_timer(&spc->ticker);
}
-static void csched_tick_resume(struct scheduler *ops, unsigned int cpu)
+static void csched_tick_resume(const struct scheduler *ops, unsigned int cpu)
{
struct csched_pcpu *spc;
uint64_t now = NOW();
static struct csched_private _csched_priv;
-struct scheduler sched_credit_def = {
+const struct scheduler sched_credit_def = {
.name = "SMP Credit Scheduler",
.opt_name = "credit",
.sched_id = XEN_SCHEDULER_CREDIT,
}
static void
-runq_insert(struct scheduler *ops, unsigned int cpu, struct csched_vcpu *svc)
+runq_insert(const struct scheduler *ops, unsigned int cpu, struct csched_vcpu *svc)
{
struct list_head * runq = &RQD(ops, cpu)->runq;
int pos = 0;
/* Check to see if the item on the runqueue is higher priority than what's
* currently running; if so, wake up the processor */
static /*inline*/ void
-runq_tickle(struct scheduler *ops, unsigned int cpu, struct csched_vcpu *new, s_time_t now)
+runq_tickle(const struct scheduler *ops, unsigned int cpu, struct csched_vcpu *new, s_time_t now)
{
int i, ipid=-1;
s_time_t lowest=(1<<30);
/*
* Credit-related code
*/
-static void reset_credit(struct scheduler *ops, int cpu, s_time_t now)
+static void reset_credit(const struct scheduler *ops, int cpu, s_time_t now)
{
struct list_head *iter;
#endif
static void *
-csched_alloc_vdata(struct scheduler *ops, struct vcpu *vc, void *dd)
+csched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
{
struct csched_vcpu *svc;
}
static void
-csched_vcpu_insert(struct scheduler *ops, struct vcpu *vc)
+csched_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
{
struct csched_vcpu *svc = vc->sched_priv;
struct domain * const dom = vc->domain;
}
static void
-csched_free_vdata(struct scheduler *ops, void *priv)
+csched_free_vdata(const struct scheduler *ops, void *priv)
{
struct csched_vcpu *svc = priv;
struct vcpu *vc = svc->vcpu;
}
static void
-csched_vcpu_destroy(struct scheduler *ops, struct vcpu *vc)
+csched_vcpu_destroy(const struct scheduler *ops, struct vcpu *vc)
{
struct csched_vcpu * const svc = CSCHED_VCPU(vc);
struct csched_dom * const sdom = svc->sdom;
}
static void
-csched_vcpu_sleep(struct scheduler *ops, struct vcpu *vc)
+csched_vcpu_sleep(const struct scheduler *ops, struct vcpu *vc)
{
struct csched_vcpu * const svc = CSCHED_VCPU(vc);
}
static void
-csched_vcpu_wake(struct scheduler *ops, struct vcpu *vc)
+csched_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
{
struct csched_vcpu * const svc = CSCHED_VCPU(vc);
const unsigned int cpu = vc->processor;
}
static void
-csched_context_saved(struct scheduler *ops, struct vcpu *vc)
+csched_context_saved(const struct scheduler *ops, struct vcpu *vc)
{
struct csched_vcpu * const svc = CSCHED_VCPU(vc);
}
static int
-csched_cpu_pick(struct scheduler *ops, struct vcpu *vc)
+csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc)
{
/* FIXME: Chose a schedule group based on load */
/* FIXME: Migrate the vcpu to the new runqueue list, updating
static int
csched_dom_cntl(
- struct scheduler *ops,
+ const struct scheduler *ops,
struct domain *d,
struct xen_domctl_scheduler_op *op)
{
}
static void *
-csched_alloc_domdata(struct scheduler *ops, struct domain *dom)
+csched_alloc_domdata(const struct scheduler *ops, struct domain *dom)
{
struct csched_dom *sdom;
int flags;
}
static int
-csched_dom_init(struct scheduler *ops, struct domain *dom)
+csched_dom_init(const struct scheduler *ops, struct domain *dom)
{
struct csched_dom *sdom;
}
static void
-csched_free_domdata(struct scheduler *ops, void *data)
+csched_free_domdata(const struct scheduler *ops, void *data)
{
int flags;
struct csched_dom *sdom = data;
}
static void
-csched_dom_destroy(struct scheduler *ops, struct domain *dom)
+csched_dom_destroy(const struct scheduler *ops, struct domain *dom)
{
struct csched_dom *sdom = CSCHED_DOM(dom);
/* How long should we let this vcpu run for? */
static s_time_t
-csched_runtime(struct scheduler *ops, int cpu, struct csched_vcpu *snext)
+csched_runtime(const struct scheduler *ops, int cpu, struct csched_vcpu *snext)
{
s_time_t time = CSCHED_MAX_TIMER;
struct csched_runqueue_data *rqd = RQD(ops, cpu);
* fast for the common case.
*/
static struct task_slice
-csched_schedule(struct scheduler *ops, s_time_t now)
+csched_schedule(const struct scheduler *ops, s_time_t now)
{
const int cpu = smp_processor_id();
struct csched_runqueue_data *rqd = RQD(ops, cpu);
}
static void
-csched_dump_pcpu(struct scheduler *ops, int cpu)
+csched_dump_pcpu(const struct scheduler *ops, int cpu)
{
struct list_head *runq, *iter;
struct csched_vcpu *svc;
}
static void
-csched_dump(struct scheduler *ops)
+csched_dump(const struct scheduler *ops)
{
struct list_head *iter_sdom, *iter_svc;
struct csched_private *prv = CSCHED_PRIV(ops);
}
static void
-make_runq_map(struct scheduler *ops)
+make_runq_map(const struct scheduler *ops)
{
int cpu, cpu_count=0;
struct csched_private *prv = CSCHED_PRIV(ops);
}
static void
-csched_deinit(struct scheduler *ops)
+csched_deinit(const struct scheduler *ops)
{
struct csched_private *prv;
static struct csched_private _csched_priv;
-struct scheduler sched_credit2_def = {
+const struct scheduler sched_credit2_def = {
.name = "SMP Credit Scheduler rev2",
.opt_name = "credit2",
.sched_id = XEN_SCHEDULER_CREDIT2,
#define sedf_runnable(edom) (!(EDOM_INFO(edom)->status & SEDF_ASLEEP))
-static void sedf_dump_cpu_state(struct scheduler *ops, int i);
+static void sedf_dump_cpu_state(const struct scheduler *ops, int i);
static inline int extraq_on(struct vcpu *d, int i)
{
}
-static void *sedf_alloc_vdata(struct scheduler *ops, struct vcpu *v, void *dd)
+static void *sedf_alloc_vdata(const struct scheduler *ops, struct vcpu *v, void *dd)
{
struct sedf_vcpu_info *inf;
}
static void *
-sedf_alloc_pdata(struct scheduler *ops, int cpu)
+sedf_alloc_pdata(const struct scheduler *ops, int cpu)
{
struct sedf_cpu_info *spc;
}
static void
-sedf_free_pdata(struct scheduler *ops, void *spc, int cpu)
+sedf_free_pdata(const struct scheduler *ops, void *spc, int cpu)
{
if ( spc == NULL )
return;
xfree(spc);
}
-static void sedf_free_vdata(struct scheduler *ops, void *priv)
+static void sedf_free_vdata(const struct scheduler *ops, void *priv)
{
xfree(priv);
}
-static void sedf_destroy_vcpu(struct scheduler *ops, struct vcpu *v)
+static void sedf_destroy_vcpu(const struct scheduler *ops, struct vcpu *v)
{
sedf_free_vdata(ops, v->sched_priv);
}
static void *
-sedf_alloc_domdata(struct scheduler *ops, struct domain *d)
+sedf_alloc_domdata(const struct scheduler *ops, struct domain *d)
{
void *mem;
return mem;
}
-static int sedf_init_domain(struct scheduler *ops, struct domain *d)
+static int sedf_init_domain(const struct scheduler *ops, struct domain *d)
{
d->sched_priv = sedf_alloc_domdata(ops, d);
if ( d->sched_priv == NULL )
return 0;
}
-static void sedf_free_domdata(struct scheduler *ops, void *data)
+static void sedf_free_domdata(const struct scheduler *ops, void *data)
{
xfree(data);
}
-static void sedf_destroy_domain(struct scheduler *ops, struct domain *d)
+static void sedf_destroy_domain(const struct scheduler *ops, struct domain *d)
{
sedf_free_domdata(ops, d->sched_priv);
}
-static int sedf_pick_cpu(struct scheduler *ops, struct vcpu *v)
+static int sedf_pick_cpu(const struct scheduler *ops, struct vcpu *v)
{
cpumask_t online_affinity;
cpumask_t *online;
-timeslice for the current period used up
-domain on waitqueue has started it's period
-and various others ;) in general: determine which domain to run next*/
-static struct task_slice sedf_do_schedule(struct scheduler *ops, s_time_t now)
+static struct task_slice sedf_do_schedule(const struct scheduler *ops, s_time_t now)
{
int cpu = smp_processor_id();
struct list_head *runq = RUNQ(cpu);
}
-static void sedf_sleep(struct scheduler *ops, struct vcpu *d)
+static void sedf_sleep(const struct scheduler *ops, struct vcpu *d)
{
PRINT(2,"sedf_sleep was called, domain-id %i.%i\n",
d->domain->domain_id, d->vcpu_id);
return 1;
}
-static void sedf_wake(struct scheduler *ops, struct vcpu *d)
+static void sedf_wake(const struct scheduler *ops, struct vcpu *d)
{
s_time_t now = NOW();
struct sedf_vcpu_info* inf = EDOM_INFO(d);
/* dumps all domains on the specified cpu */
-static void sedf_dump_cpu_state(struct scheduler *ops, int i)
+static void sedf_dump_cpu_state(const struct scheduler *ops, int i)
{
struct list_head *list, *queue, *tmp;
struct sedf_vcpu_info *d_inf;
/* set or fetch domain scheduling parameters */
-static int sedf_adjust(struct scheduler *ops, struct domain *p, struct xen_domctl_scheduler_op *op)
+static int sedf_adjust(const struct scheduler *ops, struct domain *p, struct xen_domctl_scheduler_op *op)
{
struct vcpu *v;
int rc;
return 0;
}
-struct scheduler sched_sedf_def = {
+const struct scheduler sched_sedf_def = {
.name = "Simple EDF Scheduler",
.opt_name = "sedf",
.sched_id = XEN_SCHEDULER_SEDF,
void *sched_data; /* global data pointer */
int (*init) (struct scheduler *, int);
- void (*deinit) (struct scheduler *);
+ void (*deinit) (const struct scheduler *);
- void (*free_vdata) (struct scheduler *, void *);
- void * (*alloc_vdata) (struct scheduler *, struct vcpu *,
+ void (*free_vdata) (const struct scheduler *, void *);
+ void * (*alloc_vdata) (const struct scheduler *, struct vcpu *,
void *);
- void (*free_pdata) (struct scheduler *, void *, int);
- void * (*alloc_pdata) (struct scheduler *, int);
- void (*free_domdata) (struct scheduler *, void *);
- void * (*alloc_domdata) (struct scheduler *, struct domain *);
+ void (*free_pdata) (const struct scheduler *, void *, int);
+ void * (*alloc_pdata) (const struct scheduler *, int);
+ void (*free_domdata) (const struct scheduler *, void *);
+ void * (*alloc_domdata) (const struct scheduler *, struct domain *);
- int (*init_domain) (struct scheduler *, struct domain *);
- void (*destroy_domain) (struct scheduler *, struct domain *);
+ int (*init_domain) (const struct scheduler *, struct domain *);
+ void (*destroy_domain) (const struct scheduler *, struct domain *);
- void (*insert_vcpu) (struct scheduler *, struct vcpu *);
- void (*destroy_vcpu) (struct scheduler *, struct vcpu *);
+ void (*insert_vcpu) (const struct scheduler *, struct vcpu *);
+ void (*destroy_vcpu) (const struct scheduler *, struct vcpu *);
- void (*sleep) (struct scheduler *, struct vcpu *);
- void (*wake) (struct scheduler *, struct vcpu *);
- void (*context_saved) (struct scheduler *, struct vcpu *);
+ void (*sleep) (const struct scheduler *, struct vcpu *);
+ void (*wake) (const struct scheduler *, struct vcpu *);
+ void (*context_saved) (const struct scheduler *, struct vcpu *);
- struct task_slice (*do_schedule) (struct scheduler *, s_time_t);
+ struct task_slice (*do_schedule) (const struct scheduler *, s_time_t);
- int (*pick_cpu) (struct scheduler *, struct vcpu *);
- int (*adjust) (struct scheduler *, struct domain *,
+ int (*pick_cpu) (const struct scheduler *, struct vcpu *);
+ int (*adjust) (const struct scheduler *, struct domain *,
struct xen_domctl_scheduler_op *);
- void (*dump_settings) (struct scheduler *);
- void (*dump_cpu_state) (struct scheduler *, int);
+ int (*adjust_global) (const struct scheduler *,
+ struct xen_sysctl_scheduler_op *);
+ void (*dump_settings) (const struct scheduler *);
+ void (*dump_cpu_state) (const struct scheduler *, int);
- void (*tick_suspend) (struct scheduler *, unsigned int);
- void (*tick_resume) (struct scheduler *, unsigned int);
+ void (*tick_suspend) (const struct scheduler *, unsigned int);
+ void (*tick_resume) (const struct scheduler *, unsigned int);
};
struct cpupool