linuxthreads for hppa (2/3)
PATCH 1/1 linuxthreads for hppa (2/3)
libc-alpha,
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-04 Carlos O'Donell <[email protected]>
* linuxthreads/sysdeps/pthread/bits/libc-lock.h:
Use __LT_INITIALIZER_NOT_ZERO.
* linuxthreads/sysdeps/pthread/bits/pthreadtypes.h:
spinlock in struct _pthread_fastlock is __atomic_lock_t.
linuxthreads/sysdeps/pthread/bits/libc-lock.h +3 -3
@@ -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 ) \
linuxthreads/sysdeps/pthread/bits/pthreadtypes.h +5 -3
@@ -22,12 +22,14 @@#define __need_schedparam#include <bits/sched.h> +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
PATCH 1/1 linuxthreads for hppa (2/3, Round 2)
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 <[email protected]>
* 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.
linuxthreads/sysdeps/pthread/bits/libc-lock.h +3 -3
@@ -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 ) \
linuxthreads/sysdeps/pthread/bits/pthreadtypes.h +5 -3
@@ -22,12 +22,14 @@#define __need_schedparam#include <bits/sched.h> +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
PATCH 1/1 linuxthreads for hppa (2/3, Round 2)
In reply to Carlos O'Donelllibc-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 <[email protected]>
* 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.
linuxthreads/sysdeps/pthread/bits/libc-lock.h +3 -3
@@ -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 ) \
linuxthreads/sysdeps/pthread/bits/pthreadtypes.h +5 -3
@@ -22,12 +22,14 @@#define __need_schedparam#include <bits/sched.h> +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