From 788b1fc17a2f0aba5c55ff68bf407ac8e137eafa Mon Sep 17 00:00:00 2001 From: davidxu Date: Sat, 28 Jun 2003 08:29:05 +0000 Subject: 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) --- sys/kern/subr_trap.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'sys/kern/subr_trap.c') 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); -- cgit v1.1