summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/trap.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index 57d1dea..751d5f5 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -257,13 +257,6 @@ trap(frame)
sticks = td->td_kse->ke_sticks;
td->td_frame = &frame;
-#ifdef DIAGNOSTIC
- /* see the comment in ast() */
- if (td->td_ucred != NULL)
- panic("trap(): thread got a ucred while in userspace");
- td->td_ucred = td->td_ucred_cache;
- td->td_ucred_cache = NULL;
-#endif
if (td->td_ucred != p->p_ucred)
cred_update_thread(td);
@@ -651,12 +644,9 @@ user:
userret(td, &frame, sticks);
mtx_assert(&Giant, MA_NOTOWNED);
userout:
-#ifdef DIAGNOSTIC /* see the comment in ast() */
- if (td->td_ucred_cache)
- panic("trap:thread already has cached ucred");
- td->td_ucred_cache = td->td_ucred;
- td->td_ucred = NULL;
-#endif /* DIAGNOSTIC */
+#ifdef DIAGNOSTIC
+ cred_free_thread(td);
+#endif
out:
return;
}
@@ -964,12 +954,6 @@ syscall(frame)
sticks = td->td_kse->ke_sticks;
td->td_frame = &frame;
-#ifdef DIAGNOSTIC /* see the comment in ast() */
- if (td->td_ucred)
- panic("trap:thread got a cred while userspace");
- td->td_ucred = td->td_ucred_cache;
- td->td_ucred_cache = NULL;
-#endif /* DIAGNOSTIC */
if (td->td_ucred != p->p_ucred)
cred_update_thread(td);
params = (caddr_t)frame.tf_esp + sizeof(int);
@@ -1114,12 +1098,9 @@ bad:
*/
STOPEVENT(p, S_SCX, code);
-#ifdef DIAGNOSTIC /* see the comment in ast() */
- if (td->td_ucred_cache)
- panic("syscall:thread already has cached ucred");
- td->td_ucred_cache = td->td_ucred;
- td->td_ucred = NULL;
-#endif /* DIAGNOSTIC */
+#ifdef DIAGNOSTIC
+ cred_free_thread(td);
+#endif
#ifdef WITNESS
if (witness_list(td)) {
OpenPOWER on IntegriCloud