Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jun 2002 18:43:16 -0700 (PDT)
From:      Jake Burkholder <jake@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 12957 for review
Message-ID:  <200206150143.g5F1hGq08806@freefall.freebsd.org>

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

Change 12957 by jake@jake_k7 on 2002/06/14 18:42:17

	Compile on sparc64.

Affected files ...

... //depot/projects/kse/sys/sparc64/include/kse.h#1 add
... //depot/projects/kse/sys/sparc64/sparc64/genassym.c#26 edit
... //depot/projects/kse/sys/sparc64/sparc64/swtch.s#17 edit
... //depot/projects/kse/sys/sparc64/sparc64/trap.c#29 edit
... //depot/projects/kse/sys/sparc64/sparc64/vm_machdep.c#24 edit

Differences ...

==== //depot/projects/kse/sys/sparc64/sparc64/genassym.c#26 (text+ko) ====

@@ -232,6 +232,8 @@
 ASSYM(TD_KSTACK, offsetof(struct thread, td_kstack));
 ASSYM(TD_PCB, offsetof(struct thread, td_pcb));
 ASSYM(TD_PROC, offsetof(struct thread, td_proc));
+ASSYM(TD_STATE, offsetof(struct thread, td_state));
+ASSYM(TDS_RUNNING, TDS_RUNNING);
 
 ASSYM(PCB_SIZEOF, sizeof(struct pcb));
 ASSYM(PCB_FPSTATE, offsetof(struct pcb, pcb_fpstate));

==== //depot/projects/kse/sys/sparc64/sparc64/swtch.s#17 (text+ko) ====

@@ -109,6 +109,9 @@
 	stx	%o0, [PCPU(CURTHREAD)]
 	stx	%o1, [PCPU(CURPCB)]
 
+	mov	TDS_RUNNING, %o2
+	stw	%o2, [%o0 + TD_STATE]
+
 	SET(sched_lock, %o3, %o2)
 	stx	%o0, [%o2 + MTX_LOCK]
 

==== //depot/projects/kse/sys/sparc64/sparc64/trap.c#29 (text+ko) ====

@@ -49,6 +49,7 @@
 #include <sys/bus.h>
 #include <sys/interrupt.h>
 #include <sys/ktr.h>
+#include <sys/kse.h>
 #include <sys/lock.h>
 #include <sys/mutex.h>
 #include <sys/systm.h>
@@ -190,6 +191,10 @@
 		td->td_frame = tf;
 		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;
 if ((type & ~T_KERNEL) != T_BREAKPOINT)
@@ -528,6 +533,23 @@
 	td->td_frame = tf;
 	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, kmbx_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;
+		}
+	}
 	code = tf->tf_global[1];
 
 	/*

==== //depot/projects/kse/sys/sparc64/sparc64/vm_machdep.c#24 (text+ko) ====

@@ -86,6 +86,42 @@
 	}
 }
 
+void
+cpu_thread_exit(struct thread *td)
+{
+}
+
+void
+cpu_thread_setup(struct thread *td)
+{
+}
+
+void
+cpu_save_upcall(struct thread *td, struct kse *newkse)
+{
+}
+
+void
+cpu_set_upcall(struct thread *td, void *pcb)
+{
+}
+
+void
+cpu_set_args(struct thread *td, struct kse *ke)
+{
+}
+
+void
+cpu_free_kse_mdstorage(struct kse *ke)
+{
+}
+
+int
+cpu_export_context(struct thread *td)
+{
+	return (0);
+}
+
 /*
  * Finish a fork operation, with process p2 nearly set up.
  * Copy and update the pcb, set up the stack so that the child

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?200206150143.g5F1hGq08806>