minix/servers/sched/schedproc.h
Tomas Hruby 1e273f640e SMP - Scheduler can assign process to a cpu
- machine information contains the number of cpus and the bsp id

- a dummy SMP scheduler which keeps all system processes on BSP and
  all other process on APs. The scheduler remembers how many processes
  are assigned to each CPU and always picks the one with the least
  processes for a new process.
2010-09-15 14:10:33 +00:00

35 lines
1 KiB
C

/* This table has one slot per process. It contains scheduling information
* for each process.
*/
#include <limits.h>
#include <minix/bitmap.h>
/* EXTERN should be extern except in main.c, where we want to keep the struct */
#ifdef _MAIN
#undef EXTERN
#define EXTERN
#endif
/**
* We might later want to add more information to this table, such as the
* process owner, process group or cpumask.
*/
EXTERN struct schedproc {
endpoint_t endpoint; /* process endpoint id */
endpoint_t parent; /* parent endpoint id */
unsigned flags; /* flag bits */
/* User space scheduling */
unsigned max_priority; /* this process' highest allowed priority */
unsigned priority; /* the process' current priority */
unsigned time_slice; /* this process's time slice */
unsigned cpu; /* what CPU is the process running on */
bitchunk_t cpu_mask[BITMAP_CHUNKS(CONFIG_MAX_CPUS)]; /* what CPUs is hte
process allowed
to run on */
} schedproc[NR_PROCS];
/* Flag values */
#define IN_USE 0x00001 /* set when 'schedproc' slot in use */