From owner-freebsd-threads@FreeBSD.ORG Tue Aug 5 17:55:35 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 07B8937B401 for ; Tue, 5 Aug 2003 17:55:35 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5EBA443F75 for ; Tue, 5 Aug 2003 17:55:34 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h760tTuN019950; Tue, 5 Aug 2003 20:55:29 -0400 (EDT) Date: Tue, 5 Aug 2003 20:55:29 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Julian Elischer In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Marcel Moolenaar cc: freebsd-threads@freebsd.org Subject: Re: cvs commit: src/sys/i386/i386 sys_machdep.c X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 00:55:35 -0000 On Tue, 5 Aug 2003, Julian Elischer wrote: > Warning warning warning.... > > The code that Dan shows ends up pointing %gs to the struct pthread > structure.. however the ELF i386 (and amd64) ABI for TLS assumes that it > points to a POINTER to the TCB (is that the same thing?). If the TCB > (Thread control block) is the same thing as the struct pthread then you > should probably make the first entry be a pointer to istelf or the TLS > code generated by the linker (when enabled) will point to the wrong > thing.. For libthr, the struct pthread isn't really the thread control block. struct pthread is MI, so you can't rely on it having a layout that will satisfy all the ABIs. It isn't correct now for i386. libthr will likely need the same sort of arch-dependent hooks that libpthread just grew (minus the struct kcb stuff). The patch I posted just addresses auto-ldt allocation. > > With the array there is now it just happens to come out right. But it doesn't really, since the first slot of struct pthread is not a pointer to the dynamic TLS. -- Dan Eischen