From owner-freebsd-threads@FreeBSD.ORG Fri Jun 20 04:40:50 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 69D0337B401 for ; Fri, 20 Jun 2003 04:40:50 -0700 (PDT) Received: from park.rambler.ru (park.rambler.ru [81.19.64.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 634A743F75 for ; Fri, 20 Jun 2003 04:40:49 -0700 (PDT) (envelope-from is@rambler-co.ru) Received: from is.park.rambler.ru (is.park.rambler.ru [81.19.64.102]) by park.rambler.ru (8.12.6/8.12.6) with ESMTP id h5KBemmF047031 for ; Fri, 20 Jun 2003 15:40:48 +0400 (MSD) Date: Fri, 20 Jun 2003 15:40:48 +0400 (MSD) From: Igor Sysoev X-Sender: is@is To: threads@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Implementing TLS: step 1 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2003 11:40:50 -0000 If we could sacrifice our current thread compatibility in 5.0-5.1 then we could change kse_mailbox from struct kse_mailbox { int km_version; /* Mailbox version */ struct kse_thr_mailbox *km_curthread; /* Current thread */ ... to struct kse_mailbox { struct kse_thr_mailbox *km_curthread; /* Current thread */ int km_version; /* Mailbox version */ ... then x86's gs would still point to kse_mailbox, and gs:[0] would be and TP pointer. Also we need to modify struct kse_thr_mailbox { + void *tls; ucontext_t tm_context; /* User thread context */ ... And the static TLS must be allocated before kse_thr_mailbox. Igor Sysoev http://sysoev.ru/en/