diff options
author | julian <julian@FreeBSD.org> | 2002-02-19 03:27:08 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2002-02-19 03:27:08 +0000 |
commit | cb1f971d38eb5c0a1668d793ccb74fbe607f53d0 (patch) | |
tree | f03b5815be37fd043e335136700180d41bb23bf7 | |
parent | 4efc87c9d906fc48d76e16892e78ebdc5e055854 (diff) | |
download | FreeBSD-src-cb1f971d38eb5c0a1668d793ccb74fbe607f53d0.zip FreeBSD-src-cb1f971d38eb5c0a1668d793ccb74fbe607f53d0.tar.gz |
Add change to teh PPC to keep it in step with i386 and MI code
Pointy hat this direction please...
-rw-r--r-- | sys/powerpc/aim/trap.c | 7 | ||||
-rw-r--r-- | sys/powerpc/powerpc/trap.c | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/sys/powerpc/aim/trap.c b/sys/powerpc/aim/trap.c index cd3fb5c..6526709 100644 --- a/sys/powerpc/aim/trap.c +++ b/sys/powerpc/aim/trap.c @@ -227,9 +227,8 @@ trap(struct trapframe *frame) sticks = td->td_kse->ke_sticks; td->td_frame = frame; KASSERT(td->td_ucred == NULL, ("already have a ucred")); - PROC_LOCK(p); - td->td_ucred = crhold(p->p_ucred); - PROC_UNLOCK(p); + if (td->td_ucred != p->p_ucred) + cred_update_thread(td); /* User Mode Traps */ switch (type) { @@ -297,10 +296,12 @@ trap(struct trapframe *frame) } userret(td, frame, sticks); mtx_assert(&Giant, MA_NOTOWNED); +#ifdef INVARIANTS mtx_lock(&Giant); crfree(td->td_ucred); mtx_unlock(&Giant); td->td_ucred = NULL; +#endif } void diff --git a/sys/powerpc/powerpc/trap.c b/sys/powerpc/powerpc/trap.c index cd3fb5c..6526709 100644 --- a/sys/powerpc/powerpc/trap.c +++ b/sys/powerpc/powerpc/trap.c @@ -227,9 +227,8 @@ trap(struct trapframe *frame) sticks = td->td_kse->ke_sticks; td->td_frame = frame; KASSERT(td->td_ucred == NULL, ("already have a ucred")); - PROC_LOCK(p); - td->td_ucred = crhold(p->p_ucred); - PROC_UNLOCK(p); + if (td->td_ucred != p->p_ucred) + cred_update_thread(td); /* User Mode Traps */ switch (type) { @@ -297,10 +296,12 @@ trap(struct trapframe *frame) } userret(td, frame, sticks); mtx_assert(&Giant, MA_NOTOWNED); +#ifdef INVARIANTS mtx_lock(&Giant); crfree(td->td_ucred); mtx_unlock(&Giant); td->td_ucred = NULL; +#endif } void |