2003-03-12 Roland McGrath <roland@redhat.com>

* pthread-errnos.sym: New file.
	* Makefile (gen-as-const-headers): New variable, list that file.
	* sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
	header <pthread-errnos.h> instead of defining errno values here.
	* sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
	Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
	Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
	* sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
	* sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
	* sysdeps/sh/pthread_spin_trylock.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
This commit is contained in:
Roland McGrath 2003-03-12 10:28:07 +00:00
parent da49194d2d
commit 326132dbdb
34 changed files with 55 additions and 107 deletions

View File

@ -144,7 +144,7 @@ tests = tst-attr1 tst-attr2 \
tst-eintr1 \
tst-tsd1 tst-tsd2 \
tst-tls1 tst-tls2 \
tst-fork1 tst-fork2 tst-fork3 \
tst-fork1 tst-fork2 tst-fork3 tst-fork4 \
tst-atfork1 \
tst-cancel1 tst-cancel2 tst-cancel3 tst-cancel4 tst-cancel5 \
tst-cancel6 tst-cancel7 tst-cancel8 tst-cancel9 tst-cancel10 \
@ -166,6 +166,8 @@ tests = tst-attr1 tst-attr2 \
distribute = eintr.c
gen-as-const-headers = pthread-errnos.sym
LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst

11
nptl/pthread-errnos.sym Normal file
View File

@ -0,0 +1,11 @@
#include <errno.h>
-- These errno codes are used by some assembly code.
EAGAIN EAGAIN
EBUSY EBUSY
EDEADLK EDEADLK
EINTR EINTR
EINVAL EINVAL
ETIMEDOUT ETIMEDOUT
EWOULDBLOCK EWOULDBLOCK

View File

@ -17,7 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#define EBUSY 16
#include <pthread-errnos.h>
#ifdef UP

View File

@ -16,7 +16,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#define EBUSY 16
#include <pthread-errnos.h>
.globl pthread_spin_trylock
.type pthread_spin_trylock,@function
@ -24,7 +24,7 @@
pthread_spin_trylock:
tas.b @r4
bf/s 1f
mov #EBUSY, r0
mov #EBUSY, r0
mov #0, r0
1:
rts

View File

@ -18,6 +18,7 @@
02111-1307 USA. */
#include <sysdep.h>
#include <pthread-errnos.h>
.text
@ -34,8 +35,6 @@
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define ETIMEDOUT 110
.globl __lll_lock_wait
.type __lll_lock_wait,@function

View File

@ -18,6 +18,7 @@
02111-1307 USA. */
#include <sysdep.h>
#include <pthread-errnos.h>
.text
@ -34,10 +35,6 @@
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define EWOULDBLOCK 11
#define EINVAL 22
#define ETIMEDOUT 110
.globl __lll_mutex_lock_wait
.type __lll_mutex_lock_wait,@function

View File

@ -20,6 +20,7 @@
#include <sysdep.h>
#include <shlib-compat.h>
#include <lowlevelcond.h>
#include <pthread-errnos.h>
#ifdef UP
# define LOCK
@ -32,8 +33,6 @@
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define ETIMEDOUT 110
.text

View File

@ -19,15 +19,13 @@
#include <sysdep.h>
#include <lowlevelrwlock.h>
#include <pthread-errnos.h>
#define SYS_futex 240
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define EAGAIN 11
#define EDEADLK 35
#ifndef UP
# define LOCK lock
#else

View File

@ -19,6 +19,7 @@
#include <sysdep.h>
#include <lowlevelrwlock.h>
#include <pthread-errnos.h>
#define SYS_gettimeofday __NR_gettimeofday
@ -26,11 +27,6 @@
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define EAGAIN 11
#define EINVAL 22
#define EDEADLK 35
#define ETIMEDOUT 110
#ifndef UP
# define LOCK lock
#else

View File

@ -19,6 +19,7 @@
#include <sysdep.h>
#include <lowlevelrwlock.h>
#include <pthread-errnos.h>
#define SYS_gettimeofday __NR_gettimeofday
@ -26,11 +27,6 @@
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define EAGAIN 11
#define EINVAL 22
#define EDEADLK 35
#define ETIMEDOUT 110
#ifndef UP
# define LOCK lock
#else

View File

@ -19,15 +19,13 @@
#include <sysdep.h>
#include <lowlevelrwlock.h>
#include <pthread-errnos.h>
#define SYS_futex 240
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define EAGAIN 11
#define EDEADLK 35
#ifndef UP
# define LOCK lock
#else

View File

