All macros defining rts flags are prefixed with RTS_
- macros used with RTS_SET group of macros to define struct proc p_rts_flags are now prefixed with RTS_ to make things clear
This commit is contained in:
@@ -31,11 +31,11 @@ message *m_ptr; /* pointer to request message */
|
||||
return EINVAL;
|
||||
|
||||
rp = proc_addr(proc_nr);
|
||||
if (!RTS_ISSET(rp, SIG_PENDING)) return(EINVAL);
|
||||
if (!RTS_ISSET(rp, RTS_SIG_PENDING)) return(EINVAL);
|
||||
|
||||
/* PM has finished one kernel signal. Perhaps process is ready now? */
|
||||
if (!RTS_ISSET(rp, SIGNALED)) /* new signal arrived */
|
||||
RTS_LOCK_UNSET(rp, SIG_PENDING); /* remove pending flag */
|
||||
if (!RTS_ISSET(rp, RTS_SIGNALED)) /* new signal arrived */
|
||||
RTS_LOCK_UNSET(rp, RTS_SIG_PENDING); /* remove pending flag */
|
||||
return(OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ register message *m_ptr; /* pointer to request message */
|
||||
arch_pre_exec(rp, (u32_t) m_ptr->PR_IP_PTR, (u32_t) m_ptr->PR_STACK_PTR);
|
||||
|
||||
/* No reply to EXEC call */
|
||||
RTS_LOCK_UNSET(rp, RECEIVING);
|
||||
RTS_LOCK_UNSET(rp, RTS_RECEIVING);
|
||||
|
||||
return(OK);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ register struct proc *rc; /* slot of process to clean up */
|
||||
/* Make sure that the exiting process is no longer scheduled,
|
||||
* and mark slot as FREE.
|
||||
*/
|
||||
RTS_LOCK_SETFLAGS(rc, SLOT_FREE);
|
||||
RTS_LOCK_SETFLAGS(rc, RTS_SLOT_FREE);
|
||||
|
||||
/* Check the table with IRQ hooks to see if hooks should be released. */
|
||||
for (i=0; i < NR_IRQ_HOOKS; i++) {
|
||||
|
||||
@@ -42,7 +42,7 @@ register message *m_ptr; /* pointer to request message */
|
||||
vmassert(!(rpp->p_misc_flags & MF_DELIVERMSG));
|
||||
|
||||
/* needs to be receiving so we know where the message buffer is */
|
||||
if(!RTS_ISSET(rpp, RECEIVING)) {
|
||||
if(!RTS_ISSET(rpp, RTS_RECEIVING)) {
|
||||
printf("kernel: fork not done synchronously?\n");
|
||||
return EINVAL;
|
||||
}
|
||||
@@ -91,7 +91,7 @@ register message *m_ptr; /* pointer to request message */
|
||||
*/
|
||||
if (priv(rpp)->s_flags & SYS_PROC) {
|
||||
rpc->p_priv = priv_addr(USER_PRIV_ID);
|
||||
rpc->p_rts_flags |= NO_PRIV;
|
||||
rpc->p_rts_flags |= RTS_NO_PRIV;
|
||||
}
|
||||
|
||||
/* Calculate endpoint identifier, so caller knows what it is. */
|
||||
@@ -104,11 +104,13 @@ register message *m_ptr; /* pointer to request message */
|
||||
|
||||
/* Don't schedule process in VM mode until it has a new pagetable. */
|
||||
if(m_ptr->PR_FORK_FLAGS & PFF_VMINHIBIT) {
|
||||
RTS_LOCK_SET(rpc, VMINHIBIT);
|
||||
RTS_LOCK_SET(rpc, RTS_VMINHIBIT);
|
||||
}
|
||||
|
||||
/* Only one in group should have SIGNALED, child doesn't inherit tracing. */
|
||||
RTS_LOCK_UNSET(rpc, (SIGNALED | SIG_PENDING | P_STOP));
|
||||
/*
|
||||
* Only one in group should have RTS_SIGNALED, child doesn't inherit tracing.
|
||||
*/
|
||||
RTS_LOCK_UNSET(rpc, (RTS_SIGNALED | RTS_SIG_PENDING | RTS_P_STOP));
|
||||
sigemptyset(&rpc->p_pending);
|
||||
|
||||
return r;
|
||||
|
||||
@@ -29,12 +29,12 @@ message *m_ptr; /* pointer to request message */
|
||||
|
||||
/* Find the next process with pending signals. */
|
||||
for (rp = BEG_USER_ADDR; rp < END_PROC_ADDR; rp++) {
|
||||
if (RTS_ISSET(rp, SIGNALED)) {
|
||||
if (RTS_ISSET(rp, RTS_SIGNALED)) {
|
||||
/* store signaled process' endpoint */
|
||||
m_ptr->SIG_ENDPT = rp->p_endpoint;
|
||||
m_ptr->SIG_MAP = rp->p_pending; /* pending signals map */
|
||||
sigemptyset(&rp->p_pending); /* ball is in PM's court */
|
||||
RTS_LOCK_UNSET(rp, SIGNALED); /* blocked by SIG_PENDING */
|
||||
RTS_LOCK_UNSET(rp, RTS_SIGNALED); /* blocked by SIG_PENDING */
|
||||
return(OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,9 +41,9 @@ PUBLIC int do_nice(message *m_ptr)
|
||||
/* Make sure the process is not running while changing its priority.
|
||||
* Put the process back in its new queue if it is runnable.
|
||||
*/
|
||||
RTS_LOCK_SET(rp, SYS_LOCK);
|
||||
RTS_LOCK_SET(rp, RTS_SYS_LOCK);
|
||||
rp->p_max_priority = rp->p_priority = new_q;
|
||||
RTS_LOCK_UNSET(rp, SYS_LOCK);
|
||||
RTS_LOCK_UNSET(rp, RTS_SYS_LOCK);
|
||||
|
||||
return(OK);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ message *m_ptr; /* pointer to request message */
|
||||
|
||||
/* Check whether caller is allowed to make this call. Privileged proceses
|
||||
* can only update the privileges of processes that are inhibited from
|
||||
* running by the NO_PRIV flag. This flag is set when a privileged process
|
||||
* running by the RTS_NO_PRIV flag. This flag is set when a privileged process
|
||||
* forks.
|
||||
*/
|
||||
caller_ptr = proc_addr(who_p);
|
||||
@@ -49,7 +49,7 @@ message *m_ptr; /* pointer to request message */
|
||||
switch(m_ptr->CTL_REQUEST)
|
||||
{
|
||||
case SYS_PRIV_INIT:
|
||||
if (! RTS_ISSET(rp, NO_PRIV)) return(EPERM);
|
||||
if (! RTS_ISSET(rp, RTS_NO_PRIV)) return(EPERM);
|
||||
|
||||
/* Make sure this process has its own privileges structure. This may
|
||||
* fail, since there are only a limited number of system processes.
|
||||
@@ -145,17 +145,17 @@ message *m_ptr; /* pointer to request message */
|
||||
}
|
||||
|
||||
/* Done. Privileges have been set. Allow process to run again. */
|
||||
RTS_LOCK_UNSET(rp, NO_PRIV);
|
||||
RTS_LOCK_UNSET(rp, RTS_NO_PRIV);
|
||||
return(OK);
|
||||
case SYS_PRIV_USER:
|
||||
/* Make this process an ordinary user process. */
|
||||
if (!RTS_ISSET(rp, NO_PRIV)) return(EPERM);
|
||||
if (!RTS_ISSET(rp, RTS_NO_PRIV)) return(EPERM);
|
||||
if ((i=get_priv(rp, 0)) != OK) return(i);
|
||||
RTS_LOCK_UNSET(rp, NO_PRIV);
|
||||
RTS_LOCK_UNSET(rp, RTS_NO_PRIV);
|
||||
return(OK);
|
||||
|
||||
case SYS_PRIV_ADD_IO:
|
||||
if (RTS_ISSET(rp, NO_PRIV))
|
||||
if (RTS_ISSET(rp, RTS_NO_PRIV))
|
||||
return(EPERM);
|
||||
|
||||
/* Only system processes get I/O resources? */
|
||||
@@ -186,7 +186,7 @@ message *m_ptr; /* pointer to request message */
|
||||
return OK;
|
||||
|
||||
case SYS_PRIV_ADD_MEM:
|
||||
if (RTS_ISSET(rp, NO_PRIV))
|
||||
if (RTS_ISSET(rp, RTS_NO_PRIV))
|
||||
return(EPERM);
|
||||
|
||||
/* Only system processes get memory resources? */
|
||||
@@ -209,7 +209,7 @@ message *m_ptr; /* pointer to request message */
|
||||
return OK;
|
||||
|
||||
case SYS_PRIV_ADD_IRQ:
|
||||
if (RTS_ISSET(rp, NO_PRIV))
|
||||
if (RTS_ISSET(rp, RTS_NO_PRIV))
|
||||
return(EPERM);
|
||||
|
||||
/* Only system processes get IRQs? */
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_runctl(message *m_ptr)
|
||||
{
|
||||
/* Control a process's PROC_STOP flag. Used for process management.
|
||||
/* Control a process's RTS_PROC_STOP flag. Used for process management.
|
||||
* If the process is queued sending a message or stopped for system call
|
||||
* tracing, and the RC_DELAY request flag is given, set MF_SIG_DELAY instead
|
||||
* of PROC_STOP, and send a SIGNDELAY signal later when the process is done
|
||||
* of RTS_PROC_STOP, and send a SIGNDELAY signal later when the process is done
|
||||
* sending (ending the delay). Used by PM for safe signal delivery.
|
||||
*/
|
||||
int proc_nr, action, flags, delayed;
|
||||
@@ -41,14 +41,14 @@ PUBLIC int do_runctl(message *m_ptr)
|
||||
* should not also install signal handlers *and* expect POSIX compliance.
|
||||
*/
|
||||
if (action == RC_STOP && (flags & RC_DELAY)) {
|
||||
RTS_LOCK_SET(rp, SYS_LOCK);
|
||||
RTS_LOCK_SET(rp, RTS_SYS_LOCK);
|
||||
|
||||
if (RTS_ISSET(rp, SENDING) || (rp->p_misc_flags & MF_SC_DEFER))
|
||||
if (RTS_ISSET(rp, RTS_SENDING) || (rp->p_misc_flags & MF_SC_DEFER))
|
||||
rp->p_misc_flags |= MF_SIG_DELAY;
|
||||
|
||||
delayed = (rp->p_misc_flags & MF_SIG_DELAY);
|
||||
|
||||
RTS_LOCK_UNSET(rp, SYS_LOCK);
|
||||
RTS_LOCK_UNSET(rp, RTS_SYS_LOCK);
|
||||
|
||||
if (delayed) return(EBUSY);
|
||||
}
|
||||
@@ -56,10 +56,10 @@ PUBLIC int do_runctl(message *m_ptr)
|
||||
/* Either set or clear the stop flag. */
|
||||
switch (action) {
|
||||
case RC_STOP:
|
||||
RTS_LOCK_SET(rp, PROC_STOP);
|
||||
RTS_LOCK_SET(rp, RTS_PROC_STOP);
|
||||
break;
|
||||
case RC_RESUME:
|
||||
RTS_LOCK_UNSET(rp, PROC_STOP);
|
||||
RTS_LOCK_UNSET(rp, RTS_PROC_STOP);
|
||||
break;
|
||||
default:
|
||||
return(EINVAL);
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
FORWARD _PROTOTYPE(int safecopy, (endpoint_t, endpoint_t, cp_grant_id_t, int, int, size_t, vir_bytes, vir_bytes, int));
|
||||
|
||||
#define HASGRANTTABLE(gr) \
|
||||
(!RTS_ISSET(gr, NO_PRIV) && priv(gr) && priv(gr)->s_grant_table > 0)
|
||||
(!RTS_ISSET(gr, RTS_NO_PRIV) && priv(gr) && priv(gr)->s_grant_table > 0)
|
||||
|
||||
/*===========================================================================*
|
||||
* verify_grant *
|
||||
|
||||
@@ -22,7 +22,7 @@ message *m_ptr;
|
||||
rp = proc_addr(who_p);
|
||||
|
||||
/* Copy grant table set in priv. struct. */
|
||||
if (RTS_ISSET(rp, NO_PRIV) || !(priv(rp))) {
|
||||
if (RTS_ISSET(rp, RTS_NO_PRIV) || !(priv(rp))) {
|
||||
r = EPERM;
|
||||
} else {
|
||||
_K_SET_GRANT_TABLE(rp,
|
||||
|
||||
@@ -75,7 +75,7 @@ message *m_ptr; /* pointer to request message */
|
||||
rp->p_reg.sp = (reg_t) frp;
|
||||
rp->p_reg.pc = (reg_t) smsg.sm_sighandler;
|
||||
|
||||
if(!RTS_ISSET(rp, PROC_STOP)) {
|
||||
if(!RTS_ISSET(rp, RTS_PROC_STOP)) {
|
||||
struct proc *caller;
|
||||
caller = proc_addr(who_p);
|
||||
kprintf("system: warning: sigsend a running process\n");
|
||||
|
||||
@@ -85,7 +85,7 @@ register message *m_ptr;
|
||||
if (isemptyp(rp)) return(EINVAL);
|
||||
switch (tr_request) {
|
||||
case T_STOP: /* stop process */
|
||||
RTS_LOCK_SET(rp, P_STOP);
|
||||
RTS_LOCK_SET(rp, RTS_P_STOP);
|
||||
rp->p_reg.psw &= ~TRACEBIT; /* clear trace bit */
|
||||
rp->p_misc_flags &= ~MF_SC_TRACE; /* clear syscall trace flag */
|
||||
return(OK);
|
||||
@@ -168,19 +168,19 @@ register message *m_ptr;
|
||||
|
||||
/* fall through */
|
||||
case T_RESUME: /* resume execution */
|
||||
RTS_LOCK_UNSET(rp, P_STOP);
|
||||
RTS_LOCK_UNSET(rp, RTS_P_STOP);
|
||||
m_ptr->CTL_DATA = 0;
|
||||
break;
|
||||
|
||||
case T_STEP: /* set trace bit */
|
||||
rp->p_reg.psw |= TRACEBIT;
|
||||
RTS_LOCK_UNSET(rp, P_STOP);
|
||||
RTS_LOCK_UNSET(rp, RTS_P_STOP);
|
||||
m_ptr->CTL_DATA = 0;
|
||||
break;
|
||||
|
||||
case T_SYSCALL: /* trace system call */
|
||||
rp->p_misc_flags |= MF_SC_TRACE;
|
||||
RTS_LOCK_UNSET(rp, P_STOP);
|
||||
RTS_LOCK_UNSET(rp, RTS_P_STOP);
|
||||
m_ptr->CTL_DATA = 0;
|
||||
break;
|
||||
|
||||
|
||||
@@ -34,13 +34,13 @@ register message *m_ptr; /* pointer to request message */
|
||||
|
||||
switch(m_ptr->SVMCTL_PARAM) {
|
||||
case VMCTL_CLEAR_PAGEFAULT:
|
||||
RTS_LOCK_UNSET(p, PAGEFAULT);
|
||||
RTS_LOCK_UNSET(p, RTS_PAGEFAULT);
|
||||
return OK;
|
||||
case VMCTL_MEMREQ_GET:
|
||||
/* Send VM the information about the memory request. */
|
||||
if(!(rp = vmrequest))
|
||||
return ESRCH;
|
||||
vmassert(RTS_ISSET(rp, VMREQUEST));
|
||||
vmassert(RTS_ISSET(rp, RTS_VMREQUEST));
|
||||
|
||||
#if 0
|
||||
printf("kernel: vm request sent by: %s / %d about %d; 0x%lx-0x%lx, wr %d, stack: %s ",
|
||||
@@ -55,9 +55,9 @@ register message *m_ptr; /* pointer to request message */
|
||||
okendpt(rp->p_vmrequest.who, &proc_nr);
|
||||
target = proc_addr(proc_nr);
|
||||
#if 0
|
||||
if(!RTS_ISSET(target, VMREQTARGET)) {
|
||||
if(!RTS_ISSET(target, RTS_VMREQTARGET)) {
|
||||
printf("set stack: %s\n", rp->p_vmrequest.stacktrace);
|
||||
minix_panic("VMREQTARGET not set for target",
|
||||
minix_panic("RTS_VMREQTARGET not set for target",
|
||||
NO_NUM);
|
||||
}
|
||||
#endif
|
||||
@@ -76,7 +76,7 @@ register message *m_ptr; /* pointer to request message */
|
||||
|
||||
return OK;
|
||||
case VMCTL_MEMREQ_REPLY:
|
||||
vmassert(RTS_ISSET(p, VMREQUEST));
|
||||
vmassert(RTS_ISSET(p, RTS_VMREQUEST));
|
||||
vmassert(p->p_vmrequest.vmresult == VMSUSPEND);
|
||||
okendpt(p->p_vmrequest.who, &proc_nr);
|
||||
target = proc_addr(proc_nr);
|
||||
@@ -95,8 +95,8 @@ register message *m_ptr; /* pointer to request message */
|
||||
p->p_vmrequest.writeflag, p->p_vmrequest.stacktrace);
|
||||
printf("type %d\n", p->p_vmrequest.type);
|
||||
|
||||
vmassert(RTS_ISSET(target, VMREQTARGET));
|
||||
RTS_LOCK_UNSET(target, VMREQTARGET);
|
||||
vmassert(RTS_ISSET(target, RTS_VMREQTARGET));
|
||||
RTS_LOCK_UNSET(target, RTS_VMREQTARGET);
|
||||
#endif
|
||||
|
||||
if(p->p_vmrequest.type == VMSTYPE_KERNELCALL) {
|
||||
@@ -106,8 +106,8 @@ register message *m_ptr; /* pointer to request message */
|
||||
} else if(p->p_vmrequest.type == VMSTYPE_DELIVERMSG) {
|
||||
vmassert(p->p_misc_flags & MF_DELIVERMSG);
|
||||
vmassert(p == target);
|
||||
vmassert(RTS_ISSET(p, VMREQUEST));
|
||||
RTS_LOCK_UNSET(p, VMREQUEST);
|
||||
vmassert(RTS_ISSET(p, RTS_VMREQUEST));
|
||||
RTS_LOCK_UNSET(p, RTS_VMREQUEST);
|
||||
} else {
|
||||
#if DEBUG_VMASSERT
|
||||
printf("suspended with stack: %s\n",
|
||||
|
||||
Reference in New Issue
Block a user