From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from baldric (baldric.uwo.ca [129.100.10.225]) by dsl2.external.hp.com (Postfix) with ESMTP id BE0B148D3 for ; Sun, 12 Oct 2003 15:37:51 -0600 (MDT) Date: Sun, 12 Oct 2003 17:34:26 -0400 From: Carlos O'Donell To: libc-alpha , parisc-linux@lists.parisc-linux.org Message-ID: <20031012213426.GG23999@systemhalted> References: <20031010204537.GG6454@systemhalted> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20031010204537.GG6454@systemhalted> Subject: [parisc-linux] [PATCH] linuxthreads for hppa (2/3, Round 2) 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: libc-alpha, Changes: a. Fixed formatting. b. Fixed Changelog entry. --- 2. Linuxthreads sysdep changes. This patch represents the minor changes required in linuxthreads sysdeps to accomodate for hppa's special lock requirements (e.g. A structure instead of an integer). The changes are minor and require that __LT_SPINLOCK_INIT no longer be used in a macro comparison since it's now a structure. A different define (__LT_INITIALIZER_NOT_ZERO) is used to indicate an architecture that does not initialize a lock to zero. Cheers, Carlos. === linuxthreads/sysdeps/pthread/bits/libc-lock.h | 6 +++--- linuxthreads/sysdeps/pthread/bits/pthreadtypes.h | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) === 2003-10-12 Carlos O'Donell * sysdeps/pthread/bits/libc-lock.h: Use __LT_INITIALIZER_NOT_ZERO. * sysdeps/pthread/bits/pthreadtypes.h: spinlock in struct _pthread_fastlock is __atomic_lock_t. diff -urN glibc-2.3.1.orig/linuxthreads/sysdeps/pthread/bits/libc-lock.h glibc-2.3.1/linuxthreads/sysdeps/pthread/bits/libc-lock.h --- glibc-2.3.1.orig/linuxthreads/sysdeps/pthread/bits/libc-lock.h 2003-01-15 12:58:35.000000000 -0500 +++ glibc-2.3.1/linuxthreads/sysdeps/pthread/bits/libc-lock.h 2003-01-15 18:24:36.000000000 -0500 @@ -71,12 +71,12 @@ initialized locks must be set to one due to the lack of normal atomic operations.) */ -#if __LT_SPINLOCK_INIT == 0 +#ifdef __LT_INITIALIZER_NOT_ZERO # define __libc_lock_define_initialized(CLASS,NAME) \ - CLASS __libc_lock_t NAME; + CLASS __libc_lock_t NAME = PTHREAD_MUTEX_INITIALIZER; #else # define __libc_lock_define_initialized(CLASS,NAME) \ - CLASS __libc_lock_t NAME = PTHREAD_MUTEX_INITIALIZER; + CLASS __libc_lock_t NAME; #endif #define __libc_rwlock_define_initialized(CLASS,NAME) \ diff -urN glibc-2.3.1.orig/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h glibc-2.3.1/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h --- glibc-2.3.1.orig/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h 2003-01-15 12:58:35.000000000 -0500 +++ glibc-2.3.1/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h 2003-01-15 18:24:36.000000000 -0500 @@ -22,12 +22,14 @@ #define __need_schedparam #include +typedef int __atomic_lock_t; + /* Fast locks (not abstract because mutexes and conditions aren't abstract). */ struct _pthread_fastlock { - long int __status; /* "Free" or "taken" or head of waiting list */ - int __spinlock; /* Used by compare_and_swap emulation. Also, - adaptive SMP lock stores spin count here. */ + long int __status; /* "Free" or "taken" or head of waiting list */ + __atomic_lock_t __spinlock; /* Used by compare_and_swap emulation. Also, + adaptive SMP lock stores spin count here. */ }; #ifndef _PTHREAD_DESCR_DEFINED