Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Aug 2003 13:32:13 -0700
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        deischen@freebsd.org
Cc:        threads@freebsd.org
Subject:   Re: Good news: KSE on ia64 is starting to work
Message-ID:  <20030805203213.GA879@athlon.pn.xcllnt.net>
In-Reply-To: <Pine.GSO.4.10.10308051611130.915-100000@pcnet5.pcnet.com>
References:  <20030805200546.GA825@athlon.pn.xcllnt.net> <Pine.GSO.4.10.10308051611130.915-100000@pcnet5.pcnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Aug 05, 2003 at 04:12:01PM -0400, Daniel Eischen wrote:
> On Tue, 5 Aug 2003, Marcel Moolenaar wrote:
> 
> > On Tue, Aug 05, 2003 at 02:02:04PM -0400, Daniel Eischen wrote:
> > > > 
> > > > The patch does not contain ia64 (yet), but libpthread.ia64.diffs
> > > > does indeed have the code that deals with TP.
> > > 
> > > Oh shoot.  Terribly sorry :-(  I didn't change the link
> > > to point to the latest patch file.  If you grab it again,
> > > it should be updated.
> > 
> > Attached the diff again pthread_md.h (ia64) after my commits.
> > Mostly merge conflict resolutions.
> 
> Got it, thanks :)

I got a fix:
In struct ia64_tp we define tp_tls as an array of char. If we
define it as an array of long double we automaticly have 16-byte
alignment of the static TLS, struct ia64_tp, struct tcb and
struct kcb. Allocating the TCB will then automaticly ensure that
the static TLS is properly aligned. I'm currently testing with
the following (re)definition of struct ia64_tp:

struct ia64_tp {
        struct tdv              *tp_tdv;        /* dynamic TLS */
        struct tcb              *tp_self;
        long double             tp_tls[0];      /* static TLS */
};

BTW: I'm also thinking about replacing tp_self by tp_thread and use
the following to get to the TCB:

#define _CURTCB(tp) (struct tcb*)((uintptr_t)tp - offsetof(struct tcb, tcb_tp))

This should remove some double-indirections to get to struct pthread.
I haven't made the change locally yet. I first want to get the
show on the road.

FYI,

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030805203213.GA879>