From owner-p4-projects Wed Apr 10 3:16:41 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6AE4837B416; Wed, 10 Apr 2002 03:16:33 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id BDCBE37B419 for ; Wed, 10 Apr 2002 03:16:32 -0700 (PDT) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g3AAGWP30314 for perforce@freebsd.org; Wed, 10 Apr 2002 03:16:32 -0700 (PDT) (envelope-from peter@freebsd.org) Date: Wed, 10 Apr 2002 03:16:32 -0700 (PDT) Message-Id: <200204101016.g3AAGWP30314@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm Subject: PERFORCE change 9499 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=9499 Change 9499 by peter@peter_thunder on 2002/04/10 03:15:52 Ugh! Deal with bde's signal changes that moved signal posting from userret to ast(). For the normal syscall path, ia64 does not call ast() before returning to userland. This makes tcsh etc die horribly when sigsuspend() returns EINTR without fetching the signal. Failing to call ast() would explain some other anomolies too. This is embarresing. Temporarily put back the guts of what userret() used to do, but this time in the bottom of syscall() itself. :-( This fixes signals, but not the rest. Maybe a better hack would be to call ast() from the bottom of syscall for the FRAME_SYSCALL case. Affected files ... ... //depot/projects/ia64/sys/ia64/ia64/trap.c#18 edit Differences ... ==== //depot/projects/ia64/sys/ia64/ia64/trap.c#18 (text+ko) ==== @@ -860,6 +860,36 @@ */ STOPEVENT(p, S_SCX, code); + /* + * Deal with the fact that we do not call ast() if we are + * just returning from a syscall frame. Sigh. + */ + if (framep->tf_flags & FRAME_SYSCALL) { + int sig; + mtx_lock(&Giant); + PROC_LOCK(p); + while ((sig = CURSIG(p)) != 0) + postsig(sig); + PROC_UNLOCK(p); + mtx_unlock(&Giant); + + mtx_lock_spin(&sched_lock); + td->td_priority = td->td_ksegrp->kg_user_pri; + if (td->td_kse->ke_flags & KEF_NEEDRESCHED) { + setrunqueue(td); + p->p_stats->p_ru.ru_nivcsw++; + mi_switch(); + mtx_unlock_spin(&sched_lock); + mtx_lock(&Giant); + PROC_LOCK(p); + while ((sig = CURSIG(p)) != 0) + postsig(sig); + PROC_UNLOCK(p); + mtx_unlock(&Giant); + } else + mtx_unlock_spin(&sched_lock); + } + #ifdef DIAGNOSTIC cred_free_thread(td); #endif To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message