]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Avoid a level of indirection to get from the thread pointer to the
authormarcel <marcel@FreeBSD.org>
Wed, 6 Aug 2003 04:17:42 +0000 (04:17 +0000)
committermarcel <marcel@FreeBSD.org>
Wed, 6 Aug 2003 04:17:42 +0000 (04:17 +0000)
commit37f3261fb03018506ca05c7138ca29512279f6dd
treec070db592d4d0e08aa992e9fe20768814f1f2cb0
parentc8a46634c8921fed9fe0416f8507163e995e4881
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.
lib/libkse/arch/ia64/ia64/pthread_md.c
lib/libkse/arch/ia64/include/pthread_md.h
lib/libpthread/arch/ia64/ia64/pthread_md.c
lib/libpthread/arch/ia64/include/pthread_md.h