Delete struct proc p_mtx lock

Usage of this lock is highly dangerous since agents may assume that this
lock is actually used for process management.  There is only one process
in RTEMS.
This commit is contained in:
Sebastian Huber 2013-10-10 14:33:05 +02:00
parent 0bcf34156b
commit 3842b81723
4 changed files with 6 additions and 5 deletions

View File

@ -264,10 +264,15 @@ crypto_terminate(struct proc **pp, void *q)
*pp = NULL;
if (p) {
wakeup_one(q);
#ifndef __rtems__
PROC_LOCK(p); /* NB: insure we don't miss wakeup */
CRYPTO_DRIVER_UNLOCK(); /* let crypto_finis progress */
msleep(p, &p->p_mtx, PWAIT, "crypto_destroy", 0);
PROC_UNLOCK(p);
#else /* __rtems__ */
/* FIXME: The hacks with the PROC_LOCK() do not work on RTEMS */
BSD_ASSERT(0);
#endif /* __rtems__ */
CRYPTO_DRIVER_LOCK();
}
}

View File

@ -576,7 +576,6 @@ struct proc {
struct cv p_pwait; /* (*) wait cv for exit/exec */
#else /* __rtems__ */
struct ucred *p_ucred; /* (c) Process owner's identity. */
struct mtx p_mtx; /* (n) Lock for this struct. */
rtems_id p_pid;
int p_fibnum; /* in this routing domain XXX MRT */
#endif /* __rtems__ */

View File

@ -662,9 +662,7 @@ kern_sendit(td, s, mp, flags, control, segflg)
/* Generation of SIGPIPE can be controlled per socket */
if (error == EPIPE && !(so->so_options & SO_NOSIGPIPE) &&
!(flags & MSG_NOSIGNAL)) {
PROC_LOCK(td->td_proc);
killinfo(td->td_proc->p_pid, SIGPIPE, NULL);
PROC_UNLOCK(td->td_proc);
killinfo(td->td_proc->p_pid, SIGPIPE, NULL);
}
}
if (error == 0)

View File

@ -216,7 +216,6 @@ rtems_bsd_threads_init(void *arg __unused)
FIXME_ucred.cr_ngroups = 1; /* group 0 */
FIXME_proc.p_ucred = crhold(&FIXME_ucred);
mtx_init(&FIXME_proc.p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK);
FIXME_proc.p_pid = getpid();
FIXME_proc.p_fibnum = 0;
}