summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_trap.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2003-06-28 08:29:05 +0000
committerdavidxu <davidxu@FreeBSD.org>2003-06-28 08:29:05 +0000
commit788b1fc17a2f0aba5c55ff68bf407ac8e137eafa (patch)
treefff12c2b9ef86698c8eec8842a317f437946cfc3 /sys/kern/subr_trap.c
parentdf569db8a679e7bfa0fa1c6792a60f149cc1e235 (diff)
downloadFreeBSD-src-788b1fc17a2f0aba5c55ff68bf407ac8e137eafa.zip
FreeBSD-src-788b1fc17a2f0aba5c55ff68bf407ac8e137eafa.tar.gz
o Change kse_thr_interrupt to allow send a signal to a specified thread,
or unblock a thread in kernel, and allow UTS to specify whether syscall should be restarted. o Add ability for UTS to monitor signal comes in and removed from process, the flag PS_SIGEVENT is used to indicate the events. o Add a KMF_WAITSIGEVENT for KSE mailbox flag, UTS call kse_release with this flag set to wait for above signal event. o For SA based thread, kernel masks all signal in its signal mask, let UTS to use kse_thr_interrupt interrupt a thread, and install a signal frame in userland for the thread. o Add a tm_syncsig in thread mailbox, when a hardware trap occurs, it is used to deliver synchronous signal to userland, and upcall is schedule, so UTS can process the synchronous signal for the thread. Reviewed by: julian (mentor)
Diffstat (limited to 'sys/kern/subr_trap.c')
-rw-r--r--sys/kern/subr_trap.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c
index b2262de..3c0a760 100644
--- a/sys/kern/subr_trap.c
+++ b/sys/kern/subr_trap.c
@@ -176,7 +176,7 @@ ast(struct trapframe *framep)
p->p_sflag &= ~PS_MACPEND;
#endif
td->td_flags &= ~(TDF_ASTPENDING | TDF_NEEDSIGCHK |
- TDF_NEEDRESCHED | TDF_OWEUPC);
+ TDF_NEEDRESCHED | TDF_OWEUPC | TDF_INTERRUPT);
cnt.v_soft++;
prticks = 0;
if (flags & TDF_OWEUPC && p->p_flag & P_PROFIL) {
@@ -243,25 +243,12 @@ ast(struct trapframe *framep)
mtx_unlock_spin(&sched_lock);
}
if (flags & TDF_NEEDSIGCHK) {
- int sigs;
-
- sigs = 0;
PROC_LOCK(p);
mtx_lock(&p->p_sigacts->ps_mtx);
- while ((sig = cursig(td)) != 0) {
+ while ((sig = cursig(td)) != 0)
postsig(sig);
- sigs++;
- }
mtx_unlock(&p->p_sigacts->ps_mtx);
PROC_UNLOCK(p);
- if ((td->td_flags & TDF_SA) && sigs) {
- struct kse_upcall *ku = td->td_upcall;
- if ((void *)TRAPF_PC(framep) != ku->ku_func) {
- mtx_lock_spin(&sched_lock);
- ku->ku_flags |= KUF_DOUPCALL;
- mtx_unlock_spin(&sched_lock);
- }
- }
}
userret(td, framep, sticks);
OpenPOWER on IntegriCloud