This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] HPPA Linuxthreads.
- From: Carlos O'Donell <carlos at baldric dot uwo dot ca>
- To: Ulrich Drepper <drepper at redhat dot com>
- Cc: libc-alpha at sources dot redhat dot com, parisc-linux at lists dot parisc-linux dot org,Randolph Chung <tausq at debian dot org>,John David Anglin <dave dot anglin at nrc-cnrc dot gc dot ca>
- Date: Thu, 22 May 2003 11:09:02 -0400
- Subject: Re: [PATCH] HPPA Linuxthreads.
- References: <20030521172929.GB21858@systemhalted> <3ECBBE25.8090302@redhat.com>
Ulrich,
> The indentation and general style is wrong in many places.
I'll clean this up today and break it into three chunks for even easier
digestion.
> > __pthread_spin_lock (pthread_spinlock_t *lock)
> > {
> > - unsigned int val;
> > + unsigned int *addr = __ldcw_align (lock);
> > +
> > + while (__ldcw (addr) == 0)
> > + while (*addr == 0) ;
>
> This is plain wrong. addr at least must be volatile.
__ldcw is volatile.
Are you suggesting that it is prehaps fragile based on gcc's
choice of optimization?
> And I don't understand why you removed the asm code. These pieces of
> code are prime candidates for hand-coding.
__ldcw is still assembly only. __ldcw_align is a macro. In truth I
wanted a functioning implementation first, optimization is a close
second. Though a full assembly version would fix gcc from reordering
anything.
> > +static inline struct _pthread_descr_struct * __get_cr27(void)
> > +{
> > + long cr27;
> > + asm("mfctl %%cr27, %0" : "=r" (cr27) : );
> > + return (struct _pthread_descr_struct *) cr27;
> > +}
>
> Not a real problem, but you should get gcc to recognize this reqister
> and perform the loading.
This should get addressed as TLS is implemented for HPPA. I will be
attending gcc-summit in hopes to discuss this with my colleagues.
c.