return -1;
}
- if ((ps_proc[p_ki].p_rts_flags == RTS_SLOT_FREE)
+ if (isemptyp(&ps_proc[p_ki])
&& !(ps_mproc[p_nr].mp_flags & IN_USE)) {
return -1;
}
for(proc_s = 0; proc_s < SLOTS; proc_s++)
if(proc[proc_s].p_endpoint == proc_e &&
- !(proc[proc_s].p_rts_flags & RTS_SLOT_FREE))
+ !isemptyp(&proc[proc_s]))
break;
if(proc_s >= SLOTS) {
return 1;
}
- if(proc[proc_s].p_rts_flags & RTS_SLOT_FREE) {
+ if(isemptyp(&proc[proc_s])) {
printf( "slot %d is no process (internal error).\n",
proc_s);
return 1;
for(p = 0; p < PROCS; p++) {
if(p - NR_TASKS == IDLE)
continue;
- if(proc[p].p_rts_flags & RTS_SLOT_FREE)
+ if(isemptyp(&proc[p]))
continue;
alive++;
- if(proc[p].p_rts_flags & ~RTS_SLOT_FREE)
+ if(!proc_is_runnable(&proc[p]))
sleeping++;
else
running++;
if(dt < 1) return;
for(p = nprocs = 0; p < PROCS; p++) {
- if(proc2[p].p_rts_flags & RTS_SLOT_FREE)
+ if(isemptyp(&proc2[p]))
continue;
tick_procs[nprocs].p = proc2 + p;
if(proc1[p].p_endpoint == proc2[p].p_endpoint) {
vmassert(proc);
vmassert(physical);
- vmassert(!(proc->p_rts_flags & RTS_SLOT_FREE));
+ vmassert(!isemptyp(proc));
if(!HASPT(proc)) {
*physical = virtual;
int privilege;
int cs, ds;
- if (RTS_ISSET(rp, RTS_SLOT_FREE))
+ if (isemptyp(rp))
continue;
if( (iskernelp(rp)))
/* Increase kernel processes too. */
for (rp = BEG_PROC_ADDR; rp < END_PROC_ADDR; ++rp) {
- if (RTS_ISSET(rp, RTS_SLOT_FREE) || !iskernelp(rp))
+ if (isemptyp(rp) || !iskernelp(rp))
continue;
rp->p_memmap[S].mem_len += incr_clicks;
alloc_segments(rp);
struct proc *pp;
for (pp= BEG_PROC_ADDR; pp < END_PROC_ADDR; pp++)
{
- if (pp->p_rts_flags & RTS_SLOT_FREE)
+ if (isemptyp(pp))
continue;
kprintf("%d: %s ep %d\n", proc_nr(pp), pp->p_name, pp->p_endpoint);
printseg("cs: ", 1, pp, pp->p_reg.cs);
kprintf(" ??? %d\n", dep);
} else {
depproc = proc_addr(procno);
- if(depproc->p_rts_flags & RTS_SLOT_FREE) {
+ if(isemptyp(depproc)) {
kprintf(" empty slot %d???\n", procno);
depproc = NULL;
} else {
for (pp= BEG_PROC_ADDR; pp < END_PROC_ADDR; pp++)
{
- if (pp->p_rts_flags & RTS_SLOT_FREE)
+ if (isemptyp(pp))
continue;
printslot(pp, 0);
}
r = -1;
for (sp = &priv[0]; sp < &priv[NR_SYS_PROCS]; sp++)
if (sp->s_proc_nr == rp->p_nr) { r ++; break; }
- if (r == -1 && ! (rp->p_rts_flags & RTS_SLOT_FREE)) {
+ if (r == -1 && !isemptyp(rp)) {
sp = &priv[USER_PRIV_ID];
}
printf("(%02u) %-7.7s %s %s %7d",