From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from myware.akkadia.org (cpe-24-221-190-179.ca.sprintbbd.net [24.221.190.179]) by dsl2.external.hp.com (Postfix) with ESMTP id 6DFA54829 for ; Wed, 21 May 2003 11:58:18 -0600 (MDT) Message-ID: <3ECBBE25.8090302@redhat.com> Date: Wed, 21 May 2003 10:57:57 -0700 From: Ulrich Drepper MIME-Version: 1.0 To: "Carlos O'Donell" Cc: libc-alpha@sources.redhat.com, parisc-linux@lists.parisc-linux.org, Randolph Chung , John David Anglin References: <20030521172929.GB21858@systemhalted> In-Reply-To: <20030521172929.GB21858@systemhalted> Content-Type: text/plain; charset=us-ascii Subject: [parisc-linux] Re: [PATCH] HPPA Linuxthreads. Sender: parisc-linux-admin@lists.parisc-linux.org Errors-To: parisc-linux-admin@lists.parisc-linux.org List-Help: List-Post: List-Subscribe: , List-Id: parisc-linux developers list List-Unsubscribe: , List-Archive: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Carlos O'Donell wrote: > This is a cleaner HPPA linuxthreads implementation that stems from the > work that John David Anglin and myself did > to devise a self-aligning lock system that doesn't impose the 16-byte > lock alignment restriction. The indentation and general style is wrong in many places. > diff -urN glibc-2.3.1.orig/linuxthreads/sysdeps/hppa/pspinlock.c glibc-2.3.1/linuxthreads/sysdeps/hppa/pspinlock.c > --- glibc-2.3.1.orig/linuxthreads/sysdeps/hppa/pspinlock.c 2002-08-26 18:39:51.000000000 -0400 > +++ glibc-2.3.1/linuxthreads/sysdeps/hppa/pspinlock.c 2003-01-15 18:26:51.000000000 -0500 > @@ -24,15 +24,12 @@ > int > __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. And I don't understand why you removed the asm code. These pieces of code are prime candidates for hand-coding. > +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. - -- - --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `--------------------------- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+y74l2ijCOnn/RHQRAvZ1AKCkAhua5qA19EDylfBz2Zhp8dROIACfTrwO 9Slpj32aUy92PiggDNexZBE= =6Ilf -----END PGP SIGNATURE-----