From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 00:17:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A39601065674; Tue, 14 Feb 2012 00:17:43 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E2A68FC16; Tue, 14 Feb 2012 00:17:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1E0HhKa068899; Tue, 14 Feb 2012 00:17:43 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1E0Hh0k068896; Tue, 14 Feb 2012 00:17:43 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202140017.q1E0Hh0k068896@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 14 Feb 2012 00:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231619 - in head/lib/libthr/arch/arm: arm include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 00:17:43 -0000 Author: gonzo Date: Tue Feb 14 00:17:43 2012 New Revision: 231619 URL: http://svn.freebsd.org/changeset/base/231619 Log: Add thread-local storage support for arm: - Switch to Variant I TCB layout - Use function from rtld for TCB allocation/deallocation Modified: head/lib/libthr/arch/arm/arm/pthread_md.c head/lib/libthr/arch/arm/include/pthread_md.h Modified: head/lib/libthr/arch/arm/arm/pthread_md.c ============================================================================== --- head/lib/libthr/arch/arm/arm/pthread_md.c Tue Feb 14 00:16:34 2012 (r231618) +++ head/lib/libthr/arch/arm/arm/pthread_md.c Tue Feb 14 00:17:43 2012 (r231619) @@ -37,14 +37,17 @@ _tcb_ctor(struct pthread *thread, int in { struct tcb *tcb; - tcb = malloc(sizeof(struct tcb)); + tcb = _rtld_allocate_tls((initial) ? _tcb_get() : NULL, + sizeof(struct tcb), 16); if (tcb) tcb->tcb_thread = thread; + return (tcb); } void _tcb_dtor(struct tcb *tcb) { - free(tcb); + + _rtld_free_tls(tcb, sizeof(struct tcb), 16); } Modified: head/lib/libthr/arch/arm/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/arm/include/pthread_md.h Tue Feb 14 00:16:34 2012 (r231618) +++ head/lib/libthr/arch/arm/include/pthread_md.h Tue Feb 14 00:17:43 2012 (r231619) @@ -43,10 +43,8 @@ * Variant II tcb, first two members are required by rtld. */ struct tcb { - struct tcb *tcb_self; /* required by rtld */ void *tcb_dtv; /* required by rtld */ struct pthread *tcb_thread; /* our hook */ - void *tcb_spare[1]; }; /*