Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Sep 2002 03:00:07 -0700 (PDT)
From:      Jonathan Mini <mini@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 17191 for review
Message-ID:  <200209071000.g87A077P052856@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=17191

Change 17191 by mini@mini_stylus on 2002/09/07 02:59:59

	Fix breakage from last IFC.

Affected files ...

.. //depot/projects/kse/sys/i386/i386/vm_machdep.c#65 edit
.. //depot/projects/kse/sys/kern/kern_thread.c#104 edit
.. //depot/projects/kse/sys/sys/proc.h#128 edit

Differences ...

==== //depot/projects/kse/sys/i386/i386/vm_machdep.c#65 (text+ko) ====


==== //depot/projects/kse/sys/kern/kern_thread.c#104 (text+ko) ====

@@ -301,7 +301,6 @@
 	    sizeof(ucontext_t));
 	if (error == 0) {
 		thread_getcontext(td, &uc);
-		uc.uc_busy = 0;
 		error = copyout(&uc, (caddr_t)td->td_mailbox +
 		offsetof(struct thread_mailbox, tm_context),
 		sizeof(ucontext_t));
@@ -361,7 +360,7 @@
 	KASSERT(!mtx_owned(&Giant), ("dying thread owns giant"));
 
 	if (ke->ke_tdspare != NULL) {
-		thread_free(ke->ke_tdspare);
+		thread_stash(ke->ke_tdspare);
 		ke->ke_tdspare = NULL;
 	}
 	cpu_thread_exit(td);	/* XXXSMP */
@@ -464,12 +463,13 @@
 	}
 	CTR3(KTR_PROC, "thread_schedule_upcall: thread %p (pid %d, %s)",
 	     td, td->td_proc->p_pid, td->td_proc->p_comm);
-	bzero(&td->td_startzero,
+	bzero(&td2->td_startzero,
 	    (unsigned)RANGEOF(struct thread, td_startzero, td_endzero));
 	bcopy(&td->td_startcopy, &td2->td_startcopy,
 	    (unsigned) RANGEOF(struct thread, td_startcopy, td_endcopy));
 	thread_link(td2, ke->ke_ksegrp);
 	cpu_set_upcall(td2, td->td_pcb);
+	bcopy(td->td_frame, td2->td_frame, sizeof(struct trapframe));
 	/*
 	 * The user context for this thread is selected when we choose
 	 * a KSE and return to userland on it. All we need do here is
@@ -507,7 +507,7 @@
 thread_consider_upcalling(struct proc *p, struct ksegrp *kg, struct kse *ke,
     struct thread *td, struct trapframe *frame)
 {
-	int discard, error;
+	int error;
 
 	/*
 	 * Save the thread's context, and link it

==== //depot/projects/kse/sys/sys/proc.h#128 (text+ko) ====

@@ -269,7 +269,6 @@
 #define	td_startzero td_flags
 	int		td_flags;	/* (j) TDF_* flags. */
 	struct kse	*td_last_kse;	/* Where it wants to be if possible. */
-	struct kse	*td_kse;	/* Current KSE if running. */
 	int		td_dupfd;	/* (k) Ret value from fdopen. XXX */
 	void		*td_wchan;	/* (j) Sleep address. */
 	const char	*td_wmesg;	/* (j) Reason for sleep. */
@@ -283,15 +282,16 @@
 	LIST_HEAD(, mtx) td_contested;	/* (j) Contested locks. */
 	struct lock_list_entry *td_sleeplocks; /* (k) Held sleep locks. */
 	int		td_intr_nesting_level; /* (k) Interrupt recursion. */
-	void 		*td_mailbox;	/* the userland mailbox address */
 	struct ucred	*td_ucred;	/* (k) Reference to credentials. */
 	void		(*td_switchin)(void); /* (k) switchin special func */
 	u_int		td_critnest;	/* (k) Critical section nest level. */
-#define	td_endzero td_md
+#define	td_endzero td_kse
 
 /* Copied during fork1() or thread_sched_upcall() */
-#define	td_startcopy td_endzero
+#define	td_startcopy td_kse
 	/* XXXKSE just copying td_md needs checking! */
+	struct kse	*td_kse;	/* Current KSE if running. */
+	void		*td_mailbox;	/* the userland mailbox address */
 	struct mdthread td_md;		/* (k) Any machine-dependent fields. */
 	u_char		td_base_pri;	/* (j) Thread base kernel priority. */
 	u_char		td_priority;	/* (j) Thread active priority. */

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?200209071000.g87A077P052856>