--- Gnu-Mach/kern/sched.h 2020/09/02 04:36:57 1.1 +++ Gnu-Mach/kern/sched.h 2020/09/02 04:47:29 1.1.1.4 @@ -1,25 +1,25 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ @@ -35,18 +35,14 @@ #ifndef _KERN_SCHED_H_ #define _KERN_SCHED_H_ -#include -#include -#include -#include - #include #include +#include #include #if MACH_FIXPRI #include -#endif MACH_FIXPRI +#endif /* MACH_FIXPRI */ #if STAT_TIME @@ -56,15 +52,15 @@ */ #define PRI_SHIFT 18 -#else STAT_TIME +#else /* STAT_TIME */ /* * Otherwise machine provides shift(s) based on time units it uses. */ #include -#endif STAT_TIME -#define NRQS 32 /* 32 run queues per cpu */ +#endif /* STAT_TIME */ +#define NRQS 50 /* 50 run queues per cpu */ struct run_queue { queue_head_t runq[NRQS]; /* one for each priority */ @@ -98,21 +94,21 @@ typedef struct run_queue *run_queue_t; ((processor)->processor_set->runq.low < \ (thread)->sched_pri)))) -#else MACH_FIXPRI +#else /* MACH_FIXPRI */ #define csw_needed(thread, processor) ((thread)->state & TH_SUSP || \ ((processor)->runq.count > 0) || \ ((processor)->first_quantum == FALSE && \ ((processor)->processor_set->runq.count > 0 && \ (processor)->processor_set->runq.low <= \ ((thread)->sched_pri)))) -#endif MACH_FIXPRI +#endif /* MACH_FIXPRI */ /* * Scheduler routines. */ -extern struct run_queue *rem_runq(); -extern struct thread *choose_thread(); +extern struct run_queue *rem_runq(thread_t); +extern struct thread *choose_thread(processor_t); extern queue_head_t action_queue; /* assign/shutdown queue */ decl_simple_lock_data(extern,action_lock); @@ -122,7 +118,7 @@ extern int min_quantum; /* defines max * Default base priorities for threads. */ #define BASEPRI_SYSTEM 6 -#define BASEPRI_USER 12 +#define BASEPRI_USER 25 /* * Macro to check for invalid priorities. @@ -157,7 +153,7 @@ extern unsigned sched_tick; #define thread_timer_delta(thread) \ MACRO_BEGIN \ - register unsigned delta; \ + unsigned delta; \ \ delta = 0; \ TIMER_DELTA((thread)->system_timer, \ @@ -176,6 +172,6 @@ MACRO_END */ extern int sched_usec; -#endif SIMPLE_CLOCK +#endif /* SIMPLE_CLOCK */ -#endif _KERN_SCHED_H_ +#endif /* _KERN_SCHED_H_ */