1*433d6423SLionel Sambuc /* This table has one slot per process. It contains scheduling information 2*433d6423SLionel Sambuc * for each process. 3*433d6423SLionel Sambuc */ 4*433d6423SLionel Sambuc #include <limits.h> 5*433d6423SLionel Sambuc 6*433d6423SLionel Sambuc #include <minix/bitmap.h> 7*433d6423SLionel Sambuc 8*433d6423SLionel Sambuc /* EXTERN should be extern except in main.c, where we want to keep the struct */ 9*433d6423SLionel Sambuc #ifdef _MAIN 10*433d6423SLionel Sambuc #undef EXTERN 11*433d6423SLionel Sambuc #define EXTERN 12*433d6423SLionel Sambuc #endif 13*433d6423SLionel Sambuc 14*433d6423SLionel Sambuc #ifndef CONFIG_SMP 15*433d6423SLionel Sambuc #define CONFIG_MAX_CPUS 1 16*433d6423SLionel Sambuc #endif 17*433d6423SLionel Sambuc 18*433d6423SLionel Sambuc /** 19*433d6423SLionel Sambuc * We might later want to add more information to this table, such as the 20*433d6423SLionel Sambuc * process owner, process group or cpumask. 21*433d6423SLionel Sambuc */ 22*433d6423SLionel Sambuc 23*433d6423SLionel Sambuc EXTERN struct schedproc { 24*433d6423SLionel Sambuc endpoint_t endpoint; /* process endpoint id */ 25*433d6423SLionel Sambuc endpoint_t parent; /* parent endpoint id */ 26*433d6423SLionel Sambuc unsigned flags; /* flag bits */ 27*433d6423SLionel Sambuc 28*433d6423SLionel Sambuc /* User space scheduling */ 29*433d6423SLionel Sambuc unsigned max_priority; /* this process' highest allowed priority */ 30*433d6423SLionel Sambuc unsigned priority; /* the process' current priority */ 31*433d6423SLionel Sambuc unsigned time_slice; /* this process's time slice */ 32*433d6423SLionel Sambuc unsigned cpu; /* what CPU is the process running on */ 33*433d6423SLionel Sambuc bitchunk_t cpu_mask[BITMAP_CHUNKS(CONFIG_MAX_CPUS)]; /* what CPUs is the 34*433d6423SLionel Sambuc process allowed 35*433d6423SLionel Sambuc to run on */ 36*433d6423SLionel Sambuc } schedproc[NR_PROCS]; 37*433d6423SLionel Sambuc 38*433d6423SLionel Sambuc /* Flag values */ 39*433d6423SLionel Sambuc #define IN_USE 0x00001 /* set when 'schedproc' slot in use */ 40