debuggers.hg

view xen/include/xen/sched-if.h @ 4647:9c88ba91d330

bitkeeper revision 1.1346.1.1 (42670505dNhgnJm5dQD81pCalXMZgw)

manual merge
author iap10@freefall.cl.cam.ac.uk
date Thu Apr 21 01:42:29 2005 +0000 (2005-04-21)
parents 7fc6eac6da3a c712c4935a13
children 86285c9c18c1
line source
1 /******************************************************************************
2 * Additional declarations for the generic scheduler interface. This should
3 * only be included by files that implement conforming schedulers.
4 *
5 * Portions by Mark Williamson are (C) 2004 Intel Research Cambridge
6 */
8 #ifndef __XEN_SCHED_IF_H__
9 #define __XEN_SCHED_IF_H__
11 //#define ADV_SCHED_HISTO
12 #define BUCKETS 10
13 /*300*/
15 struct schedule_data {
16 spinlock_t schedule_lock; /* spinlock protecting curr */
17 struct exec_domain *curr; /* current task */
18 struct exec_domain *idle; /* idle task for this cpu */
19 void *sched_priv;
20 struct ac_timer s_timer; /* scheduling timer */
21 unsigned long tick; /* current periodic 'tick' */
22 #ifdef ADV_SCHED_HISTO
23 u32 to_hist[BUCKETS];
24 u32 from_hist[BUCKETS];
25 u64 save_tsc;
26 #endif
27 #ifdef BUCKETS
28 u32 hist[BUCKETS]; /* for scheduler latency histogram */
29 #endif
30 } __cacheline_aligned;
32 struct task_slice {
33 struct exec_domain *task;
34 s_time_t time;
35 };
37 struct scheduler {
38 char *name; /* full name for this scheduler */
39 char *opt_name; /* option name for this scheduler */
40 unsigned int sched_id; /* ID for this scheduler */
42 int (*init_scheduler) (void);
43 int (*init_idle_task) (struct exec_domain *);
44 int (*alloc_task) (struct exec_domain *);
45 void (*add_task) (struct exec_domain *);
46 void (*free_task) (struct domain *);
47 void (*rem_task) (struct exec_domain *);
48 void (*sleep) (struct exec_domain *);
49 void (*wake) (struct exec_domain *);
50 struct task_slice (*do_schedule) (s_time_t);
51 int (*control) (struct sched_ctl_cmd *);
52 int (*adjdom) (struct domain *,
53 struct sched_adjdom_cmd *);
54 void (*dump_settings) (void);
55 void (*dump_cpu_state) (int);
56 };
58 extern struct schedule_data schedule_data[];
60 #endif /* __XEN_SCHED_IF_H__ */