PERFORCE change 64394 for review

Peter Wemm peter at FreeBSD.org
Fri Nov 5 16:37:54 PST 2004


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

Change 64394 by peter at peter_daintree on 2004/11/06 00:37:41

	invade libthr

Affected files ...

.. //depot/projects/hammer/lib/libthr/arch/i386/i386/_setcurthread.c#14 edit

Differences ...

==== //depot/projects/hammer/lib/libthr/arch/i386/i386/_setcurthread.c#14 (text+ko) ====

@@ -62,14 +62,21 @@
 void *
 _set_curthread(ucontext_t *uc, struct pthread *thr, int *err)
 {
+#ifndef COMPAT_32BIT
 	union descriptor desc;
+#endif
 	struct tcb *tcb;
 	void *oldtls;
+#ifndef COMPAT_32BIT
 	int ldt_index;
+#endif
 
 	*err = 0;
 
 	if (uc == NULL && thr->arch_id != NULL) {
+#ifndef COMPAT_32BIT
+		 _amd64_set_gsbase(thr->arch_id);
+#endif
 		return (thr->arch_id);
 	}
 
@@ -91,6 +98,7 @@
 	 */
 	tcb->tcb_thread = thr;
 
+#ifndef COMPAT_32BIT
 	bzero(&desc, sizeof(desc));
 
 	/*
@@ -119,6 +127,10 @@
 		uc->uc_mcontext.mc_gs = LSEL(ldt_index, SEL_UPL);
 	else
 		_set_gs(LSEL(ldt_index, SEL_UPL));
+#else
+	if (uc == NULL)
+		_amd64_set_gsbase(tcb);
+#endif
 
 	return (tcb);
 }


More information about the p4-projects mailing list