diff options
Diffstat (limited to 'sys/kern/subr_trap.c')
-rw-r--r-- | sys/kern/subr_trap.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 9f8bed0..61052d3 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -90,10 +90,6 @@ userret(td, frame, oticks) mtx_unlock(&Giant); #endif -#ifdef MAC - mac_thread_userret(td); -#endif - /* * Let the scheduler adjust our priority etc. */ @@ -184,6 +180,9 @@ ast(struct trapframe *framep) flags = ke->ke_flags; sflag = p->p_sflag; p->p_sflag &= ~(PS_ALRMPEND | PS_NEEDSIGCHK | PS_PROFPEND | PS_XCPU); +#ifdef MAC + p->p_sflag &= ~PS_MACPEND; +#endif ke->ke_flags &= ~(KEF_ASTPENDING | KEF_NEEDRESCHED | KEF_OWEUPC); cnt.v_soft++; prticks = 0; @@ -238,6 +237,10 @@ ast(struct trapframe *framep) } PROC_UNLOCK(p); } +#ifdef MAC + if (sflag & PS_MACPEND) + mac_thread_userret(td); +#endif if (flags & KEF_NEEDRESCHED) { mtx_lock_spin(&sched_lock); sched_prio(td, kg->kg_user_pri); |