Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_trap.c
Context not available. | |||||
#ifdef KTRACE | #ifdef KTRACE | ||||
KTRUSERRET(td); | KTRUSERRET(td); | ||||
#endif | #endif | ||||
td_softdep_cleanup(td); | td_softdep_cleanup(td); | ||||
MPASS(td->td_su == NULL); | MPASS(td->td_su == NULL); | ||||
Context not available. | |||||
{ | { | ||||
struct thread *td; | struct thread *td; | ||||
struct proc *p; | struct proc *p; | ||||
uint32_t oldval; | int flags, sig; | ||||
int flags, sig, res; | |||||
td = curthread; | td = curthread; | ||||
p = td->td_proc; | p = td->td_proc; | ||||
Context not available. | |||||
*/ | */ | ||||
if (flags & TDF_NEEDSIGCHK || p->p_pendingcnt > 0 || | if (flags & TDF_NEEDSIGCHK || p->p_pendingcnt > 0 || | ||||
!SIGISEMPTY(p->p_siglist)) { | !SIGISEMPTY(p->p_siglist)) { | ||||
fetch_sigfastblock(td); | sigfastblock_fetch(td); | ||||
PROC_LOCK(p); | PROC_LOCK(p); | ||||
mtx_lock(&p->p_sigacts->ps_mtx); | mtx_lock(&p->p_sigacts->ps_mtx); | ||||
if ((td->td_pflags & TDP_SIGFASTBLOCK) != 0 && | if ((td->td_pflags & TDP_SIGFASTBLOCK) != 0 && | ||||
Context not available. | |||||
* Handle deferred update of the fast sigblock value, after | * Handle deferred update of the fast sigblock value, after | ||||
* the postsig() loop was performed. | * the postsig() loop was performed. | ||||
*/ | */ | ||||
if (td->td_pflags & TDP_SIGFASTPENDING) { | if (td->td_pflags & TDP_SIGFASTPENDING) | ||||
td->td_pflags &= ~TDP_SIGFASTPENDING; | sigfastblock_setpend(td); | ||||
res = fueword32(td->td_sigblock_ptr, &oldval); | |||||
if (res == -1) { | |||||
fetch_sigfastblock_failed(td, false); | |||||
} else { | |||||
for (;;) { | |||||
oldval |= SIGFASTBLOCK_PEND; | |||||
res = casueword32(td->td_sigblock_ptr, oldval, | |||||
&oldval, oldval | SIGFASTBLOCK_PEND); | |||||
if (res == -1) { | |||||
fetch_sigfastblock_failed(td, true); | |||||
break; | |||||
} | |||||
if (res == 0) { | |||||
td->td_sigblock_val = oldval & | |||||
~SIGFASTBLOCK_FLAGS; | |||||
break; | |||||
} | |||||
MPASS(res == 1); | |||||
res = thread_check_susp(td, false); | |||||
if (res != 0) | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
/* | /* | ||||
* We need to check to see if we have to exit or wait due to a | * We need to check to see if we have to exit or wait due to a | ||||
Context not available. |