Date: Tue, 5 Aug 2003 21:17:42 -0700 (PDT) From: Marcel Moolenaar <marcel@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/lib/libpthread/arch/ia64/ia64 pthread_md.c src/lib/libpthread/arch/ia64/include pthread_md.h Message-ID: <200308060417.h764Hg5T001429@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
marcel 2003/08/05 21:17:42 PDT FreeBSD src repository Modified files: lib/libpthread/arch/ia64/ia64 pthread_md.c lib/libpthread/arch/ia64/include pthread_md.h Log: Avoid a level of indirection to get from the thread pointer to the TCB. We know that the thread pointer points to &tcb->tcb_tp, so all we have to do is subtract offsetof(struct tcb, tcb_tp) from the thread pointer to get to the TCB. Any reasonably smart compiler will translate accesses to fields in the TCB as negative offsets from TP. In _tcb_set() make sure the fake TCB gets a pointer to the current KCB, just like any other TCB. This fixes a NULL-pointer dereference in _thr_ref_add() when it tried to get the current KSE. Revision Changes Path 1.2 +0 -2 src/lib/libpthread/arch/ia64/ia64/pthread_md.c 1.7 +27 -37 src/lib/libpthread/arch/ia64/include/pthread_md.h
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200308060417.h764Hg5T001429>