summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2002-02-19 03:23:28 +0000
committerjulian <julian@FreeBSD.org>2002-02-19 03:23:28 +0000
commit4efc87c9d906fc48d76e16892e78ebdc5e055854 (patch)
tree6ab39684f2f2c31dc52b78bc35ddaf99b623a04b
parent4ae0ccfba4f14d8392978611ec28e01ac3560077 (diff)
downloadFreeBSD-src-4efc87c9d906fc48d76e16892e78ebdc5e055854.zip
FreeBSD-src-4efc87c9d906fc48d76e16892e78ebdc5e055854.tar.gz
Catch up with i386 change I forgot to commit.
-rw-r--r--sys/sparc64/sparc64/trap.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/sparc64/sparc64/trap.c b/sys/sparc64/sparc64/trap.c
index f52ac58..b6f47bb 100644
--- a/sys/sparc64/sparc64/trap.c
+++ b/sys/sparc64/sparc64/trap.c
@@ -176,9 +176,8 @@ trap(struct trapframe *tf)
sticks = td->td_kse->ke_sticks;
td->td_frame = tf;
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);
} else {
sticks = 0;
if ((type & ~T_KERNEL) != T_BREAKPOINT)
@@ -380,10 +379,12 @@ trapsig:
user:
userret(td, tf, sticks);
mtx_assert(&Giant, MA_NOTOWNED);
+#ifdef INVARIANTS
mtx_lock(&Giant);
crfree(td->td_ucred);
mtx_unlock(&Giant);
td->td_ucred = NULL;
+#endif
out:
CTR1(KTR_TRAP, "trap: td=%p return", td);
return;
@@ -540,9 +541,8 @@ syscall(struct trapframe *tf)
sticks = td->td_kse->ke_sticks;
td->td_frame = tf;
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);
code = tf->tf_global[1];
/*
@@ -677,10 +677,12 @@ bad:
*/
STOPEVENT(p, S_SCX, code);
+#ifdef INVARIANTS
mtx_lock(&Giant);
crfree(td->td_ucred);
mtx_unlock(&Giant);
td->td_ucred = NULL;
+#endif
#ifdef WITNESS
if (witness_list(td)) {
panic("system call %s returning with mutex(s) held\n",
OpenPOWER on IntegriCloud