svn commit: r237397 - in stable/9/lib/libthr/arch/arm: arm inclu

看板FB_svn作者時間13年前 (2012/06/22 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
Author: marius Date: Thu Jun 21 13:53:28 2012 New Revision: 237397 URL: http://svn.freebsd.org/changeset/base/237397 Log: MFC: r231619 Add thread-local storage support for arm: - Switch to Variant I TCB layout - Use function from rtld for TCB allocation/deallocation Modified: stable/9/lib/libthr/arch/arm/arm/pthread_md.c stable/9/lib/libthr/arch/arm/include/pthread_md.h Directory Properties: stable/9/lib/libthr/ (props changed) Modified: stable/9/lib/libthr/arch/arm/arm/pthread_md.c ============================================================================== --- stable/9/lib/libthr/arch/arm/arm/pthread_md.c Thu Jun 21 13:51:50 2012 (r237396) +++ stable/9/lib/libthr/arch/arm/arm/pthread_md.c Thu Jun 21 13:53:28 2012 (r237397) @@ -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: stable/9/lib/libthr/arch/arm/include/pthread_md.h ============================================================================== --- stable/9/lib/libthr/arch/arm/include/pthread_md.h Thu Jun 21 13:51:50 2012 (r237396) +++ stable/9/lib/libthr/arch/arm/include/pthread_md.h Thu Jun 21 13:53:28 2012 (r237397) @@ -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]; }; /* _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
文章代碼(AID): #1Fus5V05 (FB_svn)