This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] HPPA Linuxthreads.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]