Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Apr 2002 03:16:32 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 9499 for review
Message-ID:  <200204101016.g3AAGWP30314@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204101016.g3AAGWP30314>