Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 May 2001 18:32:09 -0400 (EDT)
From:      Daniel Eischen <eischen@vigrid.com>
To:        current@freebsd.org
Subject:   Rfork'd threads, signals, and LDTs
Message-ID:  <Pine.SUN.3.91.1010501182144.11148A-100000@pcnet1.pcnet.com>

next in thread | raw e-mail | index | archive | help
Why are %fs and %gs set back to default (_udata_sel) when posting
signals?

I am planning on using %fs for TSD/KSD and want it to be valid
in signal handlers.

A test program is at:

  http://people.freebsd.org/~deischen/test_tsd.c

Compile it with -DDEBUG on an unpatched kernel to show more
details.

This following seems to fix it.  Any reason it would cause
problems?

Index: machdep.c
===================================================================
RCS file: /opt/FreeBSD/cvs/src/sys/i386/i386/machdep.c,v
retrieving revision 1.447
diff -u -r1.447 machdep.c
--- machdep.c	2001/04/27 19:28:19	1.447
+++ machdep.c	2001/05/01 22:20:52
@@ -745,8 +745,6 @@
 	regs->tf_cs = _ucodesel;
 	regs->tf_ds = _udatasel;
 	regs->tf_es = _udatasel;
-	regs->tf_fs = _udatasel;
-	load_gs(_udatasel);
 	regs->tf_ss = _udatasel;
 }


-- 
Dan Eischen

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SUN.3.91.1010501182144.11148A-100000>