Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 May 2002 15:08:26 -0700 (PDT)
From:      Julian Elischer <julian@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 12226 for review
Message-ID:  <200205312208.g4VM8Q506888@freefall.freebsd.org>

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

Change 12226 by julian@julian_ref on 2002/05/31 15:07:26

	Alpha additions (incomplete) coutesy of 
	Bernd Walter <ticso@cicely5.cicely.de>

Affected files ...

... //depot/projects/kse/sys/alpha/alpha/genassym.c#15 edit
... //depot/projects/kse/sys/alpha/alpha/swtch.s#11 edit
... //depot/projects/kse/sys/alpha/alpha/trap.c#23 edit
... //depot/projects/kse/sys/alpha/alpha/vm_machdep.c#22 edit
... //depot/projects/kse/sys/alpha/include/kse.h#1 add
... //depot/projects/kse/sys/i386/include/kse.h#4 edit
... //depot/projects/kse/sys/kern/kern_thread.c#54 edit

Differences ...

==== //depot/projects/kse/sys/alpha/alpha/genassym.c#15 (text+ko) ====

@@ -80,6 +80,8 @@
 ASSYM(TD_PCB, offsetof(struct thread, td_pcb));
 ASSYM(TD_KSE, offsetof(struct thread, td_kse));
 ASSYM(TD_PROC, offsetof(struct thread, td_proc));
+ASSYM(TD_STATE, offsetof(struct thread, td_state));
+ASSYM(TDS_RUNNING, TDS_RUNNING);
 
 ASSYM(KE_FLAGS, offsetof(struct kse, ke_flags));
 

==== //depot/projects/kse/sys/alpha/alpha/swtch.s#11 (text+ko) ====

@@ -127,6 +127,9 @@
 	mov	v0, s2				/* s2 = new thread */
 	ldq	s3, TD_MD_PCBPADDR(s2)		/* s3 = new pcbpaddr */
 
+	ldiq	t0, TDS_RUNNING
+	stl	t0, TD_STATE(s2)
+
 	/*
 	 * Check to see if we're switching to ourself.  If we are,
 	 * don't bother loading the new context.

==== //depot/projects/kse/sys/alpha/alpha/trap.c#23 (text+ko) ====

@@ -39,6 +39,7 @@
 #include <sys/sysproto.h>
 #include <sys/kernel.h>
 #include <sys/proc.h>
+#include <sys/kse.h>
 #include <sys/exec.h>
 #include <sys/lock.h>
 #include <sys/mutex.h>
@@ -299,6 +300,10 @@
 		td->td_frame = framep;
 		if (td->td_ucred != p->p_ucred)
 			cred_update_thread(td);
+		if ((p->p_flag & P_WEXIT) && (p->p_singlethread != td)) {
+			thread_exit();
+			/* NOTREACHED */
+		}
 	} else {
 		sticks = 0;		/* XXX bogus -Wuninitialized warning */
 		KASSERT(cold || td->td_ucred != NULL,
@@ -659,6 +664,23 @@
 	sticks = td->td_kse->ke_sticks;
 	if (td->td_ucred != p->p_ucred)
 		cred_update_thread(td);
+	if (p->p_flag & P_KSES) {
+		/*
+		 * If we are doing a syscall in a KSE environment,
+		 * note where our mailbox is. There is always the
+		 * possibility that we could do this lazily (in sleep()),
+		 * but for now do it every time.
+		 */
+		td->td_mailbox = (void *)fuword((caddr_t)td->td_kse->ke_mailbox
+		    + offsetof(struct kse_mailbox, current_thread));
+		if ((td->td_mailbox == NULL) ||
+		    (td->td_mailbox == (void *)-1)) {
+			td->td_mailbox = NULL;  /* single thread it.. */
+			td->td_flags &= ~TDF_UNBOUND;
+		} else {
+			td->td_flags |= TDF_UNBOUND;
+		}
+	}
 
 #ifdef DIAGNOSTIC
 	alpha_fpstate_check(td);

==== //depot/projects/kse/sys/alpha/alpha/vm_machdep.c#22 (text+ko) ====

@@ -240,11 +240,63 @@
  * from proc0.
  */
 void
-cpu_exit(td)
-	register struct thread *td;
+cpu_exit(struct thread *td)
+{
+	/* KSEXXX */
+	alpha_fpstate_drop(td);
+}
+
+void
+cpu_thread_exit(struct thread *td)
+{
+	/* KSEXXX */
+}
+
+void
+cpu_thread_setup(struct thread *td)
+{
+	/* KSEXXX */
+}
+
+/* KSEXXX */
+struct md_store {
+	struct pcb mds_pcb;
+	struct trapframe mds_frame;
+};
+
+void
+cpu_save_upcall(struct thread *td, struct kse *newkse)
+{
+	/* KSEXXX */
+}
+
+void
+cpu_set_upcall(struct thread *td, void *pcb)
+{
+	/* KSEXXX */
+}
+
+/*
+ * Set the return value for returning upcalls.
+ * We should be able to do this ahead of time in cpu_save_upcall().
+ * doing it once there instead of N times in the upcall path
+ */
+void
+cpu_set_retval(struct thread *td, int retval, int aux, int success)
+{
+	/* KSEXXX */
+}
+
+void
+cpu_free_kse_mdstorage(struct kse *kse)
 {
+	/* KSEXXX */
+}
 
-	alpha_fpstate_drop(td);
+int
+cpu_export_context(struct thread *td)
+{
+	/* KSEXXX */
 }
 
 void

==== //depot/projects/kse/sys/i386/include/kse.h#4 (text+ko) ====

@@ -34,15 +34,6 @@
 #include <machine/ucontext.h>
 
 union kse_td_ctx {
-	struct {
-		int			if_onstack;
-		struct intrframe	if_if;
-	} intrfrm;
-	struct {
-		int			tf_onstack;
-		int			tf_gs;
-		struct trapframe	tf_tf;
-	} tfrm;
 	mcontext_t	mcontext;
 };
 

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

@@ -269,7 +269,7 @@
 		error = td2_mbx = fuword(addr1);
 		if (error == -1)
 			error = EFAULT;
-		else 
+		else
 			error = 0;
 	}
 	if (!error)

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?200205312208.g4VM8Q506888>