summaryrefslogtreecommitdiff
path: root/libc/nptl/sysdeps/unix
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2013-06-15 17:37:04 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2013-06-15 17:37:04 +0000
commit3625809e03b7287e244a6a2563d5217426e88d5c (patch)
treefecf84cbf45a9412ad727953f17ad0e5ef804e9f /libc/nptl/sysdeps/unix
parent8548b3be8c48bf62bd4e20fb0ee958338b01bc6c (diff)
downloadeglibc2-3625809e03b7287e244a6a2563d5217426e88d5c.tar.gz
Merge changes between r23217 and r23296 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@23297 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/nptl/sysdeps/unix')
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S2
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h9
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c2
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c7
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h2
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S2
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S8
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S4
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S32
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S28
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_once.S6
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S2
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S2
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h2
-rw-r--r--libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h9
15 files changed, 62 insertions, 55 deletions
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
index bbc46cad3..68f237234 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
@@ -114,7 +114,7 @@ pthread_barrier_wait:
cfi_adjust_cfa_offset(4)
cfi_offset(%ebx, -8)
-
+
/* The necessary number of threads arrived. */
3:
#if CURR_EVENT == 0
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h b/libc/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
index f51f65092..f665ac9e6 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
+++ b/libc/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
@@ -224,20 +224,21 @@ LLL_STUB_UNWIND_INFO_END
#define lll_futex_wake(futex, nr, private) \
- do { \
- int __ignore; \
+ ({ \
+ int __status; \
register __typeof (nr) _nr asm ("edx") = (nr); \
LIBC_PROBE (lll_futex_wake, 3, futex, nr, private); \
__asm __volatile (LLL_EBX_LOAD \
LLL_ENTER_KERNEL \
LLL_EBX_LOAD \
- : "=a" (__ignore) \
+ : "=a" (__status) \
: "0" (SYS_futex), LLL_EBX_REG (futex), \
"c" (__lll_private_flag (FUTEX_WAKE, private)), \
"d" (_nr), \
"i" (0) /* phony, to align next arg's number */, \
"i" (offsetof (tcbhead_t, sysinfo))); \
- } while (0)
+ __status; \
+ })
/* NB: in the lll_trylock macro we simply return the value in %eax
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c b/libc/nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c
index 7f9367081..ace858fd1 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c
+++ b/libc/nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c
@@ -48,7 +48,7 @@ symbol_version (__novmx_siglongjmp,siglongjmp,GLIBC_2.3);
symbol_version (__novmx_longjmp,longjmp,GLIBC_2.0);
symbol_version (__novmx_siglongjmp,siglongjmp,GLIBC_2.0);
# endif
-#endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)) */
+#endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)) */
void
__vmx_longjmp (jmp_buf env, int val)
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c b/libc/nptl/sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
index 00bb29b3f..2a60f8e19 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
+++ b/libc/nptl/sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
@@ -42,7 +42,12 @@ __pthread_attr_getaffinity_new (const pthread_attr_t *attr, size_t cpusetsize,
if (((char *) iattr->cpuset)[cnt] != 0)
return EINVAL;
- void *p = mempcpy (cpuset, iattr->cpuset, iattr->cpusetsize);
+ /* Copy over the cpuset from the thread attribute object. Limit the copy
+ to the minimum of the source and destination sizes to prevent a buffer
+ overrun. If the destination is larger, fill the remaining space with
+ zeroes. */
+ void *p = mempcpy (cpuset, iattr->cpuset,
+ MIN (iattr->cpusetsize, cpusetsize));
if (cpusetsize > iattr->cpusetsize)
memset (p, '\0', cpusetsize - iattr->cpusetsize);
}
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h b/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h
index 124fe68bd..486e02c15 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h
+++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h
@@ -70,7 +70,7 @@
: (fl)) \
: ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \
& THREAD_GETMEM (THREAD_SELF, header.private_futex))))
-# endif
+# endif
#endif
#ifndef __ASSEMBLER__
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S b/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
index c10ec33f2..54209ceff 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
@@ -210,7 +210,7 @@ pthread_barrier_wait:
bra 7b
mov r9, r6
-9:
+9:
mov r6, r9
mov.l @(PRIVATE,r8), r5
mov #LLL_SHARED, r0
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S b/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
index ffdffbc6f..a5b4f9c6f 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
@@ -200,7 +200,7 @@ __pthread_cond_broadcast:
bf/s 99f
mov #LLL_PRIVATE, r6
mov #LLL_SHARED, r6
-99:
+99:
extu.b r6, r6
mov.l .Lwait5, r1
bsrf r1
@@ -220,7 +220,7 @@ __pthread_cond_broadcast:
bf/s 99f
mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
-99:
+99:
mov.l .Lwake5, r1
bsrf r1
extu.b r5, r5
@@ -239,7 +239,7 @@ __pthread_cond_broadcast:
bf/s 99f
mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
-99:
+99:
mov.l .Lwake6, r1
bsrf r1
extu.b r5, r5
@@ -263,7 +263,7 @@ __pthread_cond_broadcast:
mov #FUTEX_WAKE, r0
or r0, r5
#endif
-99:
+99:
mov #-1, r6
shlr r6 /* r6 = 0x7fffffff */
mov #0, r7
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S b/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
index 347c803ad..88d087045 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
@@ -162,7 +162,7 @@ __pthread_cond_signal:
bf/s 99f
mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
-99:
+99:
mov.l .Lwake4, r1
bsrf r1
extu.b r5, r5
@@ -181,7 +181,7 @@ __pthread_cond_signal:
bf/s 99f
mov #LLL_PRIVATE, r6
mov #LLL_SHARED, r6
-99:
+99:
extu.b r6, r6
mov.l .Lwait4, r1
bsrf r1
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S b/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
index 196add285..2c21883f7 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
@@ -107,7 +107,7 @@ __pthread_cond_timedwait:
bt 17f
mov.l r9, @(dep_mutex,r8)
-17:
+17:
/* Unlock the mutex. */
mov.l .Lmunlock1, r1
mov #0, r5
@@ -137,14 +137,14 @@ __pthread_cond_timedwait:
mov.l @(cond_nwaiters,r8), r0
add r2, r0
mov.l r0, @(cond_nwaiters,r8)
-
+
/* Get and store current wakeup_seq value. */
mov.l @(wakeup_seq,r8), r10
mov.l @(wakeup_seq+4,r8), r11
mov.l @(broadcast_seq,r8), r0
mov.l r0, @(4,r15)
-8:
+8:
/* Get current time. */
#ifdef __NR_clock_gettime
/* Get the clock number. */
@@ -168,7 +168,7 @@ __pthread_cond_timedwait:
.L__NR_clock_gettime:
.word __NR_clock_gettime
-0:
+0:
#else
mov r15, r4
add #16, r4
@@ -240,7 +240,7 @@ __pthread_cond_timedwait:
mov #FUTEX_WAIT, r0
or r0, r5
#endif
-99:
+99:
mov.l @(8,r15), r6
mov r8, r4
add #cond_futex, r4
@@ -364,15 +364,15 @@ __pthread_cond_timedwait:
mov #FUTEX_WAKE, r0
or r0, r5
#endif
-99:
+99:
mov #1, r6
mov #0, r7
mov #SYS_futex, r3
extu.b r3, r3
trapa #0x14
SYSCALL_INST_PAD
-
-25:
+
+25:
#if cond_lock != 0
DEC (@(cond_lock,r8), r2)
#else
@@ -393,7 +393,7 @@ __pthread_cond_timedwait:
bf 18f
mov.l @(24,r15), r0
-18:
+18:
cfi_remember_state
add #64, r15
cfi_adjust_cfa_offset (-64)
@@ -449,7 +449,7 @@ __pthread_cond_timedwait:
bf/s 99f
mov #LLL_PRIVATE, r6
mov #LLL_SHARED, r6
-99:
+99:
extu.b r6, r6
mov.l .Lwait2, r1
bsrf r1
@@ -469,7 +469,7 @@ __pthread_cond_timedwait:
bf/s 99f
mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
-99:
+99:
mov.l .Lmwait2, r1
bsrf r1
extu.b r5, r5
@@ -488,7 +488,7 @@ __pthread_cond_timedwait:
bf/s 99f
mov #LLL_PRIVATE, r6
mov #LLL_SHARED, r6
-99:
+99:
extu.b r6, r6
mov.l .Lwait3, r1
bsrf r1
@@ -508,7 +508,7 @@ __pthread_cond_timedwait:
bf/s 99f
mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
-99:
+99:
mov.l .Lmwait3, r1
bsrf r1
extu.b r5, r5
@@ -536,7 +536,7 @@ __pthread_cond_timedwait:
bf/s 99f
mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
-99:
+99:
mov.l .Lmwait4, r1
bsrf r1
extu.b r5, r5
@@ -585,7 +585,7 @@ __condvar_tw_cleanup:
bf/s 99f
mov #LLL_PRIVATE, r6
mov #LLL_SHARED, r6
-99:
+99:
extu.b r6, r6
mov.l .Lwait5, r1
bsrf r1
@@ -685,7 +685,7 @@ __condvar_tw_cleanup:
bf/s 99f
mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
-99:
+99:
mov.l .Lmwait5, r1
bsrf r1
extu.b r5, r5
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S b/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
index 6859de57d..c56b8b1be 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
@@ -86,7 +86,7 @@ __pthread_cond_wait:
.long _GLOBAL_OFFSET_TABLE_
#endif
-2:
+2:
/* Store the reference to the mutex. If there is already a
different value in there this is a bad user bug. */
mov.l @(dep_mutex,r8),r0
@@ -94,7 +94,7 @@ __pthread_cond_wait:
bt 15f
mov.l r9, @(dep_mutex,r8)
-15:
+15:
/* Unlock the mutex. */
mov.l .Lmunlock0, r1
mov #0, r5
@@ -167,7 +167,7 @@ __pthread_cond_wait:
mov #FUTEX_WAIT, r0
or r0, r5
#endif
-99:
+99:
mov.l @(8,r15), r6
mov r8, r4
add #cond_futex, r4
@@ -179,7 +179,7 @@ __pthread_cond_wait:
mov.l .Ldisable0, r1
bsrf r1
mov.l @r15, r4
-.Ldisable0b:
+.Ldisable0b:
.LcleanupEND:
/* Lock. */
@@ -260,7 +260,7 @@ __pthread_cond_wait:
mov #FUTEX_WAKE, r0
or r0, r5
#endif
-99:
+99:
mov #1, r6
mov #0, r7
mov #SYS_futex, r3
@@ -333,7 +333,7 @@ __pthread_cond_wait:
bf/s 99f
mov #LLL_PRIVATE, r6
mov #LLL_SHARED, r6
-99:
+99:
extu.b r6, r6
mov.l .Lwait0, r1
bsrf r1
@@ -352,7 +352,7 @@ __pthread_cond_wait:
bf/s 99f
mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
-99:
+99:
mov.l .Lwake0, r1
bsrf r1
extu.b r5, r5
@@ -371,7 +371,7 @@ __pthread_cond_wait:
bf/s 99f
mov #LLL_PRIVATE, r6
mov #LLL_SHARED, r6
-99:
+99:
extu.b r6, r6
mov.l .Lwait1, r1
bsrf r1
@@ -391,7 +391,7 @@ __pthread_cond_wait:
bf/s 99f
mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
-99:
+99:
mov.l .Lwake1, r1
bsrf r1
extu.b r5, r5
@@ -419,7 +419,7 @@ __pthread_cond_wait:
bf/s 99f
mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
-99:
+99:
mov.l .Lwake2, r1
bsrf r1
extu.b r5, r5
@@ -469,7 +469,7 @@ __condvar_w_cleanup:
bf/s 99f
mov #LLL_PRIVATE, r6
mov #LLL_SHARED, r6
-99:
+99:
extu.b r6, r6
mov.l .Lwait3, r1
bsrf r1
@@ -557,7 +557,7 @@ __condvar_w_cleanup:
mov #FUTEX_WAKE, r0
or r0, r5
#endif
-99:
+99:
mov #1, r6
mov #0, r7
mov #SYS_futex, r3
@@ -584,7 +584,7 @@ __condvar_w_cleanup:
bf/s 99f
mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
-99:
+99:
mov.l .Lwake3, r1
bsrf r1
extu.b r5, r5
@@ -611,7 +611,7 @@ __condvar_w_cleanup:
mov #FUTEX_WAKE, r0
or r0, r5
#endif
-99:
+99:
mov #-1, r6
shlr r6 /* r6 = 0x7fffffff */
mov #0, r7
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_once.S b/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_once.S
index 0ae918321..99c96e35f 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_once.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_once.S
@@ -72,7 +72,7 @@ __pthread_once:
add r12, r2
#endif
mov.l @r2, r3
- or r3, r0
+ or r3, r0
or #1, r0
mov r0, r3
mov r1, r5
@@ -119,10 +119,10 @@ __pthread_once:
.Lgot:
.long _GLOBAL_OFFSET_TABLE_
#ifdef PIC
-.Lfgen:
+.Lfgen:
.long __fork_generation@GOTOFF
#else
-.Lfgen:
+.Lfgen:
.long __fork_generation
#endif
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S b/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S
index 56dce73e8..ea1288422 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S
@@ -192,7 +192,7 @@ __pthread_rwlock_rdlock:
.Ltidoff:
.word TID - TLS_PRE_TCB_SIZE
-
+
6:
mov r8, r4
#if MUTEX != 0
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S b/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S
index 011b5a3b6..213d5f68f 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S
+++ b/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S
@@ -209,7 +209,7 @@ __pthread_rwlock_unlock:
.word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE
#endif
.align 2
-.Lwait8:
+.Lwait8:
.long __lll_lock_wait-.Lwait8b
.Lwake8:
.long __lll_unlock_wake-.Lwake8b
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h b/libc/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
index 2d7d9f82f..5ee8f6d7b 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
+++ b/libc/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
@@ -78,7 +78,7 @@ extern void __cpu_relax (void);
: (fl)) \
: ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \
& THREAD_GETMEM (THREAD_SELF, header.private_futex))))
-# endif
+# endif
#endif
diff --git a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
index 67222940c..7a176aec3 100644
--- a/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
+++ b/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
@@ -225,17 +225,18 @@ LLL_STUB_UNWIND_INFO_END
#define lll_futex_wake(futex, nr, private) \
- do { \
- int __ignore; \
+ ({ \
+ int __status; \
register __typeof (nr) _nr __asm ("edx") = (nr); \
LIBC_PROBE (lll_futex_wake, 3, futex, nr, private); \
__asm __volatile ("syscall" \
- : "=a" (__ignore) \
+ : "=a" (__status) \
: "0" (SYS_futex), "D" (futex), \
"S" (__lll_private_flag (FUTEX_WAKE, private)), \
"d" (_nr) \
: "memory", "cc", "r10", "r11", "cx"); \
- } while (0)
+ __status; \
+ })
/* NB: in the lll_trylock macro we simply return the value in %eax