PERFORCE change 103413 for review

John Birrell jb at FreeBSD.org
Tue Aug 8 00:20:57 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=103413

Change 103413 by jb at jb_freebsd2 on 2006/08/08 00:20:09

	More KSE merges.
	
	"It's everywhere!"

Affected files ...

.. //depot/projects/dtrace/src/sys/amd64/amd64/machdep.c#6 edit
.. //depot/projects/dtrace/src/sys/amd64/amd64/trap.c#6 edit
.. //depot/projects/dtrace/src/sys/amd64/amd64/vm_machdep.c#4 edit

Differences ...

==== //depot/projects/dtrace/src/sys/amd64/amd64/machdep.c#6 (text+ko) ====

@@ -1137,7 +1137,11 @@
  	 * This may be done better later if it gets more high level
  	 * components in it. If so just link td->td_proc here.
 	 */
+#ifdef KSE
+	proc_linkup(&proc0, &ksegrp0, &thread0);
+#else
 	proc_linkup(&proc0, &thread0);
+#endif
 
 	preload_metadata = (caddr_t)(uintptr_t)(modulep + KERNBASE);
 	preload_bootstrap_relocate(KERNBASE);

==== //depot/projects/dtrace/src/sys/amd64/amd64/trap.c#6 (text+ko) ====

@@ -299,6 +299,10 @@
 
 		case T_PAGEFLT:		/* page fault */
 			addr = frame.tf_addr;
+#ifdef KSE
+			if (td->td_pflags & TDP_SA)
+				thread_user_enter(td);
+#endif
 			i = trap_pfault(&frame, TRUE);
 			if (i == -1)
 				goto userout;
@@ -749,6 +753,10 @@
 	td->td_frame = &frame;
 	if (td->td_ucred != p->p_ucred) 
 		cred_update_thread(td);
+#ifdef KSE
+	if (p->p_flag & P_SA)
+		thread_user_enter(td);
+#endif
 	params = (caddr_t)frame.tf_rsp + sizeof(register_t);
 	code = frame.tf_rax;
 	orig_tf_rflags = frame.tf_rflags;

==== //depot/projects/dtrace/src/sys/amd64/amd64/vm_machdep.c#4 (text+ko) ====

@@ -244,7 +244,12 @@
  * Initialize machine state (pcb and trap frame) for a new thread about to
  * upcall. Put enough state in the new thread's PCB to get it to go back 
  * userret(), where we can intercept it again to set the return (upcall)
+ * ifdef KSE
+ * Address and stack, along with those from upcals that are from other sources
+ * such as those generated in thread_userret() itself.
+ * else
  * Address and stack, along with those from upcals that are from other sources.
+ * endif
  */
 void
 cpu_set_upcall(struct thread *td, struct thread *td0)
@@ -301,14 +306,31 @@
 }
 
 /*
+ * ifdef KSE
+ * Set that machine state for performing an upcall that has to
+ * be done in thread_userret() so that those upcalls generated
+ * in thread_userret() itself can be done as well.
+ * else
  * Modify the machine state created by cpu_set_upcall() to arrange
  * for the new thread to make a specific call as its first act.
+ * endif
  */
 void
 cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg,
 	stack_t *stack)
 {
 
+#ifdef KSE
+	/* 
+	 * Do any extra cleaning that needs to be done.
+	 * The thread may have optional components
+	 * that are not present in a fresh thread.
+	 * This may be a recycled thread so make it look
+	 * as though it's newly allocated.
+	 */
+	cpu_thread_clean(td);
+#endif
+
 	/*
 	 * Set the trap frame to point at the beginning of the uts
 	 * function.


More information about the p4-projects mailing list