gdunlap/sched-sim.hg

changeset 4:f7c1a67cf976

Oops, forgot to include sim.h
author George Dunlap <gdunlap@xensource.com>
date Mon Oct 19 20:12:54 2009 +0100 (2009-10-19)
parents d957708efa86
children 18f3d6e25ffc
files sched.h sched_rr.c
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/sched.h	Mon Oct 19 20:12:54 2009 +0100
     1.3 @@ -0,0 +1,19 @@
     1.4 +#ifndef _SCHED_H
     1.5 +#define _SCHED_H
     1.6 +
     1.7 +struct sched_ops {
     1.8 +    void (*sched_init)(void);
     1.9 +    void (*vm_init)(int vid);
    1.10 +    void (*wake)(int time, int vid);
    1.11 +    struct vm* (*schedule)(int time, int pid);
    1.12 +};
    1.13 +
    1.14 +struct scheduler {
    1.15 +    char *name;
    1.16 +    char *desc;
    1.17 +    struct sched_ops ops;
    1.18 +};
    1.19 +
    1.20 +extern struct scheduler *schedulers[];
    1.21 +
    1.22 +#endif
     2.1 --- a/sched_rr.c	Mon Oct 19 20:11:33 2009 +0100
     2.2 +++ b/sched_rr.c	Mon Oct 19 20:12:54 2009 +0100
     2.3 @@ -123,6 +123,7 @@ struct vm* sched_rr_schedule(int time, i
     2.4  struct scheduler sched_rr =
     2.5  {
     2.6      .name="round-robin",
     2.7 +    .desc="Basic round-robin scheduler.",
     2.8      .ops = {
     2.9          .sched_init = sched_rr_init,
    2.10          .vm_init    = sched_rr_vm_init,