Date: Sun, 27 Feb 2005 05:27:55 GMT From: David Xu <davidxu@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 71962 for review Message-ID: <200502270527.j1R5RtO8063951@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <stdlib.h> #include <strings.h> + #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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200502270527.j1R5RtO8063951>