Good news: KSE on ia64 is starting to work

Daniel Eischen eischen at vigrid.com
Tue Aug 5 13:43:02 PDT 2003


On Tue, 5 Aug 2003, Marcel Moolenaar wrote:

> 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 */
> };

Sure; that was merely a placeholder so one (you) could replace
it with whatever is needed.  I assume this (static TLS) will
have some predetermined size...

> 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.

Sure, that works for me as well.

-- 
Dan Eischen



More information about the freebsd-threads mailing list