summaryrefslogtreecommitdiff
path: root/libc/nptl/sysdeps/unix/sysv
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2009-12-01 01:39:36 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2009-12-01 01:39:36 +0000
commitfb0265684ef7d202acf7f26152909d2adf94575d (patch)
treed0f1934bed0bc46908a6e6c20e7a7ed681ed70f9 /libc/nptl/sysdeps/unix/sysv
parent13f9386e858d4de839bcf681debed84ea7f02974 (diff)
downloadeglibc2-fb0265684ef7d202acf7f26152909d2adf94575d.tar.gz
Merge changes between r9301 and r9378 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@9379 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/nptl/sysdeps/unix/sysv')
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/i386/dl-sysdep.h55
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S56
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S15
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/sh/pt-initfini.c21
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S5
5 files changed, 34 insertions, 118 deletions
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/dl-sysdep.h b/libc/nptl/sysdeps/unix/sysv/linux/i386/dl-sysdep.h
index a3b2c77c3..5216114a7 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/i386/dl-sysdep.h
+++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/dl-sysdep.h
@@ -1,5 +1,5 @@
-/* System-specific settings for dynamic linker code. IA-32 version.
- Copyright (C) 2002, 2003, 2008 Free Software Foundation, Inc.
+/* System-specific settings for dynamic linker code. i386 version.
+ Copyright (C) 2002,2003,2008,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,56 +18,11 @@
02111-1307 USA. */
#ifndef _DL_SYSDEP_H
-#define _DL_SYSDEP_H 1
+# include "i686/dl-sysdep.h"
-/* This macro must be defined to either 0 or 1.
-
- If 1, then an errno global variable hidden in ld.so will work right with
- all the errno-using libc code compiled for ld.so, and there is never a
- need to share the errno location with libc. This is appropriate only if
- all the libc functions that ld.so uses are called without PLT and always
- get the versions linked into ld.so rather than the libc ones. */
-
-#ifdef IS_IN_rtld
-# define RTLD_PRIVATE_ERRNO 1
-#else
-# define RTLD_PRIVATE_ERRNO 0
-#endif
-
-/* Traditionally system calls have been made using int $0x80. A
- second method was introduced which, if possible, will use the
- sysenter/syscall instructions. To signal the presence and where to
- find the code the kernel passes an AT_SYSINFO value in the
- auxiliary vector to the application.
- sysenter/syscall is not useful on i386 through i586, but the dynamic
+/* sysenter/syscall is not useful on i386 through i586, but the dynamic
linker and dl code in libc.a has to be able to load i686 compiled
libraries. */
-#define NEED_DL_SYSINFO 1
-#undef USE_DL_SYSINFO
-
-#if defined NEED_DL_SYSINFO && !defined __ASSEMBLER__
-extern void _dl_sysinfo_int80 (void) attribute_hidden;
-# define DL_SYSINFO_DEFAULT (uintptr_t) _dl_sysinfo_int80
-# define DL_SYSINFO_IMPLEMENTATION \
- asm (".text\n\t" \
- ".type _dl_sysinfo_int80,@function\n\t" \
- ".hidden _dl_sysinfo_int80\n\t" \
- CFI_STARTPROC "\n" \
- "_dl_sysinfo_int80:\n\t" \
- "int $0x80;\n\t" \
- "ret;\n\t" \
- CFI_ENDPROC "\n" \
- ".size _dl_sysinfo_int80,.-_dl_sysinfo_int80\n\t" \
- ".previous;");
-#endif
-
-
-/* The _dl_discover_osversion function is so far only needed in sysconf
- to check for kernels later than 2.6.23. */
-#if !defined __ASSEMBLER__ && __LINUX_KERNEL_VERSION < 0x020617
-/* Get version of the OS. */
-extern int _dl_discover_osversion (void) attribute_hidden;
-# define HAVE_DL_DISCOVER_OSVERSION 1
-#endif
+# undef USE_DL_SYSINFO
#endif /* dl-sysdep.h */
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
index f46b4b874..40fb04b31 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2004,2006,2007,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -35,16 +35,17 @@ __pthread_cond_broadcast:
cfi_startproc
pushl %ebx
cfi_adjust_cfa_offset(4)
+ cfi_rel_offset(%ebx, 0)
pushl %esi
cfi_adjust_cfa_offset(4)
+ cfi_rel_offset(%esi, 0)
pushl %edi
cfi_adjust_cfa_offset(4)
+ cfi_rel_offset(%edi, 0)
pushl %ebp
cfi_adjust_cfa_offset(4)
- cfi_offset(%ebx, -8)
- cfi_offset(%esi, -12)
- cfi_offset(%edi, -16)
- cfi_offset(%ebp, -20)
+ cfi_rel_offset(%ebp, 0)
+ cfi_remember_state
movl 20(%esp), %ebx
@@ -120,32 +121,6 @@ __pthread_cond_broadcast:
cmpl $0xfffff001, %eax
jae 9f
-10: xorl %eax, %eax
- popl %ebp
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebp)
- popl %edi
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%edi)
- popl %esi
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%esi)
- popl %ebx
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebx)
- ret
-
- cfi_adjust_cfa_offset(16)
- cfi_offset(%ebx, -8)
- cfi_offset(%esi, -12)
- cfi_offset(%edi, -16)
- cfi_offset(%ebp, -20)
- .align 16
- /* Unlock. */
-4: LOCK
- subl $1, cond_lock-cond_futex(%ebx)
- jne 5f
-
6: xorl %eax, %eax
popl %ebp
cfi_adjust_cfa_offset(-4)
@@ -161,11 +136,8 @@ __pthread_cond_broadcast:
cfi_restore(%ebx)
ret
- cfi_adjust_cfa_offset(16)
- cfi_offset(%ebx, -8)
- cfi_offset(%esi, -12)
- cfi_offset(%edi, -16)
- cfi_offset(%ebp, -20)
+ cfi_restore_state
+
/* Initial locking failed. */
1:
#if cond_lock == 0
@@ -186,7 +158,13 @@ __pthread_cond_broadcast:
call __lll_lock_wait
jmp 2b
- /* Unlock in loop requires waekup. */
+ .align 16
+ /* Unlock. */
+4: LOCK
+ subl $1, cond_lock-cond_futex(%ebx)
+ je 6b
+
+ /* Unlock in loop requires wakeup. */
5: leal cond_lock-cond_futex(%ebx), %eax
#if (LLL_SHARED-LLL_PRIVATE) > 255
xorl %ecx, %ecx
@@ -201,7 +179,7 @@ __pthread_cond_broadcast:
call __lll_unlock_wake
jmp 6b
- /* Unlock in loop requires waekup. */
+ /* Unlock in loop requires wakeup. */
7: leal cond_lock-cond_futex(%ebx), %eax
#if (LLL_SHARED-LLL_PRIVATE) > 255
xorl %ecx, %ecx
@@ -232,7 +210,7 @@ __pthread_cond_broadcast:
addl $FUTEX_WAKE, %ecx
movl $SYS_futex, %eax
ENTER_KERNEL
- jmp 10b
+ jmp 6b
cfi_endproc
.size __pthread_cond_broadcast, .-__pthread_cond_broadcast
versioned_symbol (libpthread, __pthread_cond_broadcast, pthread_cond_broadcast,
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
index 4909f4910..013fcc303 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2004,2005,2007,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -36,10 +36,11 @@ __pthread_cond_signal:
cfi_startproc
pushl %ebx
cfi_adjust_cfa_offset(4)
+ cfi_rel_offset(%ebx, 0)
pushl %edi
cfi_adjust_cfa_offset(4)
- cfi_offset(%ebx, -8)
- cfi_offset(%edi, -12)
+ cfi_rel_offset(%edi, 0)
+ cfi_remember_state
movl 12(%esp), %edi
@@ -75,10 +76,10 @@ __pthread_cond_signal:
/* Wake up one thread. */
pushl %esi
cfi_adjust_cfa_offset(4)
+ cfi_rel_offset(%esi, 0)
pushl %ebp
cfi_adjust_cfa_offset(4)
- cfi_offset(%esi, -16)
- cfi_offset(%ebp, -20)
+ cfi_rel_offset(%ebp, 0)
#if FUTEX_PRIVATE_FLAG > 255
xorl %ecx, %ecx
@@ -121,9 +122,7 @@ __pthread_cond_signal:
cfi_restore(%ebx)
ret
- cfi_adjust_cfa_offset(8)
- cfi_offset(%ebx, -8)
- cfi_offset(%edi, -12)
+ cfi_restore_state
7: /* %ecx should be either FUTEX_WAKE_OP or
FUTEX_WAKE_OP|FUTEX_PRIVATE_FLAG from the previous syscall. */
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/pt-initfini.c b/libc/nptl/sysdeps/unix/sysv/linux/sh/pt-initfini.c
index 5391d5cc8..82c97c352 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/sh/pt-initfini.c
+++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/pt-initfini.c
@@ -1,5 +1,5 @@
-/* Special .init and .fini section support for SH. NPTL version.
- Copyright (C) 2003 Free Software Foundation, Inc.
+/* Special .init and .fini section support for SH. NPTL version.
+ Copyright (C) 2003, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it
@@ -62,19 +62,12 @@ _init:\n\
mov.l .L24,r1\n\
add r0,r1\n\
jsr @r1\n\
- nop\n\
- mova .L23,r0\n\
- mov.l .L23,r1\n\
- add r0,r1\n\
- jsr @r1\n\
mov r15,r14\n\
bra 1f\n\
nop\n\
.align 2\n\
.L22:\n\
.long _GLOBAL_OFFSET_TABLE_\n\
-.L23:\n\
- .long __gmon_start__@PLT\n\
.L24:\n\
.long __pthread_initialize_minimal_internal@PLT\n\
1:\n\
@@ -91,16 +84,6 @@ _init:\n\
rts \n\
mov.l @r15+,r12\n\
END_INIT\n\
- .section .text\n\
- .align 5\n\
- .weak __gmon_start__\n\
- .type __gmon_start__,@function\n\
-__gmon_start__:\n\
- mov.l r14,@-r15\n\
- mov r15,r14\n\
- mov r14,r15\n\
- rts \n\
- mov.l @r15+,r14\n\
\n\
/*@_init_EPILOG_ENDS*/\n\
\n\
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
index 0d48ec6fc..680696200 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
@@ -96,8 +96,8 @@ ENTRY(__pthread_disable_asynccancel)
cmpxchgl %r11d, %fs:CANCELHANDLING
jnz 2b
-3: movl %r11d, %eax
- andl $(TCB_CANCELING_BITMASK|TCB_CANCELED_BITMASK), %eax
+ movl %r11d, %eax
+3: andl $(TCB_CANCELING_BITMASK|TCB_CANCELED_BITMASK), %eax
cmpl $TCB_CANCELING_BITMASK, %eax
je 4f
1: ret
@@ -111,5 +111,6 @@ ENTRY(__pthread_disable_asynccancel)
addq $CANCELHANDLING, %rdi
LOAD_PRIVATE_FUTEX_WAIT (%esi)
syscall
+ movl %fs:CANCELHANDLING, %eax
jmp 3b
END(__pthread_disable_asynccancel)