From owner-cvs-all@FreeBSD.ORG Tue Aug 5 21:17:43 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1645137B401; Tue, 5 Aug 2003 21:17:43 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B3BE343F85; Tue, 5 Aug 2003 21:17:42 -0700 (PDT) (envelope-from marcel@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h764Hg0U001430; Tue, 5 Aug 2003 21:17:42 -0700 (PDT) (envelope-from marcel@repoman.freebsd.org) Received: (from marcel@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h764Hg5T001429; Tue, 5 Aug 2003 21:17:42 -0700 (PDT) Message-Id: <200308060417.h764Hg5T001429@repoman.freebsd.org> From: Marcel Moolenaar Date: Tue, 5 Aug 2003 21:17:42 -0700 (PDT) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/lib/libpthread/arch/ia64/ia64 pthread_md.c src/lib/libpthread/arch/ia64/include pthread_md.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 04:17:43 -0000 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