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