From owner-p4-projects@FreeBSD.ORG Sun Feb 27 05:27:56 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7521716A4D0; Sun, 27 Feb 2005 05:27:56 +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 5129516A4CE for ; Sun, 27 Feb 2005 05:27:56 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1110043D1D for ; Sun, 27 Feb 2005 05:27:56 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j1R5Rttt063954 for ; Sun, 27 Feb 2005 05:27:55 GMT (envelope-from davidxu@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j1R5RtO8063951 for perforce@freebsd.org; Sun, 27 Feb 2005 05:27:55 GMT (envelope-from davidxu@freebsd.org) Date: Sun, 27 Feb 2005 05:27:55 GMT Message-Id: <200502270527.j1R5RtO8063951@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to davidxu@freebsd.org using -f From: David Xu To: Perforce Change Reviews Subject: PERFORCE change 71962 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: Sun, 27 Feb 2005 05:27:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=71962 Change 71962 by davidxu@davidxu_tiger on 2005/02/27 05:27:28 Cleanup code. Affected files ... .. //depot/projects/davidxu_thread/src/lib/libthread/arch/amd64/include/pthread_md.h#7 edit .. //depot/projects/davidxu_thread/src/lib/libthread/arch/i386/include/pthread_md.h#6 edit .. //depot/projects/davidxu_thread/src/lib/libthread/arch/powerpc/powerpc/pthread_md.c#4 edit .. //depot/projects/davidxu_thread/src/lib/libthread/arch/sparc64/include/pthread_md.h#7 edit .. //depot/projects/davidxu_thread/src/lib/libthread/arch/sparc64/sparc64/pthread_md.c#5 edit Differences ... ==== //depot/projects/davidxu_thread/src/lib/libthread/arch/amd64/include/pthread_md.h#7 (text+ko) ==== @@ -40,9 +40,6 @@ #define DTV_OFFSET offsetof(struct tcb, tcb_dtv) -struct pthread; -struct tdv; - /* * Variant II tcb, first two members are required by rtld, * %fs points to the structure. ==== //depot/projects/davidxu_thread/src/lib/libthread/arch/i386/include/pthread_md.h#6 (text+ko) ==== @@ -38,8 +38,6 @@ #define DTV_OFFSET offsetof(struct tcb, tcb_dtv) -struct pthread; - /* * Variant II tcb, first two members are required by rtld, * %gs points to the structure. ==== //depot/projects/davidxu_thread/src/lib/libthread/arch/powerpc/powerpc/pthread_md.c#4 (text+ko) ==== @@ -28,6 +28,7 @@ #include #include + #include "rtld_tls.h" #include "pthread_md.h" @@ -44,18 +45,9 @@ oldtls = _tp; else oldtls = NULL; - -#if 1 - if ((tcb = malloc(sizeof(struct tcb))) != NULL) { - memset(tcb, 0, sizeof(struct tcb)); - tcb->tcb_thread = thread; - } -#else tcb = _rtld_allocate_tls(oldtls, sizeof(struct tcb), 16); - if (tcb) { + if (tcb) tcb->tcb_thread = thread; - } -#endif return (tcb); } @@ -63,9 +55,5 @@ void _tcb_dtor(struct tcb *tcb) { -#if 1 - free(tcb); -#else _rtld_free_tls(tcb, sizeof(tcb), 16); -#endif } ==== //depot/projects/davidxu_thread/src/lib/libthread/arch/sparc64/include/pthread_md.h#7 (text+ko) ==== @@ -37,8 +37,6 @@ #define DTV_OFFSET offsetof(struct tcb, tcb_dtv) -struct pthread; - /* * Variant II tcb, first two members are required by rtld. * %g7 points to the structure. ==== //depot/projects/davidxu_thread/src/lib/libthread/arch/sparc64/sparc64/pthread_md.c#5 (text+ko) ==== @@ -40,17 +40,13 @@ struct tcb *tcb; void *oldtls; - if (initial) { + if (initial) oldtls = _tp; - } else { + else oldtls = NULL; - } - tcb = _rtld_allocate_tls(oldtls, sizeof(struct tcb), 16); - if (tcb) { + if (tcb) tcb->tcb_thread = thread; - } - return (tcb); }