From owner-p4-projects@FreeBSD.ORG Thu Jul 22 16:09:47 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AF8B616A4D0; Thu, 22 Jul 2004 16:09:46 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8A51616A4CE for ; Thu, 22 Jul 2004 16:09:46 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8606543D3F for ; Thu, 22 Jul 2004 16:09:46 +0000 (GMT) (envelope-from dfr@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i6MG9kVe006914 for ; Thu, 22 Jul 2004 16:09:46 GMT (envelope-from dfr@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i6MG9kDX006911 for perforce@freebsd.org; Thu, 22 Jul 2004 16:09:46 GMT (envelope-from dfr@freebsd.org) Date: Thu, 22 Jul 2004 16:09:46 GMT Message-Id: <200407221609.i6MG9kDX006911@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to dfr@freebsd.org using -f From: Doug Rabson To: Perforce Change Reviews Subject: PERFORCE change 57930 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2004 16:09:47 -0000 http://perforce.freebsd.org/chv.cgi?CH=57930 Change 57930 by dfr@dfr_home on 2004/07/22 16:09:46 Add support for amd64 TLS (untested). Affected files ... .. //depot/projects/kse/lib/libpthread/arch/amd64/amd64/pthread_md.c#2 edit .. //depot/projects/kse/lib/libpthread/arch/amd64/include/pthread_md.h#3 edit Differences ... ==== //depot/projects/kse/lib/libpthread/arch/amd64/amd64/pthread_md.c#2 (text+ko) ==== @@ -28,6 +28,7 @@ #include #include +#include "rtld_tls.h" #include "pthread_md.h" /* @@ -38,19 +39,19 @@ { struct tcb *tcb; - if ((tcb = malloc(sizeof(struct tcb))) != NULL) { - bzero(tcb, sizeof(struct tcb)); + tcb = _rtld_allocate_tls(sizeof(struct tcb), 16); + if (tcb) { tcb->tcb_thread = thread; - /* Allocate TDV */ + bzero(&tcb->tcb_tmbx, sizeof(tcb->tcb_tmbx)); } + return (tcb); } void _tcb_dtor(struct tcb *tcb) { - /* Free TDV */ - free(tcb); + _rtld_free_tls(tcb, sizeof(struct tcb), 16); } struct kcb * ==== //depot/projects/kse/lib/libpthread/arch/amd64/include/pthread_md.h#3 (text+ko) ==== @@ -62,9 +62,10 @@ }; struct tcb { - struct tdv *tcb_tdv; + struct tcb *tcb_self; /* required by rtld */ + void *tcb_dtv; /* required by rtld */ struct pthread *tcb_thread; - void *tcb_spare[2]; /* align tcb_tmbx to 16 bytes */ + void *tcb_spare[1]; /* align tcb_tmbx to 16 bytes */ struct kse_thr_mailbox tcb_tmbx; };