Good news: KSE on ia64 is starting to work

Marcel Moolenaar marcel at xcllnt.net
Tue Aug 5 13:32:15 PDT 2003


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 at xcllnt.net


More information about the freebsd-threads mailing list