diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-04-26 15:05:52 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-04-26 16:06:43 +0200 |
commit | 4c0c5fdb5f1b358d53edca10479d758557a8dbb1 (patch) | |
tree | 324fad2b1f49377a645975527cba230b79b02232 /rtemsbsd | |
parent | Remove rusage dependencies (diff) | |
download | rtems-libbsd-4c0c5fdb5f1b358d53edca10479d758557a8dbb1.tar.bz2 |
Remove proc0 creation
Diffstat (limited to 'rtemsbsd')
-rw-r--r-- | rtemsbsd/src/rtems-bsd-mutex.c | 1 | ||||
-rw-r--r-- | rtemsbsd/src/rtems-bsd-synch.c | 6 | ||||
-rw-r--r-- | rtemsbsd/src/rtems-bsd-thread.c | 8 |
3 files changed, 4 insertions, 11 deletions
diff --git a/rtemsbsd/src/rtems-bsd-mutex.c b/rtemsbsd/src/rtems-bsd-mutex.c index 804a765d..c87d128a 100644 --- a/rtemsbsd/src/rtems-bsd-mutex.c +++ b/rtemsbsd/src/rtems-bsd-mutex.c @@ -310,5 +310,4 @@ void mutex_init(void) { mtx_init(&Giant, "Giant", NULL, MTX_DEF | MTX_RECURSE); - mtx_init(&proc0.p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK); } diff --git a/rtemsbsd/src/rtems-bsd-synch.c b/rtemsbsd/src/rtems-bsd-synch.c index 1f8beda7..1f78b840 100644 --- a/rtemsbsd/src/rtems-bsd-synch.c +++ b/rtemsbsd/src/rtems-bsd-synch.c @@ -176,19 +176,16 @@ int _sleep(void *ident, struct lock_object *lock, int priority, const char *wmesg, int timo) { struct thread *td; - struct proc *p; struct lock_class *class; int catch, flags, lock_state, pri, rval; td = curthread; - p = td->td_proc; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) ktrcsw(1, 0); #endif KASSERT(timo != 0 || mtx_owned(&Giant) || lock != NULL, ("sleeping without a lock")); - KASSERT(p != NULL, ("msleep1")); KASSERT(ident != NULL && TD_IS_RUNNING(td), ("msleep")); if (priority & PDROP) KASSERT(lock != NULL && lock != &Giant.lock_object, @@ -214,9 +211,6 @@ _sleep(void *ident, struct lock_object *lock, int priority, const char *wmesg, i catch = priority & PCATCH; pri = priority & PRIMASK; - CTR5(KTR_PROC, "sleep: thread %ld (pid %ld, %s) on %s (%p)", - td->td_tid, p->p_pid, td->td_name, wmesg, ident); - if (lock == &Giant.lock_object) mtx_assert(&Giant, MA_OWNED); DROP_GIANT(); diff --git a/rtemsbsd/src/rtems-bsd-thread.c b/rtemsbsd/src/rtems-bsd-thread.c index d1a3cafe..2ac502cf 100644 --- a/rtemsbsd/src/rtems-bsd-thread.c +++ b/rtemsbsd/src/rtems-bsd-thread.c @@ -31,10 +31,12 @@ RTEMS_CHAIN_DEFINE_EMPTY(rtems_bsd_thread_chain); +/* FIXME: What to do with the credentials? */ +static struct ucred FIXME_ucred; + static int rtems_bsd_thread_start(struct thread **td_ptr, void (*func)(void *), void *arg, int flags, int pages, const char *fmt, va_list ap) { - struct proc *p = &proc0;; struct thread *td = malloc(sizeof(struct thread), M_TEMP, M_WAITOK | M_ZERO); if (td != NULL) { @@ -86,9 +88,7 @@ rtems_bsd_thread_start(struct thread **td_ptr, void (*func)(void *), void *arg, td->td_id = id; vsnprintf(td->td_name, sizeof(td->td_name), fmt, ap); - bzero(&td->td_ru, sizeof(td->td_ru)); - td->td_ucred = crhold(p->p_ucred); - td->td_proc = p; + td->td_ucred = &FIXME_ucred; rtems_chain_append(&rtems_bsd_thread_chain, &td->td_node); |