@ -19,6 +19,7 @@
#include <sysdep.h>
#include <shlib-compat.h>
#include <pthread-errnos.h>
#ifndef UP
# define LOCK lock
@ -29,8 +30,6 @@
#define SYS_futex 240
#define FUTEX_WAKE 1
#define EINVAL 22
.text

View File

@ -19,6 +19,7 @@
#include <sysdep.h>
#include <shlib-compat.h>
#include <pthread-errnos.h>
#ifndef UP
# define LOCK lock
@ -30,10 +31,6 @@
#define SYS_futex 240
#define FUTEX_WAKE 1
#define EWOULDBLOCK 11
#define EINVAL 22
#define ETIMEDOUT 110
.text

View File

@ -19,6 +19,7 @@
#include <sysdep.h>
#include <shlib-compat.h>
#include <pthread-errnos.h>
#ifndef UP
# define LOCK lock
@ -29,8 +30,6 @@
#define SYS_futex 240
#define FUTEX_WAKE 1
#define EAGAIN 11
.text

View File

@ -19,6 +19,7 @@
#include <sysdep.h>
#include <shlib-compat.h>
#include <pthread-errnos.h>
#ifndef UP
# define LOCK lock
@ -29,8 +30,6 @@
#define SYS_futex 240
#define FUTEX_WAKE 1
#define EWOULDBLOCK 11
.text

View File

@ -17,6 +17,7 @@
02111-1307 USA. */
#include <sysdep.h>
#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
.text
@ -26,8 +27,6 @@
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define ETIMEDOUT 110
.globl __lll_lock_wait
.type __lll_lock_wait,@function

View File

@ -19,6 +19,7 @@
#include <sysdep.h>
#include <shlib-compat.h>
#include <lowlevelcond.h>
#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
#define SYS_gettimeofday __NR_gettimeofday
@ -26,8 +27,6 @@
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define ETIMEDOUT 110
.text
@ -164,7 +163,7 @@ __pthread_cond_timedwait:
mov.l .Ldisable1, r1
bsrf r1
mov.l @r15, r4
.Ldisable1b:
.Ldisable1b:
/* Lock. */
mov #1, r3

View File

@ -19,15 +19,13 @@
#include <sysdep.h>
#include <lowlevelrwlock.h>
#include <tcb-offsets.h>
#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
#define SYS_futex 240
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define EAGAIN 11
#define EDEADLK 35
.text
@ -207,7 +205,7 @@ __pthread_rwlock_rdlock:
.long __lll_mutex_lock_wait-.Lwait0b
.Lwake0:
.long __lll_mutex_unlock_wake-.Lwake0b
.Lwait1:
.Lwait1:
.long __lll_mutex_lock_wait-.Lwait1b
.Lwake1:
.long __lll_mutex_unlock_wake-.Lwake1b

View File

@ -19,6 +19,7 @@
#include <sysdep.h>
#include <lowlevelrwlock.h>
#include <tcb-offsets.h>
#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
#define SYS_gettimeofday __NR_gettimeofday
@ -26,10 +27,6 @@
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define EAGAIN 11
#define EDEADLK 35
#define ETIMEDOUT 110
.text
@ -263,11 +260,11 @@ pthread_rwlock_timedrdlock:
.Ltcboff:
.word TLS_PRE_TCB_SIZE
.align 2
.Lwait2:
.Lwait2:
.long __lll_mutex_lock_wait-.Lwait2b
.Lwake2:
.long __lll_mutex_unlock_wake-.Lwake2b
.Lwait3:
.Lwait3:
.long __lll_mutex_lock_wait-.Lwait3b
.Lwake3:
.long __lll_mutex_unlock_wake-.Lwake3b

View File

@ -19,6 +19,7 @@
#include <sysdep.h>
#include <lowlevelrwlock.h>
#include <tcb-offsets.h>
#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
#define SYS_gettimeofday __NR_gettimeofday
@ -26,10 +27,6 @@
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define EAGAIN 11
#define EDEADLK 35
#define ETIMEDOUT 110
.text
@ -248,11 +245,11 @@ pthread_rwlock_timedwrlock:
.Ltcboff:
.word TLS_PRE_TCB_SIZE
.align 2
.Lwait6:
.Lwait6:
.long __lll_mutex_lock_wait-.Lwait6b
.Lwake6:
.long __lll_mutex_unlock_wake-.Lwake6b
.Lwait7:
.Lwait7:
.long __lll_mutex_lock_wait-.Lwait7b
.Lwake7:
.long __lll_mutex_unlock_wake-.Lwake7b

View File

