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-eintr1 \
tst-tsd1 tst-tsd2 \ tst-tsd1 tst-tsd2 \
tst-tls1 tst-tls2 \ tst-tls1 tst-tls2 \
tst-fork1 tst-fork2 tst-fork3 \ tst-fork1 tst-fork2 tst-fork3 tst-fork4 \
tst-atfork1 \ tst-atfork1 \
tst-cancel1 tst-cancel2 tst-cancel3 tst-cancel4 tst-cancel5 \ tst-cancel1 tst-cancel2 tst-cancel3 tst-cancel4 tst-cancel5 \
tst-cancel6 tst-cancel7 tst-cancel8 tst-cancel9 tst-cancel10 \ tst-cancel6 tst-cancel7 tst-cancel8 tst-cancel9 tst-cancel10 \
@ -166,6 +166,8 @@ tests = tst-attr1 tst-attr2 \
distribute = eintr.c distribute = eintr.c
gen-as-const-headers = pthread-errnos.sym
LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst 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 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */ 02111-1307 USA. */
#define EBUSY 16 #include <pthread-errnos.h>
#ifdef UP #ifdef UP

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -19,6 +19,7 @@
#include <sysdep.h> #include <sysdep.h>
#include <shlib-compat.h> #include <shlib-compat.h>
#include <lowlevelcond.h> #include <lowlevelcond.h>
#include <pthread-errnos.h>
#include "lowlevel-atomic.h" #include "lowlevel-atomic.h"
#define SYS_gettimeofday __NR_gettimeofday #define SYS_gettimeofday __NR_gettimeofday
@ -26,8 +27,6 @@
#define FUTEX_WAIT 0 #define FUTEX_WAIT 0
#define FUTEX_WAKE 1 #define FUTEX_WAKE 1
#define ETIMEDOUT 110
.text .text

View File

@ -19,15 +19,13 @@
#include <sysdep.h> #include <sysdep.h>
#include <lowlevelrwlock.h> #include <lowlevelrwlock.h>
#include <tcb-offsets.h> #include <tcb-offsets.h>
#include <pthread-errnos.h>
#include "lowlevel-atomic.h" #include "lowlevel-atomic.h"
#define SYS_futex 240 #define SYS_futex 240
#define FUTEX_WAIT 0 #define FUTEX_WAIT 0
#define FUTEX_WAKE 1 #define FUTEX_WAKE 1
#define EAGAIN 11
#define EDEADLK 35
.text .text

View File

@ -19,6 +19,7 @@
#include <sysdep.h> #include <sysdep.h>
#include <lowlevelrwlock.h> #include <lowlevelrwlock.h>
#include <tcb-offsets.h> #include <tcb-offsets.h>
#include <pthread-errnos.h>
#include "lowlevel-atomic.h" #include "lowlevel-atomic.h"
#define SYS_gettimeofday __NR_gettimeofday #define SYS_gettimeofday __NR_gettimeofday
@ -26,10 +27,6 @@
#define FUTEX_WAIT 0 #define FUTEX_WAIT 0
#define FUTEX_WAKE 1 #define FUTEX_WAKE 1
#define EAGAIN 11
#define EDEADLK 35
#define ETIMEDOUT 110
.text .text

View File

@ -19,6 +19,7 @@
#include <sysdep.h> #include <sysdep.h>
#include <lowlevelrwlock.h> #include <lowlevelrwlock.h>
#include <tcb-offsets.h> #include <tcb-offsets.h>
#include <pthread-errnos.h>
#include "lowlevel-atomic.h" #include "lowlevel-atomic.h"
#define SYS_gettimeofday __NR_gettimeofday #define SYS_gettimeofday __NR_gettimeofday
@ -26,10 +27,6 @@
#define FUTEX_WAIT 0 #define FUTEX_WAIT 0
#define FUTEX_WAKE 1 #define FUTEX_WAKE 1
#define EAGAIN 11
#define EDEADLK 35
#define ETIMEDOUT 110
.text .text

View File

@ -19,15 +19,13 @@
#include <sysdep.h> #include <sysdep.h>
#include <lowlevelrwlock.h> #include <lowlevelrwlock.h>
#include <tcb-offsets.h> #include <tcb-offsets.h>
#include <pthread-errnos.h>
#include "lowlevel-atomic.h" #include "lowlevel-atomic.h"
#define SYS_futex 240 #define SYS_futex 240
#define FUTEX_WAIT 0 #define FUTEX_WAIT 0
#define FUTEX_WAKE 1 #define FUTEX_WAKE 1
#define EAGAIN 11
#define EDEADLK 35
.text .text

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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