* If this process is scheduled by the kernel, we renew it's quantum
* and remove it's RTS_NO_QUANTUM flag.
*/
- if (proc_no_quantum(proc_ptr) && (proc_ptr->p_scheduler == NULL)) {
+ if (proc_no_quantum(proc_ptr) && proc_kernel_scheduler(proc_ptr)) {
/* give new quantum */
proc_ptr->p_ticks_left = proc_ptr->p_quantum_size;
RTS_UNSET(proc_ptr, RTS_NO_QUANTUM);
* quantum. This is done by sending a message to the scheduler
* on the process's behalf
*/
- if (p->p_scheduler == p) {
+ if (proc_kernel_scheduler(p)) {
/*
- * If a scheduler is scheduling itself, and runs out of
- * quantum, we don't send a message. The RTS_NO_QUANTUM
- * flag will be removed by schedcheck in proc.c.
+ * If a scheduler is scheduling itself or has no scheduler, and
+ * runs out of quantum, we don't send a message. The
+ * RTS_NO_QUANTUM flag will be removed by schedcheck in proc.c.
*/
}
- else if (p->p_scheduler != NULL) {
+ else {
message m_no_quantum;
int err;
#define proc_no_quantum(p) ((p)->p_rts_flags & RTS_NO_QUANTUM)
#define proc_ptr_ok(p) ((p)->p_magic == PMAGIC)
+/* test whether the process is scheduled by the kernel's default policy */
+#define proc_kernel_scheduler(p) ((p)->p_scheduler == NULL || \
+ (p)->p_scheduler == (p))
+
/* Macro to return: on which process is a certain process blocked?
* return endpoint number (can be ANY) or NONE. It's important to
* check RTS_SENDING first, and then RTS_RECEIVING, as they could