@ -19,15 +19,13 @@
#include <sysdep.h>
#include <lowlevelrwlock.h>
#include <tcb-offsets.h>
#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
#define SYS_futex 240
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define EAGAIN 11
#define EDEADLK 35
.text
@ -187,11 +185,11 @@ __pthread_rwlock_wrlock:
.Ltcboff:
.word TLS_PRE_TCB_SIZE
.align 2
.Lwait4:
.Lwait4:
.long __lll_mutex_lock_wait-.Lwait4b
.Lwake4:
.long __lll_mutex_unlock_wake-.Lwake4b
.Lwait5:
.Lwait5:
.long __lll_mutex_lock_wait-.Lwait5b
.Lwake5:
.long __lll_mutex_unlock_wake-.Lwake5b

View File

@ -18,6 +18,7 @@
#include <sysdep.h>
#include <shlib-compat.h>
#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
@ -26,12 +27,6 @@
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define EINTR 4
#define EAGAIN 11
#define EWOULDBLOCK EAGAIN
#define EINVAL 22
#define ETIMEDOUT 110
.text
.globl __new_sem_post

View File

@ -18,6 +18,7 @@
#include <sysdep.h>
#include <shlib-compat.h>
#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
@ -26,12 +27,6 @@
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define EINTR 4
#define EAGAIN 11
#define EWOULDBLOCK EAGAIN
#define EINVAL 22
#define ETIMEDOUT 110
.text
.globl sem_timedwait

View File

@ -18,6 +18,7 @@
#include <sysdep.h>
#include <shlib-compat.h>
#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
@ -26,12 +27,6 @@
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define EINTR 4
#define EAGAIN 11
#define EWOULDBLOCK EAGAIN
#define EINVAL 22
#define ETIMEDOUT 110
.text
.globl __new_sem_trywait

View File

@ -18,6 +18,7 @@
02111-1307 USA. */
#include <sysdep.h>
#include <pthread-errnos.h>
.text
@ -34,8 +35,6 @@
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define ETIMEDOUT 110
/* Modified: %rax, %rsi. */
.globl __lll_lock_wait

View File

@ -18,6 +18,7 @@
02111-1307 USA. */
#include <sysdep.h>
#include <pthread-errnos.h>
.text
@ -34,10 +35,6 @@
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define EWOULDBLOCK 11
#define EINVAL 22
#define ETIMEDOUT 110
.globl __lll_mutex_lock_wait
.type __lll_mutex_lock_wait,@function

View File

@ -20,6 +20,7 @@
#include <sysdep.h>
#include <shlib-compat.h>
#include <lowlevelcond.h>
#include <pthread-errnos.h>
#ifdef UP
# define LOCK
@ -32,8 +33,6 @@
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define ETIMEDOUT 110
.text

View File

@ -19,15 +19,13 @@
#include <sysdep.h>
#include <lowlevelrwlock.h>
#include <pthread-errnos.h>
#define SYS_futex 202
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define EAGAIN 11
#define EDEADLK 35
#ifndef UP
# define LOCK lock
#else

View File

@ -19,15 +19,13 @@
#include <sysdep.h>
#include <lowlevelrwlock.h>
#include <pthread-errnos.h>
#define SYS_futex 202
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define EAGAIN 11
#define EDEADLK 35
#ifndef UP
# define LOCK lock
#else

View File

@ -19,6 +19,7 @@
#include <sysdep.h>
#include <shlib-compat.h>
#include <pthread-errnos.h>
#ifndef UP
# define LOCK lock
@ -29,8 +30,6 @@
#define SYS_futex 202
#define FUTEX_WAKE 1
#define EINVAL 22
.text

View File

@ -19,6 +19,7 @@
#include <sysdep.h>
#include <shlib-compat.h>
#include <pthread-errnos.h>
#ifndef UP
# define LOCK lock
@ -29,10 +30,6 @@
#define SYS_gettimeofday __NR_gettimeofday
#define SYS_futex 202
#define EWOULDBLOCK 11
#define EINVAL 22
#define ETIMEDOUT 110
.text

View File

@ -19,6 +19,7 @@
#include <sysdep.h>
#include <shlib-compat.h>
#include <pthread-errnos.h>
#ifndef UP
# define LOCK lock
@ -29,8 +30,6 @@
#define SYS_futex 202
#define FUTEX_WAKE 1
#define EAGAIN 11
.text

View File

@ -19,6 +19,7 @@
#include <sysdep.h>
#include <shlib-compat.h>
#include <pthread-errnos.h>
#ifndef UP
# define LOCK lock
@ -28,8 +29,6 @@
#define SYS_futex 202
#define EWOULDBLOCK 11
.text

View File

@ -17,7 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#define EBUSY 16
#include <pthread-errnos.h>
#ifdef UP