This is the mail archive of the libc-alpha@sources.redhat.com 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]

[PATCH] Implement linuxthreads on HPPA


libc-alpha,

I've reworked the hppa pthreads patch to be as low impact as possible :)
Though some things need to be done, namely, hppa needs the lock variable
to be 16-byte aligned. This alignment requirement means all sorts of ugly
things, from wrappers to avoid non-constant named initializers, to the use
of a struct for a lock variable.

Thanks for all your feedback.

My apologies for the slow return, school called :}

c.

Round 2 ...

 linuxthreads/descr.h                                          |    2 
 linuxthreads/pt-machine.c                                     |    4 
 linuxthreads/pthread.c                                        |   16 -
 linuxthreads/spinlock.c                                       |   24 -
 linuxthreads/spinlock.h                                       |   26 +
 linuxthreads/sysdeps/hppa/pspinlock.c                         |   24 -
 linuxthreads/sysdeps/hppa/pt-machine.h                        |   46 ++-
 linuxthreads/sysdeps/pthread/bits/libc-lock.h                 |    6 
 linuxthreads/sysdeps/pthread/bits/pthreadtypes.h              |    8 
 linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/initspin.h     |   22 +
 linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/pthreadtypes.h |  146 ++++++++++
 linuxthreads/sysdeps/unix/sysv/linux/hppa/pt-initfini.c       |  132 ++++-----
 sysdeps/hppa/dl-fptr.c                                        |   10 
 13 files changed, 336 insertions(+), 130 deletions(-)

---

2002-11-11  Carlos O'Donell  <carlos@baldric.uwo.ca>

	* linuxthreads/descr.h: Change spinlock type to __atomic_lock_t.
	* linuxthreads/pt-machine.c: Change extern definition of testandset
	so it uses __atomic_lock_t instead of int.
	* linuxthreads/pthread.c:
	(__pthread_initialize_minimal): Replace the use of __LT_SPINLOCK_INIT
	with __LT_INITIALIZER_NOT_ZERO in cases where it is used to check 
	wether the initialization should occur or not.
	(__pthread_initialize_manager): Likewise.
	* linuxthreads/spinlock.h: Add default define for lock_held if it has 
	not already been defined. Create the __pthread_lock_define_initialized
	macro to wrap up the use of an alternate initializer. Change 
	__pthread_compare_and_swap to use __atomic_lock_t,
	(compare_and_swap): Change function definitions to use __atomic_lock_t
	(compare_and_swap_with_release_semantics): Likewise.
	(__pthread_compare_and_swap): Likewise.
	* linuxthreads/spinlock.c: Change definition of __pthread_acquire to 
	use __atomic_lock_t. Modify struct wait_node to use __atomic_lock_t 
	as lock. Wrap definition and init of wait_node_free_list_spinlock in 
	macro.
	(__pthread_release): Change function definition to use __atomic_lock_t
	(__pthread_alt_lock): Change instances of abandoned = 0 to
	abandoned = __LT_SPINLOCK_INIT.
	(__pthread_alt_timedlock): Likewise.
	(__pthread_alt_unlock): Use lock_held instead of just checking 
	abandoned == 0. Typo fix in comment from "canno6" to "cannot"
	(__pthread_compare_and_swap): Change function definition to use 
	__atomic_lock_t.
	(__pthread_acquire): Likewise.
	* linuxthreads/sysdeps/hppa/pspinlock.c: Define __ldcw macro for PA's
	single atomic operation.
	(__pthread_spin_lock): Modified to use __ldcw macro.
	(__pthread_spin_trylock): Likewise.
	* linuxthreads/sysdeps/hppa/pt-machine.h: Add sys/types.h to pull in
	__atomic_long_t definition. Remove extern testandset define. Add 
	defines for FLOATING_STACKS and ARACH_STACK_MAX_SIZE. Add lock_held
	macro.
	(__get_cr27): New.
	(__set_cr27): New.
	(__load_and_clear): New.
	(testandset): Modified to emulate testandset using __load_and_clear.
	* linuxthreads/sysdeps/pthread/bits/libc-lock.h: Replace the use of
	__LT_SPINLOCK_INIT with that of __LT_INITIALIZER_NOT_ZERO.
	* linuxthreads/sysdeps/pthread/bits/pthreadtypes.h:
	Define default __atomic_lock_t to be an int. Change struct
	_pthread_fastlock to reflect name change.
	* linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/initspin.h:
	Change macro's to reflect that lock is actually struct.
	* linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/pthreadtypes.h: New.
	* linuxthreads/sysdeps/unix/sysv/linux/hppa/pt-initfini.c: 
	Avoid unterminated string literals.
	* sysdeps/hppa/dl-fptr.c: Change global lock to use 
	__LT_SPINLOCK_ALT_INIT.
	(__hppa_make_fptr): Use __LT_SPINLOCK_INIT to clear locks.
	(_dl_unmap): Likewise.
	(_dl_lookup_address): Likewise, and clear bottom two bits of address
	to fix function pointer calculation, see make_ftpr for the reasoning.

Attachment: 00-glibc23-hppa-pthreads
Description: Text document


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