gdunlap/sched-sim.hg

diff sim.h @ 1:ec2d50e41437

Handle multiple cpus.
author George Dunlap <gdunlap@xensource.com>
date Tue Oct 13 17:29:50 2009 +0100 (2009-10-13)
parents d27bb3c56e71
children 1d7310217c5a
line diff
     1.1 --- a/sim.h	Tue Oct 13 16:06:36 2009 +0100
     1.2 +++ b/sim.h	Tue Oct 13 17:29:50 2009 +0100
     1.3 @@ -2,6 +2,7 @@
     1.4  #define __SIM_H
     1.5  
     1.6  #include "stats.h"
     1.7 +#include "workload.h"
     1.8  
     1.9  enum runstate {
    1.10      RUNSTATE_RUNNING,
    1.11 @@ -55,16 +56,26 @@ struct scheduler {
    1.12      struct sched_ops ops;
    1.13  };
    1.14  
    1.15 -#define MAX_PCPU
    1.16 +#define MAX_PCPU 16
    1.17  struct global_pcpu_data {
    1.18 -    int count;
    1.19 +    int count, idle;
    1.20      struct pcpu {
    1.21          int pid;
    1.22 +        int idle; /* Indicates may be woken up if work appears */
    1.23          struct vm* current;
    1.24      } pcpus[MAX_PCPU];
    1.25  };
    1.26  extern struct global_pcpu_data P;
    1.27  
    1.28 +
    1.29 +#ifdef VM_DATA_PUBLIC
    1.30 +struct global_vm_data {
    1.31 +    int count;
    1.32 +    struct vm vms[MAX_VMS];
    1.33 +};
    1.34 +extern struct global_vm_data V;
    1.35 +#endif
    1.36 +
    1.37  struct vm* vm_from_vid(int vid);
    1.38  #define current(_pid) (P.pcpus[(_pid)].current)
    1.39  void sim_sched_timer(int time, int pid);