Kernel changes:

- reinstalled priority changing, now in sched() and unready()
- reinstalled check on message buffer in sys_call()
- reinstalled check in send masks in sys_call()
- changed do_fork() to get new privilege structure for SYS_PROCs
- removed some processes from boot image---will be dynamically started later
This commit is contained in:
Jorrit Herder
2005-07-26 12:48:34 +00:00
parent 153fdabb26
commit 8866b4d0ef
15 changed files with 160 additions and 124 deletions

View File

@@ -27,6 +27,7 @@ register message *m_ptr; /* pointer to request message */
#endif
register struct proc *rpc; /* child process pointer */
struct proc *rpp; /* parent process pointer */
int i;
rpp = proc_addr(m_ptr->PR_PPROC_NR);
rpc = proc_addr(m_ptr->PR_PROC_NR);
@@ -51,6 +52,16 @@ register message *m_ptr; /* pointer to request message */
rpc->p_user_time = 0; /* set all the accounting times to 0 */
rpc->p_sys_time = 0;
/* If this is a system process, make sure the child process gets its own
* privilege structure for accounting.
*/
if (priv(rpc)->s_flags & SYS_PROC) {
if (OK != (i=get_priv(rpc, SYS_PROC))) return(i); /* get structure */
for (i=0; i< BITMAP_CHUNKS(NR_SYS_PROCS); i++) /* remove pending: */
priv(rpc)->s_notify_pending.chunk[i] = 0; /* - notifications */
priv(rpc)->s_int_pending = 0; /* - interrupts */
sigemptyset(&priv(rpc)->s_sig_pending); /* - signals */
}
return(OK);
}

View File

@@ -22,6 +22,7 @@ message *m_ptr; /* pointer to request message */
register struct proc *rp;
register struct priv *sp;
int proc_nr;
int i;
/* Extract message parameters. */
proc_nr = m_ptr->CTL_PROC_NR;
@@ -32,10 +33,23 @@ message *m_ptr; /* pointer to request message */
/* Make sure this process has its own privileges structure. */
if (! (priv(rp)->s_flags & SYS_PROC))
set_priv(rp, SYS_PROC);
get_priv(rp, SYS_PROC);
/* Now update the process' privileges as requested. */
rp->p_priv->s_call_mask = SYSTEM_CALL_MASK;
rp->p_priv->s_call_mask = FILLED_MASK;
for (i=0; i<BITMAP_CHUNKS(NR_SYS_PROCS); i++) {
rp->p_priv->s_send_mask.chunk[i] = FILLED_MASK;
}
unset_sys_bit(rp->p_priv->s_send_mask, USER_PRIV_ID);
/* All process that this process can send to must be able to reply.
* Therefore, their send masks should be updated as well.
*/
for (i=0; i<NR_SYS_PROCS; i++) {
if (get_sys_bit(rp->p_priv->s_send_mask, i)) {
set_sys_bit(priv_addr(i)->s_send_mask, priv_id(rp));
}
}
return(OK);
}

View File

@@ -60,7 +60,7 @@ register message *m_ptr;
if (rp->p_memmap[T].mem_len != 0) {
if ((src = umap_local(rp, T, tr_addr, TR_VLSIZE)) == 0) return(EIO);
phys_copy(src, vir2phys(&tr_data), (phys_bytes) sizeof(long));
m_ptr->CTL_DATA= tr_data;
m_ptr->CTL_DATA = tr_data;
break;
}
/* Text space is actually data space - fall through. */