Compare commits

...
Author SHA1 Message Date
Jakub Jelinek e6ff5e32b8 . 2007-07-31 13:39:49 +00:00
Jakub Jelinek 007bd9c4bc * NEWS, version.h (VERSION): 2.6.1. 2007-07-31 13:02:49 +00:00
Jakub Jelinek 8dce637e35 * sysdeps/unix/sysv/linux/i386/clone.S: Revert 2006-11-30 changes.
* sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
2007-07-31 12:51:32 +00:00
Jakub Jelinek 6120b32908 2007-07-31 Jakub Jelinek <jakub@redhat.com>
* stdio-common/tfformat.c (sprint_doubles): Add 12 new tests.

2007-07-28  Ulrich Drepper  <drepper@redhat.com>

	[BZ #4858]
	* stdio-common/printf_fp.c (___printf_fp): Fix special case of
	#.0g and value rounded to 1.0.
	* stdio-common/tfformat.c (sprint_doubles): Add two new tests.
2007-07-31 12:42:39 +00:00
Jakub Jelinek 78a2b0ca2e 2007-07-27 Jakub Jelinek <jakub@redhat.com>
* sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
	of the structure for sparc32.

2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>

	* sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
2007-07-27 22:16:43 +00:00
Jakub Jelinek 13a4ee0bb4 [BZ #4745]
[BZ #4586]
	[BZ #4702]
	[BZ #4525]
	[BZ #4514]
	[BZ #4512]
	Merge selected bugfixes from the trunk.
2007-07-12 13:29:44 +00:00
316 changed files with 4467 additions and 18516 deletions
+72 -440
View File
@@ -1,3 +1,24 @@
2007-07-31 Jakub Jelinek <jakub@redhat.com>
* NEWS, version.h (VERSION): 2.6.1.
* sysdeps/unix/sysv/linux/i386/clone.S: Revert 2006-11-30 changes.
* sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
* stdio-common/tfformat.c (sprint_doubles): Add 12 new tests.
2007-07-28 Ulrich Drepper <drepper@redhat.com>
[BZ #4858]
* stdio-common/printf_fp.c (___printf_fp): Fix special case of
#.0g and value rounded to 1.0.
* stdio-common/tfformat.c (sprint_doubles): Add two new tests.
2007-06-04 Jakub Jelinek <jakub@redhat.com>
* math/test-misc.c (main): Don't run last batch of tests with
IBM long double format.
2007-07-07 Ulrich Drepper <drepper@redhat.com>
[BZ #4745]
@@ -10,10 +31,13 @@
* stdio-common/bug19.c: New file.
* stdio-common/bug19a.c: New file.
2007-07-05 Mike Frysinger <vapier@gentoo.org>
2007-06-06 Jakub Jelinek <jakub@redhat.com>
* Makeconfig ($(common-objpfx)gnu/lib-names.stmp): Use LC_ALL=C when
running awk script.
[BZ #4586]
* sysdeps/i386/ldbl2mpn.c (__mpn_extract_long_double): Treat
pseudo-zeros as zero.
* sysdeps/x86_64/ldbl2mpn.c: New file.
* sysdeps/ia64/ldbl2mpn.c: New file.
2007-07-01 Jakub Jelinek <jakub@redhat.com>
@@ -31,34 +55,31 @@
* nis/nss-default.c: Include errno.h.
(init): Preserve errno.
2007-07-02 Ulrich Drepper <drepper@redhat.com>
2007-06-19 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/bits/socket.h (PF_UNIX): Update comment.
* sysdeps/generic/ldsodefs.h (rtld_global): Reorder some elements
to fill in holes
(rtld_global_ro): Likewise.
2007-06-30 Ulrich Drepper <drepper@redhat.com>
2007-06-18 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/bits/socket.h: Add PF_RXRPC and AF_RXRPC.
* elf/dl-addr.c (_dl_addr): Skip PT_LOAD checking if l_contiguous.
Move PT_LOAD checking to...
(_dl_addr_inside_object): ... here, new function.
* elf/dl-sym.c (do_sym): If not l_contiguous,
call _dl_addr_inside_object.
* elf/dl-iteratephdr.c (__dl_iterate_phdr): Likewise.
* dlfcn/dlinfo.c (dlinfo_doit): Likewise.
* elf/dl-open.c (dl_open_worker): Likewise.
(_dl_addr_inside_object): New function if IS_IN_rtld.
* elf/dl-load.c (_dl_map_object_from_fd): Set l_contiguous if no
holes are present or are PROT_NONE protected.
* include/link.h (struct link_map): Add l_contiguous field.
* sysdeps/generic/ldsodefs.h (_dl_addr_inside_object): New prototype.
2007-06-29 Martin Schwidefsky <schwidefsky@de.ibm.com>
2007-06-18 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/bits/socket.h: Add PF_IUCV and AF_IUCV.
2007-06-29 Martin Schwidefsky <schwidefsky@de.ibm.com>
* sysdeps/s390/dl-procinfo.c: New file.
* sysdeps/s390/dl-procinfo.h: New file.
* sysdeps/unix/sysv/linux/s390/dl-procinfo.h: New file.
2007-06-29 Jakub Jelinek <jakub@redhat.com>
* elf/dl-load.c (open_verify): Find .note.ABI-tag notes even
in PT_NOTE segments with multiple notes.
* elf/readelflib.c (process_elf_file): Likewise.
2007-06-22 Ulrich Drepper <drepper@redhat.com>
* nis/nis_domain_of.c (__nis_domain_of): Make the code a bit more
ISO C compliant.
* elf/rtld.c (dl_main): Don't call init_tls more than once.
2007-06-19 Ulrich Drepper <drepper@redhat.com>
@@ -92,88 +113,6 @@
* elf/dl-object.c (_dl_new_object): Don't use
__rtld_mrlock_initialize.
2007-06-19 Ulrich Drepper <drepper@redhat.com>
* sysdeps/generic/ldsodefs.h (rtld_global): Reorder some elements
to fill in holes
(rtld_global_ro): Likewise.
2007-06-18 Jakub Jelinek <jakub@redhat.com>
* elf/dl-addr.c (_dl_addr): Skip PT_LOAD checking if l_contiguous.
Move PT_LOAD checking to...
(_dl_addr_inside_object): ... here, new function.
* elf/dl-sym.c (do_sym): If not l_contiguous,
call _dl_addr_inside_object.
* elf/dl-iteratephdr.c (__dl_iterate_phdr): Likewise.
* dlfcn/dlinfo.c (dlinfo_doit): Likewise.
* elf/dl-open.c (dl_open_worker): Likewise.
(_dl_addr_inside_object): New function if IS_IN_rtld.
* elf/dl-load.c (_dl_map_object_from_fd): Set l_contiguous if no
holes are present or are PROT_NONE protected.
* include/link.h (struct link_map): Add l_contiguous field.
* sysdeps/generic/ldsodefs.h (_dl_addr_inside_object): New prototype.
2007-06-18 Jakub Jelinek <jakub@redhat.com>
Tomas Janousek <tjanouse@redhat.com>
Ulrich Drepper <drepper@redhat.com>
[BZ #4647]
* resolv/res_send.c (send_dg): Remove socket_pf. Use ipv6_unavail
member in __res_state, only convaddr4to6 if nssocks[ns] is a PF_INET6
socket.
* resolv/resolv.h (__res_state): Add ipv6_unavail member. Make
unused member a bitmap.
* resolv/res_init.c (__res_vinit): Reset ipv6_unavail if IPv6
servers are configured.
2007-06-18 Jakub Jelinek <jakub@redhat.com>
* elf/rtld.c (dl_main): Don't call init_tls more than once.
2007-06-17 Andreas Schwab <schwab@suse.de>
* sysdeps/generic/initfini.c: Tell gcc about the nonstandard sections.
2007-06-16 Andreas Jaeger <aj@suse.de>
[BZ #4125]
* sysdeps/unix/sysv/linux/sys/ptrace.h
(PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK,
PTRACE_O_TRACEVFORK, PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC,
PTRACE_O_TRACEVFORKDONE, PTRACE_O_TRACEEXIT, PTRACE_O_MASK,
PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK, PTRACE_EVENT_CLONE,
PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE, PTRACE_EVENT_EXIT):
Define.
* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h: Likewise.
* sysdeps/unix/sysv/linux/ia64/sys/ptrace.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sys/ptrace.h: Likewise.
* sysdeps/unix/sysv/linux/s390/sys/ptrace.h: Likewise.
2007-06-16 Ulrich Drepper <drepper@redhat.com>
[BZ #4599]
* sysdeps/unix/sysv/linux/check_pf.c (make_request): When
determining whether there are IPv4/IPv6 addresses, ignore loopback
addresses.
2007-06-14 Uros Bizjak <ubizjak@gmail.com>
* soft-fp/soft-fp.h (CMPtype): Define to "int" if undefined.
* soft-fp/eqdf2.c (__eqdf2): Use CMPtype instead of int
as the return type. Change type of "r" variable to CMPtype.
* soft-fp/eqsf2.c (__eqsf2): Likewise.
* soft-fp/eqtf2.c (__eqtf2): Likewise.
* soft-fp/gedf2.c (__gedf2): Likewise.
* soft-fp/gesf2.c (__gesf2): Likewise.
* soft-fp/getf2.c (__getf2): Likewise.
* soft-fp/ledf2.c (__ledf2): Likewise.
* soft-fp/lesf2.c (__lesf2): Likewise.
* soft-fp/letf2.c (__letf2): Likewise.
* soft-fp/unorddf2 (__unorddf2): Likewise.
* soft-fp/unordsf2 (__unordsf2): Likewise.
* soft-fp/unordtf2 (__unordtf2): Likewise.
2007-06-09 Ulrich Drepper <drepper@redhat.com>
* elf/do-lookup.h (do_lookup_x): Read r_nlist before r_list and
@@ -187,46 +126,19 @@
* elf/dl-close.c (_dl_close_worker): Remove all to be removed
libraries from the global scope at once and call THREAD_GSCOPE_WAIT
at most once per _dl_close_worker.
2007-06-08 Ulrich Drepper <drepper@redhat.com>
2007-05-18 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/bits/sched.h: Make second parameter of
__sched_cpucount as const.
* posix/sched_cpucount.c: Adjust.
* posix/sched_cpucount.c (__sched_cpucount): Allow using special
instruction for counting bits.
* sysdeps/x86_64/sched_cpucount.c: New file.
2007-06-07 Ulrich Drepper <drepper@redhat.com>
* configure.in: Avoid variable named BASH.
* config.make.in: Likewise.
Patch in part by Mike Frysinger.
2007-06-06 Jakub Jelinek <jakub@redhat.com>
[BZ #4586]
* sysdeps/i386/ldbl2mpn.c (__mpn_extract_long_double): Treat
pseudo-zeros as zero.
* sysdeps/x86_64/ldbl2mpn.c: New file.
* sysdeps/ia64/ldbl2mpn.c: New file.
2007-06-04 Jakub Jelinek <jakub@redhat.com>
* sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (nextafterl): Remove
unused ily variable. Fix nextafterl on +-__LDBL_MAX__ and +-Inf.
Remove unreachable code at the end.
2007-06-01 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c: Correct description of
ldbl-128ibm in comment.
(fpclassifyl): Correct classification of denormals.
* sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (nextafterl): Correct
return value for MIN denormal. Rewrite using long double math too
correctly handle denormals and canonicalize the results.
* elf/dl-close.c (_dl_close_worker): When removing object from
global scope, wait for all lookups to finish afterwards.
* elf/dl-open.c (add_to_global): When global scope array must
grow, allocate a new one and free old array only after all
lookups finish.
* elf/dl-runtime.c (_dl_fixup): Protect using global scope.
(_dl_lookup_symbol_x): Likewise.
* elf/dl-support.c: Define _dl_wait_lookup_done.
* sysdeps/generic/ldsodefs.h (struct rtld_global): Add
_dl_wait_lookup_done.
2007-06-05 Jakub Jelinek <jakub@redhat.com>
@@ -249,297 +161,34 @@
* stdio-common/tst-sprintf2.c: New test.
* stdio-common/Makefile (tests): Add tst-sprintf2.
* math/test-misc.c (main): Don't run last batch of tests with
IBM long double format.
2007-06-04 Jakub Jelinek <jakub@redhat.com>
2007-05-31 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/970/fpu/Implies: New file.
* sysdeps/powerpc/powerpc32/power5/fpu/Implies: New file.
* sysdeps/powerpc/powerpc32/power5+/fpu/Implies: New file.
* sysdeps/powerpc/powerpc32/power6/fpu/Implies: New file.
* sysdeps/powerpc/powerpc32/power6x/fpu/Implies: New file.
* sysdeps/powerpc/powerpc64/970/fpu/Implies: New file.
* sysdeps/powerpc/powerpc64/power5/fpu/Implies: New file.
* sysdeps/powerpc/powerpc64/power5+/fpu/Implies: New file.
* sysdeps/powerpc/powerpc64/power6/fpu/Implies: New file.
* sysdeps/powerpc/powerpc64/power6x/fpu/Implies: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/970/fpu/Implies: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/power4/fpu/Implies:
New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/power5/fpu/Implies:
New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/power5+/fpu/Implies:
New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/Implies:
New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/power6x/fpu/Implies:
New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/970/fpu/Implies: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/power4/fpu/Implies:
New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/power5/fpu/Implies:
New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/power5+/fpu/Implies:
New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/Implies:
New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/power6x/fpu/Implies:
New file.
2007-05-31 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/powerpc64/fpu/s_llrint.S: Move.
* sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S: To here.
* sysdeps/powerpc/powerpc32/powerpc64/fpu/s_llrintf.S: Move.
* sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S: To here.
* sysdeps/powerpc/powerpc32/powerpc64/fpu/s_llround.S: Move.
* sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S: To here.
* sysdeps/powerpc/powerpc32/powerpc64/fpu/s_llroundf.S: Move.
* sysdeps/powerpc/powerpc32/power4/fpu/s_llroundf.S: To here.
2007-05-22 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S
(LONG_DOUBLE_COMPAT): Specify correct version, GLIBC_2_1.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S
(LONG_DOUBLE_COMPAT): Specify correct version, GLIBC_2_1.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S
(LONG_DOUBLE_COMPAT): Specify correct version, GLIBC_2_1.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S
(LONG_DOUBLE_COMPAT): Specify correct version, GLIBC_2_1.
2007-05-21 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/power4/fpu/slowexp.c: New file.
* sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.c: New file.
* sysdeps/powerpc/powerpc64/power4/fpu/slowexp.c: New file.
* sysdeps/powerpc/powerpc64/power4/fpu/w_sqrt.c: New file.
2007-03-15 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/powerpc64/fpu/s_llrint.S
[LONG_DOUBLE_COMPAT]: Add compat_symbol for llrintl@@GLIBC_2_1.
2006-02-13 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S: New File
* sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S: New File
* sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S: New File
* sysdeps/powerpc/powerpc32/power6/fpu/s_llroundf.S: New File
2006-10-20 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/power4/fpu/slowpow.c: New file.
* sysdeps/powerpc/powerpc64/power4/fpu/slowpow.c: New file.
2006-10-03 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/powerpc64/fpu/s_llround.S: New file.
* sysdeps/powerpc/powerpc32/powerpc64/fpu/s_llroundf.S: New file.
* sysdeps/powerpc/powerpc32/powerpc64/fpu/Makefile: Moved.
* sysdeps/powerpc/powerpc32/powerpc64/fpu/mpa.c: Likewise.
* sysdeps/powerpc/powerpc32/power4/fpu/Makefile: To here.
* sysdeps/powerpc/powerpc32/power4/fpu/mpa.c: Likewise.
2006-09-29 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S: New file.
* sysdeps/powerpc/powerpc32/power6x/fpu/s_lround.S: New file.
* sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S: New file.
* sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S: New file.
2006-09-28 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S: New file.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_llroundf.S: New file.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S: New file.
* sysdeps/powerpc/powerpc32/power6x/fpu/Implies: New file.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S: New file.
* sysdeps/powerpc/powerpc64/power6x/fpu/Implies: New file.
2006-08-31 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/powerpc64/fpu/Makefile: New file.
* sysdeps/powerpc/powerpc32/powerpc64/fpu/mpa.c: New file.
* sysdeps/powerpc/powerpc64/power4/fpu/Makefile: New file.
* sysdeps/powerpc/powerpc64/power4/fpu/mpa.c: New file.
2006-06-15 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S: New file.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S: New file.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_floor.S: New file.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S: New file.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S: New file.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S: New file.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S: New file.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S: New file.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S: New file.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S: New file.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S: New file.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S: New file.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S: New file.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S: New file.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S: New file.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S: New file.
2006-03-20 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/powerpc64/fpu/s_llrint.S: New file.
* sysdeps/powerpc/powerpc32/powerpc64/fpu/s_llrintf.S: New file.
* sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (nextafterl): Remove
unused ily variable. Fix nextafterl on +-__LDBL_MAX__ and +-Inf.
Remove unreachable code at the end.
2007-06-01 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/power6/memset.S: New file.
* sysdeps/powerpc/powerpc64/power6/memset.S: New file.
2007-05-31 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/970/Implies: New file.
* sysdeps/powerpc/powerpc32/power5/Implies: New file.
* sysdeps/powerpc/powerpc32/power5+/Implies: New file.
* sysdeps/powerpc/powerpc32/power6/Implies: New file.
* sysdeps/powerpc/powerpc32/power6x/Implies: New file.
* sysdeps/powerpc/powerpc64/970/Implies: New file.
* sysdeps/powerpc/powerpc64/power5/Implies: New file.
* sysdeps/powerpc/powerpc64/power5+/Implies: New file.
* sysdeps/powerpc/powerpc64/power6/Implies: New file.
* sysdeps/powerpc/powerpc64/power6x/Implies: New file.
2007-05-21 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/power4/memset.S: New file
2007-03-13 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc64/memcpy.S: Improve aligned loop to minimize
branch miss-predicts. Ensure that cache line crossing does not impact
dispatch grouping.
2006-12-13 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc64/power4/memcopy.h: Replace with include
"../../powerpc32/power4/memcopy.h".
* sysdeps/powerpc/powerpc64/power4/wordcopy.c: Replace with include
"../../powerpc32/power4/wordcopy.c".
2006-10-03 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/powerpc64/Makefile: Moved.
* sysdeps/powerpc/powerpc32/powerpc64/memcopy.h: Likewise.
* sysdeps/powerpc/powerpc32/powerpc64/wordcopy.c: Likewise.
* sysdeps/powerpc/powerpc32/power4/Makefile: To here.
* sysdeps/powerpc/powerpc32/power4/memcopy.h: Likewise.
* sysdeps/powerpc/powerpc32/power4/wordcopy.c: Likewise.
2006-09-10 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/power6/memcpy.S: New file.
2006-08-31 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/power6/wordcopy.c: New file.
* sysdeps/powerpc/powerpc32/powerpc64/Makefile: New file.
* sysdeps/powerpc/powerpc32/powerpc64/memcopy.h: New file.
* sysdeps/powerpc/powerpc32/powerpc64/wordcopy.c: New file.
* sysdeps/powerpc/powerpc64/power4/Makefile: New file.
* sysdeps/powerpc/powerpc64/power4/memcopy.h: New file.
* sysdeps/powerpc/powerpc64/power4/wordcopy.c: New file.
* sysdeps/powerpc/powerpc64/power6/wordcopy.c: New file.
2006-07-06 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc64/power6/memcpy.S: New file.
2006-03-20 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc32/power4/memcmp.S: New file.
* sysdeps/powerpc/powerpc32/power4/memcpy.S: New file.
* sysdeps/powerpc/powerpc32/power4/memset.S: New file.
* sysdeps/powerpc/powerpc32/power4/strncmp.S: New file.
* sysdeps/powerpc/powerpc64/power4/memcmp.S: New file.
* sysdeps/powerpc/powerpc64/power4/memcpy.S: New file.
* sysdeps/powerpc/powerpc64/power4/strncmp.S: New file.
2007-05-29 Roland McGrath <roland@redhat.com>
* po/Makefile (po-sed-cmd): New variable.
(libc.pot.files): Move sed command text in there, avoid \ inside ''.
* sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c: Correct description of
ldbl-128ibm in comment.
(fpclassifyl): Correct classification of denormals.
* sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (nextafterl): Correct
return value for MIN denormal. Rewrite using long double math too
correctly handle denormals and canonicalize the results.
2007-05-29 Ulrich Drepper <drepper@redhat.com>
* crypt/md5-crypt.c: Fix comment.
* nscd/nscd_helper.c (get_mapping): Handle short replies instead
of crashing. When this is the case or if the reply is malformed,
don't try to close the new file descriptor since it does not
exist.
Patch in part by Guillaume Chazarain <guichaz@yahoo.fr>.
2007-05-28 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/futimes.c (miss_utimensat): Don't define
if __NR_utimensat is not defined.
2007-05-26 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/powerpc/libc-start.c: Include <sysdep.h>.
2007-05-25 Jakub Jelinek <jakub@redhat.com>
* io/bits/fcntl2.h (__open_2): Add nonnull attribute.
(open): Fix comment typos. Don't call __open_2 if flags
is a compile time constant without O_CREAT.
(__open64_2): Add nonnull attribute.
(open64): Fix comment typos. Don't call __open64_2 if flags
is a compile time constant without O_CREAT.
(__openat_2): Add nonnull attribute, fix nonnull attribute
on redirect.
(openat): Fix comment typos. Don't call __openat_2 if flags
is a compile time constant without O_CREAT.
(__openat64_2): Add nonnull attribute, fix nonnull attribute
on redirect.
(openat64): Fix comment typos. Don't call __openat64_2 if flags
is a compile time constant without O_CREAT.
2007-05-24 Ulrich Drepper <drepper@redhat.com>
* Makerules (sysd-rules): Define PTW for ptw-* files.
* Versions: Define GLIBC_2.7 for libc.
* include/stdio.h: Declare __fortify_fail.
* debug/fortify_fail.c: New file.
* debug/Makefile (routines): Add fortify_fail.
* debug/chk_fail.c: Use __fortify_fail.
* debug/stack_chk_fail.c: Likewise.
* io/Versions: Export __open_2, __open64_2, __openat_2, and
__openat64_2 for GLIBC_2.7.
* io/fcntl.h: When compiling with fortification, include bits/fcntl2.h.
* io/open.c: Define *_2 variant of function which checks for O_CREAT
and fails if necessary.
* io/open64.c: Likewise.
* io/openat.c: Likewise.
* io/openat64.c: Likewise.
* sysdeps/unix/sysv/linux/open64.c: Likewise.
* sysdeps/unix/sysv/linux/openat.c: Likewise.
* sysdeps/unix/sysv/linux/openat64.c: Likewise.
* io/bits/fcntl2.h: New file.
* include/fcntl.h: Declare __open_2, __open64_2, __openat_2, and
__openat64_2.
* include/bits/fcntl2.h: New file.
* sysdeps/unix/sysv/linux/Makefile [subdir=io] (sysdep_routines):
Add open_2.
* sysdeps/unix/sysv/linux/open_2.c: New file.
2007-05-21 Ulrich Drepper <drepper@redhat.com>
* sysdeps/x86_64/cacheinfo.c (init_cacheinfo): Pass correct value
as second parameter to handle_intel.
* nscd/aicache.c (addhstaiX): If reported TTL is zero don't cache
the entry.
* sysdeps/unix/sysv/linux/x86_64/sysconf.c: Move cache information
handling to ...
* sysdeps/x86_64/cacheinfo.c: ... here. New file.
@@ -549,6 +198,8 @@
* sysdeps/x86_64/mempcpy.S: Adjust appropriately.
Patch by Evandro Menezes <evandro.menezes@amd.com>.
2007-05-21 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/epoll_pwait.S: New file.
2007-05-21 Jakub Jelinek <jakub@redhat.com>
@@ -582,24 +233,8 @@
* malloc/Makefile (CFLAGS-malloc.c): Revert accidental
2007-05-07 commit.
2007-05-19 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_PRIVATE_FUTEX):
Define for kernel >= 2.6.22.
2007-05-18 Ulrich Drepper <drepper@redhat.com>
* elf/dl-close.c (_dl_close_worker): When removing object from
global scope, wait for all lookups to finish afterwards.
* elf/dl-open.c (add_to_global): When global scope array must
grow, allocate a new one and free old array only after all
lookups finish.
* elf/dl-runtime.c (_dl_fixup): Protect using global scope.
(_dl_lookup_symbol_x): Likewise.
* elf/dl-support.c: Define _dl_wait_lookup_done.
* sysdeps/generic/ldsodefs.h (struct rtld_global): Add
_dl_wait_lookup_done.
* malloc/malloc.c (do_check_chunk): Correct check for mmaped block
not overlapping with arena.
@@ -618,12 +253,10 @@
* sysdeps/x86_64/fpu/k_sinl.c: New file.
* sysdeps/x86_64/fpu/k_tanl.c: New file.
* version.h (VERSION): Set to 2.6.90.
2007-05-14 Ulrich Drepper <drepper@redhat.com>
* version.h (VERSION): Define to 2.6.
* include/features.h (__GLIBC_MINOR__): Define to 6.
* version.h (VERSION): Define to 6.
* include/features.h (__GLIBC_MINOR__): Likewise.
* malloc/malloc.c: Use all small bin slots on 64-bit archs.
@@ -631,7 +264,6 @@
sizes.
2007-05-13 Ulrich Drepper <drepper@redhat.com>
* malloc/malloc.c [MALLOC_DEBUG]: Keep track of current maximum
number of mmaps. n_mmaps_max is the target.
* malloc/hooks.c: Likewise.
+1 -1
View File
@@ -856,7 +856,7 @@ $(common-objpfx)gnu/lib-names.stmp: $(..)scripts/lib-names.awk \
$(common-objpfx)soversions.i
$(make-target-directory)
@rm -f ${@:stmp=T} $@
LC_ALL=C $(AWK) -f $^ > ${@:stmp=T}
$(AWK) -f $^ > ${@:stmp=T}
$(move-if-change) ${@:stmp=T} ${@:stmp=h}
touch $@
endif
+4 -4
View File
@@ -1,4 +1,4 @@
# Copyright (C) 1991-2006, 2007 Free Software Foundation, Inc.
# Copyright (C) 1991-2002,2003,2004,2005,2006 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
@@ -240,9 +240,9 @@ $(common-objpfx)sysd-rules: $(common-objpfx)config.make $(..)Makerules \
echo "\$$(objpfx)rtld-%$$o: $$dir/%.s \$$(before-compile); \
\$$(compile-command.s)"; \
echo "\$$(objpfx)ptw-%$$o: $$dir/%.S \$$(before-compile); \
\$$(compile-command.S) -DPTW"; \
\$$(compile-command.S)"; \
echo "\$$(objpfx)ptw-%$$o: $$dir/%.s \$$(before-compile); \
\$$(compile-command.s) -DPTW"; \
\$$(compile-command.s)"; \
echo "\$$(objpfx)m_%$$o: $$dir/s_%.S \$$(before-compile); \
\$$(compile-command.S)"; \
echo "\$$(objpfx)m_%$$o: $$dir/s_%.s \$$(before-compile); \
@@ -253,7 +253,7 @@ $(common-objpfx)sysd-rules: $(common-objpfx)config.make $(..)Makerules \
echo "\$$(objpfx)rtld-%$$o: $$dir/%.c \$$(before-compile); \
\$$(compile-command.c)"; \
echo "\$$(objpfx)ptw-%$$o: $$dir/%.c \$$(before-compile); \
\$$(compile-command.c) -DPTW"; \
\$$(compile-command.c)"; \
echo "\$$(objpfx)m_%$$o: $$dir/s_%.c \$$(before-compile); \
\$$(compile-command.c)"; \
done; \
+9
View File
@@ -4,6 +4,15 @@ See the end for copying conditions.
Please send GNU C library bug reports via <http://sources.redhat.com/bugzilla/>
using `glibc' in the "product" field.
Version 2.6.1
* The following bugs are resolved with this release:
4512, 4514, 4525, 4586, 4702, 4745, 4858
Visit <http://sources.redhat.com/bugzilla/> for the details of each bug.
Version 2.6
+2 -2
View File
@@ -1,4 +1,4 @@
This directory contains the version 2.6 release of the GNU C Library.
This directory contains the version 2.6.1 release of the GNU C Library.
The GNU C Library is the standard system C library for all GNU systems,
and is an important part of what makes up a GNU system. It provides the
@@ -52,7 +52,7 @@ The GNU C Library supports these configurations for using Linux kernels:
The code for other CPU configurations supported by volunteers outside of
the core glibc maintenance effort is contained in the separate `ports'
add-on. You can find glibc-ports-2.6 distributed separately in the
add-on. You can find glibc-ports-2.6.1 distributed separately in the
same place where you got the main glibc distribution files.
Currently these configurations are known to work using the `ports' add-on:
-1
View File
@@ -23,7 +23,6 @@ libc {
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
%ifdef USE_IN_LIBIO
HURD_CTHREADS_0.3
%endif
+1 -1
View File
@@ -117,7 +117,7 @@ LN_S = @LN_S@
MSGFMT = @MSGFMT@
# Script execution tools.
BASH = @BASH_SHELL@
BASH = @BASH@
KSH = @KSH@
AWK = @AWK@
PERL = @PERL@
Vendored
+3052 -3585
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -980,9 +980,9 @@ else
fi])
AC_SUBST(libc_cv_gcc_static_libgcc)
AC_PATH_PROG(BASH_SHELL, bash, no)
if test "$BASH_SHELL" != no &&
$BASH_SHELL -c 'test "$BASH_VERSINFO" \
AC_PATH_PROG(BASH, bash, no)
if test "$BASH" != no &&
$BASH -c 'test "$BASH_VERSINFO" \
&& test "$BASH_VERSINFO" -ge 2 >&/dev/null'; then
libc_cv_have_bash2=yes
else
@@ -991,7 +991,7 @@ fi
AC_SUBST(libc_cv_have_bash2)
dnl We need a ksh compatible shell for tzselect.
if test "$BASH_SHELL" = no; then
if test "$BASH" = no; then
AC_PATH_PROG(KSH, ksh, no)
if test "$KSH" = no; then
libc_cv_have_ksh=no
@@ -999,7 +999,7 @@ if test "$BASH_SHELL" = no; then
libc_cv_have_ksh=yes
fi
else
KSH="$BASH_SHELL"
KSH="$BASH"
AC_SUBST(KSH)
libc_cv_have_ksh=yes
fi
+1 -1
View File
@@ -106,7 +106,7 @@ __md5_crypt_r (key, salt, buffer, buflen)
/* The last part is the salt string. This must be at most 8
characters and it ends at the first `$' character (for
compatibility with existing implementations). */
compatibility which existing solutions). */
__md5_process_bytes (salt, salt_len, &ctx);
+2 -2
View File
@@ -1,4 +1,4 @@
# Copyright (C) 1998-2001,2004,2005,2006,2007 Free Software Foundation, Inc.
# Copyright (C) 1998-2001,2004,2005,2006 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
@@ -42,7 +42,7 @@ routines = backtrace backtracesyms backtracesymsfd noophooks \
gethostname_chk getdomainname_chk wcrtomb_chk mbsnrtowcs_chk \
wcsnrtombs_chk mbsrtowcs_chk wcsrtombs_chk mbstowcs_chk \
wcstombs_chk \
stack_chk_fail fortify_fail \
stack_chk_fail \
$(static-only-routines)
static-only-routines := warning-nop stack_chk_fail_local
+5 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2004, 2005 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
@@ -26,6 +26,9 @@ void
__attribute__ ((noreturn))
__chk_fail (void)
{
__fortify_fail ("buffer overflow detected");
/* The loop is added only to keep gcc happy. */
while (1)
__libc_message (2, "*** buffer overflow detected ***: %s terminated\n",
__libc_argv[0] ?: "<unknown>");
}
libc_hidden_def (__chk_fail)
-34
View File
@@ -1,34 +0,0 @@
/* Copyright (C) 2007 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
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <stdio.h>
#include <stdlib.h>
extern char **__libc_argv attribute_hidden;
void
__attribute__ ((noreturn))
__fortify_fail (msg)
const char *msg;
{
/* The loop is added only to keep gcc happy. */
while (1)
__libc_message (2, "*** %s ***: %s terminated\n",
msg, __libc_argv[0] ?: "<unknown>");
}
+5 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2005, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2005 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
@@ -26,5 +26,8 @@ void
__attribute__ ((noreturn))
__stack_chk_fail (void)
{
__fortify_fail ("stack smashing detected");
/* The loop is added only to keep gcc happy. */
while (1)
__libc_message (1, "*** stack smashing detected ***: %s terminated\n",
__libc_argv[0] ?: "<unknown>");
}
+3 -3
View File
@@ -494,11 +494,11 @@ _dl_close_worker (struct link_map *map)
|| (GL(dl_scope_free_list) != NULL
&& GL(dl_scope_free_list)->count)))
{
THREAD_GSCOPE_WAIT ();
struct dl_scope_free_list *fsl;
THREAD_GSCOPE_WAIT ();
/* Now we can free any queued old scopes. */
struct dl_scope_free_list *fsl = GL(dl_scope_free_list);
if (fsl != NULL)
if ((fsl = GL(dl_scope_free_list)) != NULL)
while (fsl->count > 0)
free (fsl->list[--fsl->count]);
}
+7 -24
View File
@@ -1634,7 +1634,7 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
{
ElfW(Ehdr) *ehdr;
ElfW(Phdr) *phdr, *ph;
ElfW(Word) *abi_note;
ElfW(Word) *abi_note, abi_note_buf[8];
unsigned int osversion;
size_t maplength;
@@ -1751,37 +1751,20 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
/* Check .note.ABI-tag if present. */
for (ph = phdr; ph < &phdr[ehdr->e_phnum]; ++ph)
if (ph->p_type == PT_NOTE && ph->p_filesz >= 32 && ph->p_align >= 4)
if (ph->p_type == PT_NOTE && ph->p_filesz == 32 && ph->p_align >= 4)
{
ElfW(Addr) size = ph->p_filesz;
if (ph->p_offset + size <= (size_t) fbp->len)
if (ph->p_offset + 32 <= (size_t) fbp->len)
abi_note = (void *) (fbp->buf + ph->p_offset);
else
{
abi_note = alloca (size);
__lseek (fd, ph->p_offset, SEEK_SET);
if (__libc_read (fd, (void *) abi_note, size) != size)
if (__libc_read (fd, (void *) abi_note_buf, 32) != 32)
goto read_error;
abi_note = abi_note_buf;
}
while (memcmp (abi_note, &expected_note, sizeof (expected_note)))
{
#define ROUND(len) (((len) + sizeof (ElfW(Word)) - 1) & -sizeof (ElfW(Word)))
ElfW(Addr) note_size = 3 * sizeof (ElfW(Word))
+ ROUND (abi_note[0])
+ ROUND (abi_note[1]);
if (size - 32 < note_size)
{
size = 0;
break;
}
size -= note_size;
abi_note = (void *) abi_note + note_size;
}
if (size == 0)
if (memcmp (abi_note, &expected_note, sizeof (expected_note)))
continue;
osversion = (abi_note[5] & 0xff) * 65536
+8 -29
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1999, 2000, 2001, 2002, 2007 Free Software Foundation, Inc.
/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1999 and
Jakub Jelinek <jakub@redhat.com>, 1999.
@@ -127,37 +127,16 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
break;
case PT_NOTE:
if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
if (!*osversion && segment->p_filesz == 32 && segment->p_align >= 4)
{
ElfW(Word) *abi_note = (ElfW(Word) *) (file_contents
+ segment->p_offset);
ElfW(Addr) size = segment->p_filesz;
while (abi_note [0] != 4 || abi_note [1] != 16
|| abi_note [2] != 1
|| memcmp (abi_note + 3, "GNU", 4) != 0)
{
#define ROUND(len) (((len) + sizeof (ElfW(Word)) - 1) & -sizeof (ElfW(Word)))
ElfW(Addr) note_size = 3 * sizeof (ElfW(Word))
+ ROUND (abi_note[0])
+ ROUND (abi_note[1]);
if (size - 32 < note_size || note_size == 0)
{
size = 0;
break;
}
size -= note_size;
abi_note = (void *) abi_note + note_size;
}
if (size == 0)
break;
*osversion = (abi_note [4] << 24) |
((abi_note [5] & 0xff) << 16) |
((abi_note [6] & 0xff) << 8) |
(abi_note [7] & 0xff);
if (abi_note [0] == 4 && abi_note [1] == 16 && abi_note [2] == 1
&& memcmp (abi_note + 3, "GNU", 4) == 0)
*osversion = (abi_note [4] << 24) |
((abi_note [5] & 0xff) << 16) |
((abi_note [6] & 0xff) << 8) |
(abi_note [7] & 0xff);
}
break;
-1
View File
@@ -1 +0,0 @@
#include "../../io/bits/fcntl2.h"
-5
View File
@@ -24,11 +24,6 @@ extern int __openat64 (int __fd, __const char *__file, int __oflag, ...)
__nonnull ((2));
libc_hidden_proto (__openat64)
extern int __open_2 (__const char *__path, int __oflag);
extern int __open64_2 (__const char *__path, int __oflag);
extern int __openat_2 (int __fd, __const char *__path, int __oflag);
extern int __openat64_2 (int __fd, __const char *__path, int __oflag);
/* Helper functions for the various *at functions. For Linux. */
extern void __atfct_seterrno (int errval, int fd, const char *buf)
-1
View File
@@ -65,7 +65,6 @@ extern int __gen_tempname (char *__tmpl, int __kind);
extern void __libc_fatal (__const char *__message)
__attribute__ ((__noreturn__));
extern void __libc_message (int do_abort, __const char *__fnt, ...);
extern void __fortify_fail (const char *msg) __attribute__ ((noreturn));
/* Acquire ownership of STREAM. */
extern void __flockfile (FILE *__stream);
-3
View File
@@ -116,7 +116,4 @@ libc {
GLIBC_2.6 {
utimensat; futimens;
}
GLIBC_2.7 {
__open_2; __open64_2; __openat_2; __openat64_2;
}
}
-177
View File
@@ -1,177 +0,0 @@
/* Checking macros for fcntl functions.
Copyright (C) 2007 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
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifndef _FCNTL_H
# error "Never include <bits/fcntl2.h> directly; use <fcntl.h> instead."
#endif
/* Check that calls to open and openat with O_CREAT set have an
appropriate third/fourth parameter. */
#ifndef __USE_FILE_OFFSET64
extern int __open_2 (__const char *__path, int __oflag) __nonnull ((1));
#else
extern int __REDIRECT (__open_2, (__const char *__file, int __oflag),
__open64_2) __nonnull ((1));
#endif
#define open(fname, flags, ...) \
({ int ___r; \
/* If the compiler complains about an invalid type, excess elements, etc \
in the initialization this means a parameter of the wrong type has \
been passed to open. */ \
int ___arr[] = { __VA_ARGS__ }; \
if (__builtin_constant_p (flags) && ((flags) & O_CREAT) != 0) \
{ \
/* If the compiler complains about the size of this array type the \
mode parameter is missing since O_CREAT has been used. */ \
typedef int __open_missing_mode[((flags) & O_CREAT) != 0 \
? ((long int) sizeof (___arr) \
- (long int) sizeof (int)) : 1]; \
} \
if (sizeof (___arr) == 0) \
{ \
if (__builtin_constant_p (flags) && ((flags) & O_CREAT) == 0) \
___r = open (fname, flags); \
else \
___r = __open_2 (fname, flags); \
} \
else \
{ \
/* If the compiler complains about the size of this array type too \
many parameters have been passed to open. */ \
typedef int __open_too_many_args[-(sizeof (___arr) > sizeof (int))]; \
___r = open (fname, flags, ___arr[0]); \
} \
___r; \
})
#ifdef __USE_LARGEFILE64
extern int __open64_2 (__const char *__path, int __oflag) __nonnull ((1));
# define open64(fname, flags, ...) \
({ int ___r; \
/* If the compiler complains about an invalid type, excess elements, etc \
in the initialization this means a parameter of the wrong type has \
been passed to open64. */ \
int ___arr[] = { __VA_ARGS__ }; \
if (__builtin_constant_p (flags) && ((flags) & O_CREAT) != 0) \
{ \
/* If the compiler complains about the size of this array type the \
mode parameter is missing since O_CREAT has been used. */ \
typedef int __open_missing_mode[((flags) & O_CREAT) != 0 \
? ((long int) sizeof (___arr) \
- (long int) sizeof (int)) : 1]; \
} \
if (sizeof (___arr) == 0) \
{ \
if (__builtin_constant_p (flags) && ((flags) & O_CREAT) == 0) \
___r = open64 (fname, flags); \
else \
___r = __open64_2 (fname, flags); \
} \
else \
{ \
/* If the compiler complains about the size of this array type too \
many parameters have been passed to open64. */ \
typedef int __open_too_many_args[-(sizeof (___arr) > sizeof (int))]; \
___r = open64 (fname, flags, ___arr[0]); \
} \
___r; \
})
#endif
#ifdef __USE_ATFILE
# ifndef __USE_FILE_OFFSET64
extern int __openat_2 (int __fd, __const char *__path, int __oflag)
__nonnull ((2));
# else
extern int __REDIRECT (__openat_2, (int __fd, __const char *__file,
int __oflag), __openat64_2)
__nonnull ((2));
# endif
# define openat(fd, fname, flags, ...) \
({ int ___r; \
/* If the compiler complains about an invalid type, excess elements, etc \
in the initialization this means a parameter of the wrong type has \
been passed to openat. */ \
int ___arr[] = { __VA_ARGS__ }; \
if (__builtin_constant_p (flags) && ((flags) & O_CREAT) != 0) \
{ \
/* If the compiler complains about the size of this array type the \
mode parameter is missing since O_CREAT has been used. */ \
typedef int __open_missing_mode[((flags) & O_CREAT) != 0 \
? ((long int) sizeof (___arr) \
- (long int) sizeof (int)) : 1]; \
} \
if (sizeof (___arr) == 0) \
{ \
if (__builtin_constant_p (flags) && ((flags) & O_CREAT) == 0) \
___r = openat (fd, fname, flags); \
else \
___r = __openat_2 (fd, fname, flags); \
} \
else \
{ \
/* If the compiler complains about the size of this array type too \
many parameters have been passed to openat. */ \
typedef int __open_too_many_args[-(sizeof (___arr) > sizeof (int))]; \
___r = openat (fd, fname, flags, ___arr[0]); \
} \
___r; \
})
# ifdef __USE_LARGEFILE64
extern int __openat64_2 (int __fd, __const char *__path, int __oflag)
__nonnull ((2));
# define openat64(fd, fname, flags, ...) \
({ int ___r; \
/* If the compiler complains about an invalid type, excess elements, etc \
in the initialization this means a parameter of the wrong type has \
been passed to openat64. */ \
int ___arr[] = { __VA_ARGS__ }; \
if (__builtin_constant_p (flags) && ((flags) & O_CREAT) != 0) \
{ \
/* If the compiler complains about the size of this array type the \
mode parameter is missing since O_CREAT has been used. */ \
typedef int __open_missing_mode[((flags) & O_CREAT) != 0 \
? ((long int) sizeof (___arr) \
- (long int) sizeof (int)) : 1]; \
} \
if (sizeof (___arr) == 0) \
{ \
if (__builtin_constant_p (flags) && ((flags) & O_CREAT) == 0) \
___r = openat64 (fd, fname, flags); \
else \
___r = __openat64_2 (fd, fname, flags); \
} \
else \
{ \
/* If the compiler complains about the size of this array type too \
many parameters have been passed to openat64. */ \
typedef int __open_too_many_args[-(sizeof (___arr) > sizeof (int))]; \
___r = openat64 (fd, fname, flags, ___arr[0]); \
} \
___r; \
})
# endif
#endif
+1 -7
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991,1992,1994-2001,2003,2004,2005,2006,2007
/* Copyright (C) 1991,1992,1994-2001,2003,2004,2005,2006
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -210,12 +210,6 @@ extern int posix_fallocate64 (int __fd, __off64_t __offset, __off64_t __len);
# endif
#endif
/* Define some macros helping to catch common problems. */
#if __USE_FORTIFY_LEVEL > 0 && !defined __cplusplus
# include <bits/fcntl2.h>
#endif
__END_DECLS
#endif /* fcntl.h */
+1 -18
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991,1995,1996,1997,2002,2007 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1995, 1996, 1997, 2002 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
@@ -20,9 +20,6 @@
#include <fcntl.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
extern char **__libc_argv attribute_hidden;
/* Open FILE with access OFLAG. If OFLAG includes O_CREAT,
a third argument is the file protection. */
@@ -54,18 +51,4 @@ libc_hidden_def (__open)
stub_warning (open)
weak_alias (__open, open)
int
__open_2 (file, oflag)
const char *file;
int oflag;
{
if (oflag & O_CREAT)
__fortify_fail ("invalid open call: O_CREAT without mode");
return __open (file, oflag);
}
stub_warning (__open_2)
#include <stub-tag.h>
+3 -17
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1995, 1996, 1997, 1999, 2000, 2002, 2007
/* Copyright (C) 1991, 1995, 1996, 1997, 1999, 2000, 2002
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -21,7 +21,7 @@
#include <fcntl.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <bp-sym.h>
/* Open FILE with access OFLAG. If OFLAG includes O_CREAT,
a third argument is the file protection. */
@@ -51,21 +51,7 @@ __libc_open64 (file, oflag)
}
strong_alias (__libc_open64, __open64)
libc_hidden_def (__open64)
weak_alias (__libc_open64, open64)
weak_alias (__libc_open64, BP_SYM (open64))
stub_warning (open64)
int
__open64_2 (file, oflag)
const char *file;
int oflag;
{
if (oflag & O_CREAT)
__fortify_fail ("invalid open64 call: O_CREAT without mode");
return __open64 (file, oflag);
}
stub_warning (__open64_2)
#include <stub-tag.h>
+1 -16
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2005, 2006 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
@@ -20,7 +20,6 @@
#include <fcntl.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <sys/stat.h>
/* Open FILE with access OFLAG. Interpret relative paths relative to
@@ -69,18 +68,4 @@ libc_hidden_def (__openat)
weak_alias (__openat, openat)
stub_warning (openat)
int
__openat_2 (fd, file, oflag)
int fd;
const char *file;
int oflag;
{
if (oflag & O_CREAT)
__fortify_fail ("invalid openat call: O_CREAT without mode");
return __openat (file, oflag);
}
stub_warning (__openat_2)
#include <stub-tag.h>
+1 -16
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2005, 2006 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
@@ -20,7 +20,6 @@
#include <fcntl.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <sys/stat.h>
/* Open FILE with access OFLAG. Interpret relative paths relative to
@@ -69,18 +68,4 @@ libc_hidden_def (__openat64)
weak_alias (__openat64, openat64)
stub_warning (openat64)
int
__openat64_2 (fd, file, oflag)
int fd;
const char *file;
int oflag;
{
if (oflag & O_CREAT)
__fortify_fail ("invalid openat64 call: O_CREAT without mode");
return __openat64 (file, oflag);
}
stub_warning (__openat_2)
#include <stub-tag.h>
+2 -2
View File
@@ -32,10 +32,10 @@ __nis_domain_of (const_nis_name name)
{
const_nis_name cptr = strchr (name, '.');
if (cptr == NULL)
if (cptr++ == NULL)
return "";
if (*++cptr == '\0')
if (*cptr == '\0')
return ".";
return cptr;
+23 -315
View File
@@ -1,186 +1,19 @@
2007-07-06 Kaz Kojima <kkojima@rr.iij4u.or.jp>
2007-07-27 Jakub Jelinek <jakub@redhat.com>
* sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
kernel-features.h.
* sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
of the structure for sparc32.
2007-05-16 Roland McGrath <roland@redhat.com>
2007-07-26 Aurelien Jarno <aurelien@aurel32.net>
* init.c (__nptl_initial_report_events): New variable.
(__pthread_initialize_minimal_internal): Initialize pd->report_events
to that.
* sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
2007-06-22 Jakub Jelinek <jakub@redhat.com>
* pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
cpusetsize if pthread_getaffinity_np failed with ENOSYS.
2007-06-19 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
implementation.
2007-06-18 Ulrich Drepper <drepper@redhat.com>
* pthreadP.h: Define PTHREAD_MUTEX_TYPE.
* phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
* pthread_mutex_timedlock.c: Likewise.
* pthread_mutex_trylock.c: Likewise.
* pthread_mutex_unlock.c: Likewise.
2007-06-17 Andreas Schwab <schwab@suse.de>
* sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
sections.
2007-06-17 Ulrich Drepper <drepper@redhat.com>
* allocatestack.c (allocate_stack): Make code compile if
__ASSUME_PRIVATE_FUTEX is set.
2007-06-17 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
(__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
(__pthread_rwlock_wrlock): Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
(pthread_rwlock_timedrdlock): Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
(pthread_rwlock_timedwrlock): Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
(__pthread_rwlock_unlock): Likewise.
2007-06-10 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
* sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
Split __flags into __flags, __shared, __pad1 and __pad2.
* sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
futexes if they are available.
* sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
in libc-lowlevellock.S allow using private futexes.
* sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
FUTEX_PRIVATE_FLAG. Add additional parameter to lll_futex_wait,
lll_futex_timed_wait and lll_futex_wake. Change lll_futex_wait
to call lll_futex_timed_wait. Add lll_private_futex_wait,
lll_private_futex_timed_wait and lll_private_futex_wake.
(lll_robust_mutex_unlock): Fix typo.
* sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
field in futex command setup.
* sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
* sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
if they are available. Remove clear_once_control.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
futexes if they are available.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
Wake only when there are waiters.
* sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
support. Indicate that there are waiters. Remove unnecessary
extra cancellation test.
* sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise. Removed
left-over duplication of __sem_wait_cleanup.
2007-06-07 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
parameter to lll_futex_wait, lll_futex_timed_wait, and
lll_futex_wake. Change lll_futex_wait to call lll_futex_timed_wait.
Add lll_private_futex_wait, lll_private_futex_timed_wait, and
lll_private_futex_wake.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
* allocatestack.c: Adjust use of lll_futex_* macros.
* init.c: Likewise.
* lowlevellock.h: Likewise.
* pthread_barrier_wait.c: Likewise.
* pthread_cond_broadcast.c: Likewise.
* pthread_cond_destroy.c: Likewise.
* pthread_cond_signal.c: Likewise.
* pthread_cond_timedwait.c: Likewise.
* pthread_cond_wait.c: Likewise.
* pthread_create.c: Likewise.
* pthread_mutex_lock.c: Likewise.
* pthread_mutex_setprioceiling.c: Likewise.
* pthread_mutex_timedlock.c: Likewise.
* pthread_mutex_unlock.c: Likewise.
* pthread_rwlock_timedrdlock.c: Likewise.
* pthread_rwlock_timedwrlock.c: Likewise.
* pthread_rwlock_unlock.c: Likewise.
* sysdeps/alpha/tls.h: Likewise.
* sysdeps/i386/tls.h: Likewise.
* sysdeps/ia64/tls.h: Likewise.
* sysdeps/powerpc/tls.h: Likewise.
* sysdeps/pthread/aio_misc.h: Likewise.
* sysdeps/pthread/gai_misc.h: Likewise.
* sysdeps/s390/tls.h: Likewise.
* sysdeps/sh/tls.h: Likewise.
* sysdeps/sparc/tls.h: Likewise.
* sysdeps/unix/sysv/linux/fork.c: Likewise.
* sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
* sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
* sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
* sysdeps/unix/sysv/linux/sem_post.c: Likewise.
* sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
* sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
* sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
* sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
* sysdeps/x86_64/tls.h: Likewise.
2007-05-29 Ulrich Drepper <drepper@redhat.com>
* pthread_getattr_np.c: No need to install a cancellation handler,
this is no cancellation point.
* pthread_getschedparam.c: Likewise.
* pthread_setschedparam.c: Likewise.
* pthread_setschedprio.c: Likewise.
* sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
lll_unlock_wake_cb.
* sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
whether there are more than one thread makes no sense here since
we only call the slow path if the locks are taken.
* sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/internaltypes.h: Introduce
COND_NWAITERS_SHIFT.
* pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
COND_CLOCK_BITS.
* pthread_cond_init.c: Likewise.
* pthread_cond_timedwait.c: Likewise.
* pthread_cond_wait.c: Likewise.
* pthread_condattr_getclock.c: Likewise.
* pthread_condattr_setclock.c: Likewise.
* sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2007-05-28 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
unistd.h.
* sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
insn suffix.
(THREAD_GSCOPE_GET_FLAG): Remove.
@@ -218,127 +51,15 @@
THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
THREAD_GSCOPE_WAIT): Define.
2007-05-27 Ulrich Drepper <drepper@redhat.com>
* init.c: Make it compile with older kernel headers.
* tst-initializers1.c: Show through exit code which test failed.
* pthread_rwlock_init.c: Also initialize __shared field.
* sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
element in rwlock structure into four byte elements. One of them is
the new __shared element.
* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
Likewise.
[__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
__shared, adjust names of other padding elements.
* sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
* sysdeps/pthread/pthread.h: Adjust rwlock initializers.
* sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
FUTEX_PRIVATE_FLAG.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
futex to use private operations if possible.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2007-05-26 Ulrich Drepper <drepper@redhat.com>
* pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
* pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
* pthread_rwlock_timedrdlock.c: Likewise.
* pthread_rwlock_tryrdlock.c: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
optimization.
* sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
* sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
duplication of __sem_wait_cleanup.
* allocatestack.c: Revert last change.
* init.c: Likewise.
* sysdeps/i386/tls.h: Likewise.
* sysdeps/x86_64/tls.h: Likewise.
* descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
header structure.
* sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
* sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
Add private field.
* sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
* pthread_barrier_init.c: Set private flag if pshared and private
futexes are supported.
* sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
private field in futex command setup.
* sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
2007-05-25 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
support.
* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
* semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
* sem_init.c (__new_sem_init): Rewrite to initialize all three
fields in the structure.
(__old_sem_init): New function.
* sem_open.c: Initialize all fields of the structure.
* sem_getvalue.c: Adjust for renamed element.
* sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
(gen-as-const-headers): Add structsem.sym.
* sysdeps/unix/sysv/linux/structsem.sym: New file.
* sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
struct new_sem. Add struct old_sem.
* sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
* sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
* sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
* sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
* sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
* Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
* tst-sem10.c: New file.
* tst-sem11.c: New file.
* tst-sem12.c: New file.
* tst-typesizes.c: Test struct new_sem and struct old_sem instead
of struct sem.
2007-05-25 Ulrich Drepper <drepper@redhat.com>
Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
Move __pthread_enable_asynccancel right before futex syscall.
* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
Likewise.
2007-05-24 Jakub Jelinek <jakub@redhat.com>
* sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
THREAD_COPY_PRIVATE_FUTEX): Define.
* sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
THREAD_COPY_PRIVATE_FUTEX): Define.
* allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
* init.c (__pthread_initialize_minimal_internal): Use
THREAD_SET_PRIVATE_FUTEX.
* sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
(THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
THREAD_GSCOPE_FLAG_WAIT): Define.
@@ -351,29 +72,6 @@
* allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
instead of ->header.gscope_flag directly.
2007-05-23 Ulrich Drepper <drepper@redhat.com>
* init.c (__pthread_initialize_minimal_internal): Check whether
private futexes are available.
* allocatestack.c (allocate_stack): Copy private_futex field from
current thread into the new stack.
* sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
futexes if they are available.
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
in libc-lowlevellock.S allow using private futexes.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
FUTEX_PRIVATE_FLAG.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
if they are available.
* sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
* sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
* sysdeps/i386/tcb-offsets.sym: Likewise.
* sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
* sysdeps/i386/tls.h (tcbhead_t): Likewise.
2007-05-21 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/pthread-functions.h (struct pthread_functions):
@@ -386,11 +84,6 @@
* sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
encrypted for now.
2007-05-21 Jakub Jelinek <jakub@redhat.com>
* tst-robust9.c (do_test): Don't fail if ENABLE_PI and
pthread_mutex_init failed with ENOTSUP.
2007-05-19 Ulrich Drepper <drepper@redhat.com>
* allocatestack.c (__wait_lookup_done): New function.
@@ -404,6 +97,24 @@
* sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
Initialize GL(dl_wait_lookup_done).
2007-05-25 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-sem10.
* tst-sem10.c: New file.
2007-05-25 Ulrich Drepper <drepper@redhat.com>
Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
Move __pthread_enable_asynccancel right before futex syscall.
* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
Likewise.
2007-05-21 Jakub Jelinek <jakub@redhat.com>
* tst-robust9.c (do_test): Don't fail if ENABLE_PI and
pthread_mutex_init failed with ENOTSUP.
2007-05-17 Ulrich Drepper <drepper@redhat.com>
[BZ #4512]
@@ -417,9 +128,6 @@
* tst-robust9.c: New file.
* tst-robustpi9.c: New file.
* sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
unnecessary extra cancellation test.
2007-05-14 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
+1 -1
View File
@@ -218,7 +218,7 @@ tests = tst-typesizes \
tst-once1 tst-once2 tst-once3 tst-once4 \
tst-key1 tst-key2 tst-key3 tst-key4 \
tst-sem1 tst-sem2 tst-sem3 tst-sem4 tst-sem5 tst-sem6 tst-sem7 \
tst-sem8 tst-sem9 tst-sem10 tst-sem11 tst-sem12 \
tst-sem8 tst-sem9 tst-sem10 \
tst-barrier1 tst-barrier2 tst-barrier3 tst-barrier4 \
tst-align tst-align2 tst-align3 \
tst-basic1 tst-basic2 tst-basic3 tst-basic4 tst-basic5 tst-basic6 \
+3 -15
View File
@@ -376,12 +376,6 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
__pthread_multiple_threads = *__libc_multiple_threads_ptr = 1;
#endif
#ifndef __ASSUME_PRIVATE_FUTEX
/* The thread must know when private futexes are supported. */
pd->header.private_futex = THREAD_GETMEM (THREAD_SELF,
header.private_futex);
#endif
#ifdef NEED_DL_SYSINFO
/* Copy the sysinfo value from the parent. */
THREAD_SYSINFO(pd) = THREAD_SELF_SYSINFO;
@@ -516,12 +510,6 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
__pthread_multiple_threads = *__libc_multiple_threads_ptr = 1;
#endif
#ifndef __ASSUME_PRIVATE_FUTEX
/* The thread must know when private futexes are supported. */
pd->header.private_futex = THREAD_GETMEM (THREAD_SELF,
header.private_futex);
#endif
#ifdef NEED_DL_SYSINFO
/* Copy the sysinfo value from the parent. */
THREAD_SYSINFO(pd) = THREAD_SELF_SYSINFO;
@@ -951,7 +939,7 @@ __nptl_setxid (struct xid_command *cmdp)
int cur = cmdp->cntr;
while (cur != 0)
{
lll_private_futex_wait (&cmdp->cntr, cur);
lll_futex_wait (&cmdp->cntr, cur);
cur = cmdp->cntr;
}
@@ -1037,7 +1025,7 @@ __wait_lookup_done (void)
continue;
do
lll_private_futex_wait (gscope_flagp, THREAD_GSCOPE_FLAG_WAIT);
lll_futex_wait (gscope_flagp, THREAD_GSCOPE_FLAG_WAIT);
while (*gscope_flagp == THREAD_GSCOPE_FLAG_WAIT);
}
@@ -1059,7 +1047,7 @@ __wait_lookup_done (void)
continue;
do
lll_private_futex_wait (gscope_flagp, THREAD_GSCOPE_FLAG_WAIT);
lll_futex_wait (gscope_flagp, THREAD_GSCOPE_FLAG_WAIT);
while (*gscope_flagp == THREAD_GSCOPE_FLAG_WAIT);
}
-4
View File
@@ -37,7 +37,6 @@
#endif
#define __need_res_state
#include <resolv.h>
#include <kernel-features.h>
#ifndef TCB_ALIGNMENT
# define TCB_ALIGNMENT sizeof (double)
@@ -133,9 +132,6 @@ struct pthread
{
int multiple_threads;
int gscope_flag;
# ifndef __ASSUME_PRIVATE_FUTEX
int private_futex;
# endif
} header;
#endif
+23 -20
View File
@@ -35,6 +35,27 @@
#include <lowlevellock.h>
#ifndef __NR_set_tid_address
/* XXX For the time being... Once we can rely on the kernel headers
having the definition remove these lines. */
#if defined __s390__
# define __NR_set_tid_address 252
#elif defined __ia64__
# define __NR_set_tid_address 1233
#elif defined __i386__
# define __NR_set_tid_address 258
#elif defined __x86_64__
# define __NR_set_tid_address 218
#elif defined __powerpc__
# define __NR_set_tid_address 232
#elif defined __sparc__
# define __NR_set_tid_address 166
#else
# error "define __NR_set_tid_address"
#endif
#endif
/* Size and alignment of static TLS block. */
size_t __static_tls_size;
size_t __static_tls_align_m1;
@@ -216,7 +237,7 @@ sighandler_setxid (int sig, siginfo_t *si, void *ctx)
__xidcmd->id[1], __xidcmd->id[2]);
if (atomic_decrement_val (&__xidcmd->cntr) == 0)
lll_private_futex_wake (&__xidcmd->cntr, 1);
lll_futex_wake (&__xidcmd->cntr, 1);
/* Reset the SETXID flag. */
struct pthread *self = THREAD_SELF;
@@ -225,7 +246,7 @@ sighandler_setxid (int sig, siginfo_t *si, void *ctx)
/* And release the futex. */
self->setxid_futex = 1;
lll_private_futex_wake (&self->setxid_futex, 1);
lll_futex_wake (&self->setxid_futex, 1);
}
@@ -234,9 +255,6 @@ sighandler_setxid (int sig, siginfo_t *si, void *ctx)
extern void **__libc_dl_error_tsd (void) __attribute__ ((const));
/* This can be set by the debugger before initialization is complete. */
static bool __nptl_initial_report_events;
void
__pthread_initialize_minimal_internal (void)
{
@@ -279,18 +297,6 @@ __pthread_initialize_minimal_internal (void)
#endif
set_robust_list_not_avail ();
#ifndef __ASSUME_PRIVATE_FUTEX
/* Private futexes are always used (at least internally) so that
doing the test once this early is beneficial. */
{
int word;
word = INTERNAL_SYSCALL (futex, err, 3, &word,
FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1);
if (!INTERNAL_SYSCALL_ERROR_P (word, err))
THREAD_SETMEM (pd, header.private_futex, FUTEX_PRIVATE_FLAG);
}
#endif
/* Set initial thread's stack block from 0 up to __libc_stack_end.
It will be bigger than it actually is, but for unwind.c/pt-longjmp.c
purposes this is good enough. */
@@ -300,9 +306,6 @@ __pthread_initialize_minimal_internal (void)
INIT_LIST_HEAD (&__stack_user);
list_add (&pd->list, &__stack_user);
/* Before initializing __stack_user, the debugger could not find us and
had to set __nptl_initial_report_events. Propagate its setting. */
THREAD_SETMEM (pd, report_events, __nptl_initial_report_events);
/* Install the cancellation signal handler. If for some reason we
cannot install the handler we do not abort. Maybe we should, but
+13 -7
View File
@@ -1,5 +1,5 @@
/* Low level locking macros used in NPTL implementation. Stub version.
Copyright (C) 2002, 2007 Free Software Foundation, Inc.
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -21,6 +21,16 @@
#include <atomic.h>
/* Implement generic mutex. Basic futex syscall support is required:
lll_futex_wait(futex, value) - call sys_futex with FUTEX_WAIT
and third parameter VALUE
lll_futex_wake(futex, value) - call sys_futex with FUTEX_WAKE
and third parameter VALUE
*/
/* Mutex lock counter:
bit 31 clear means unlocked;
bit 31 set means locked.
@@ -56,9 +66,7 @@ __generic_mutex_lock (int *mutex)
if (v >= 0)
continue;
lll_futex_wait (mutex, v,
// XYZ check mutex flag
LLL_SHARED);
lll_futex_wait (mutex, v);
}
}
@@ -74,9 +82,7 @@ __generic_mutex_unlock (int *mutex)
/* There are other threads waiting for this mutex, wake one of them
up. */
lll_futex_wake (mutex, 1,
// XYZ check mutex flag
LLL_SHARED);
lll_futex_wake (mutex, 1);
}
-8
View File
@@ -97,9 +97,6 @@ enum
= PTHREAD_MUTEX_PRIO_PROTECT_NP | PTHREAD_MUTEX_ADAPTIVE_NP
};
#define PTHREAD_MUTEX_TYPE(m) \
((m)->__data.__kind)
/* Ceiling in __data.__lock. __data.__lock is signed, so don't
use the MSB bit in there, but in the mask also include that bit,
so that the compiler can optimize & PTHREAD_MUTEX_PRIO_CEILING_MASK
@@ -121,11 +118,6 @@ enum
| PTHREAD_MUTEXATTR_PROTOCOL_MASK | PTHREAD_MUTEXATTR_PRIO_CEILING_MASK)
/* Check whether rwlock prefers readers. */
#define PTHREAD_RWLOCK_PREFER_READER_P(rwlock) \
((rwlock)->__data.__flags == 0)
/* Bits used in robust mutex implementation. */
#define FUTEX_WAITERS 0x80000000
#define FUTEX_OWNER_DIED 0x40000000
+11 -25
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -20,13 +20,6 @@
#include <errno.h>
#include "pthreadP.h"
#include <lowlevellock.h>
#include <kernel-features.h>
static const struct pthread_barrierattr default_attr =
{
.pshared = PTHREAD_PROCESS_PRIVATE
};
int
@@ -40,15 +33,17 @@ pthread_barrier_init (barrier, attr, count)
if (__builtin_expect (count == 0, 0))
return EINVAL;
struct pthread_barrierattr *iattr
= (attr != NULL
? iattr = (struct pthread_barrierattr *) attr
: &default_attr);
if (attr != NULL)
{
struct pthread_barrierattr *iattr;
if (iattr->pshared != PTHREAD_PROCESS_PRIVATE
&& __builtin_expect (iattr->pshared != PTHREAD_PROCESS_SHARED, 0))
/* Invalid attribute. */
return EINVAL;
iattr = (struct pthread_barrierattr *) attr;
if (iattr->pshared != PTHREAD_PROCESS_PRIVATE
&& __builtin_expect (iattr->pshared != PTHREAD_PROCESS_SHARED, 0))
/* Invalid attribute. */
return EINVAL;
}
ibarrier = (struct pthread_barrier *) barrier;
@@ -58,14 +53,5 @@ pthread_barrier_init (barrier, attr, count)
ibarrier->init_count = count;
ibarrier->curr_event = 0;
#ifdef __ASSUME_PRIVATE_FUTEX
ibarrier->private = (iattr->pshared != PTHREAD_PROCESS_PRIVATE
? 0 : FUTEX_PRIVATE_FLAG);
#else
ibarrier->private = (iattr->pshared != PTHREAD_PROCESS_PRIVATE
? 0 : THREAD_GETMEM (THREAD_SELF,
header.private_futex));
#endif
return 0;
}
+3 -7
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -45,9 +45,7 @@ pthread_barrier_wait (barrier)
++ibarrier->curr_event;
/* Wake up everybody. */
lll_futex_wake (&ibarrier->curr_event, INT_MAX,
// XYZ check mutex flag
LLL_SHARED);
lll_futex_wake (&ibarrier->curr_event, INT_MAX);
/* This is the thread which finished the serialization. */
result = PTHREAD_BARRIER_SERIAL_THREAD;
@@ -63,9 +61,7 @@ pthread_barrier_wait (barrier)
/* Wait for the event counter of the barrier to change. */
do
lll_futex_wait (&ibarrier->curr_event, event,
// XYZ check mutex flag
LLL_SHARED);
lll_futex_wait (&ibarrier->curr_event, event);
while (event == ibarrier->curr_event);
}
+2 -4
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -69,9 +69,7 @@ __pthread_cond_broadcast (cond)
{
/* The requeue functionality is not available. */
wake_all:
lll_futex_wake (&cond->__data.__futex, INT_MAX,
// XYZ check mutex flag
LLL_SHARED);
lll_futex_wake (&cond->__data.__futex, INT_MAX);
}
/* That's all. */
+5 -9
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -45,7 +45,7 @@ __pthread_cond_destroy (cond)
pthread_cond_destroy needs to wait for them. */
unsigned int nwaiters = cond->__data.__nwaiters;
if (nwaiters >= (1 << COND_NWAITERS_SHIFT))
if (nwaiters >= (1 << COND_CLOCK_BITS))
{
/* Wake everybody on the associated mutex in case there are
threads that have been requeued to it.
@@ -59,24 +59,20 @@ __pthread_cond_destroy (cond)
&& cond->__data.__mutex != (void *) ~0l)
{
pthread_mutex_t *mut = (pthread_mutex_t *) cond->__data.__mutex;
lll_futex_wake (&mut->__data.__lock, INT_MAX,
// XYZ check mutex flag
LLL_SHARED);
lll_futex_wake (&mut->__data.__lock, INT_MAX);
}
do
{
lll_mutex_unlock (cond->__data.__lock);
lll_futex_wait (&cond->__data.__nwaiters, nwaiters,
// XYZ check mutex flag
LLL_SHARED);
lll_futex_wait (&cond->__data.__nwaiters, nwaiters);
lll_mutex_lock (cond->__data.__lock);
nwaiters = cond->__data.__nwaiters;
}
while (nwaiters >= (1 << COND_NWAITERS_SHIFT));
while (nwaiters >= (1 << COND_CLOCK_BITS));
}
return 0;
+3 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -31,8 +31,8 @@ __pthread_cond_init (cond, cond_attr)
cond->__data.__lock = LLL_MUTEX_LOCK_INITIALIZER;
cond->__data.__futex = 0;
cond->__data.__nwaiters = (icond_attr != NULL
&& ((icond_attr->value
& (COND_NWAITERS_SHIFT << 1)) >> 1));
&& ((icond_attr->value & (COND_CLOCK_BITS << 1))
>> 1));
cond->__data.__total_seq = 0;
cond->__data.__wakeup_seq = 0;
cond->__data.__woken_seq = 0;
+3 -7
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -44,15 +44,11 @@ __pthread_cond_signal (cond)
/* Wake one. */
if (! __builtin_expect (lll_futex_wake_unlock (&cond->__data.__futex, 1,
1, &cond->__data.__lock,
// XYZ check mutex flag
LLL_SHARED),
1, &cond->__data.__lock),
0))
return 0;
lll_futex_wake (&cond->__data.__futex, 1,
// XYZ check mutex flag
LLL_SHARED);
lll_futex_wake (&cond->__data.__futex, 1);
}
/* We are done. */
+7 -11
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -67,7 +67,7 @@ __pthread_cond_timedwait (cond, mutex, abstime)
/* We have one new user of the condvar. */
++cond->__data.__total_seq;
++cond->__data.__futex;
cond->__data.__nwaiters += 1 << COND_NWAITERS_SHIFT;
cond->__data.__nwaiters += 1 << COND_CLOCK_BITS;
/* Remember the mutex we are using here. If there is already a
different address store this is a bad user bug. Do not store
@@ -100,7 +100,7 @@ __pthread_cond_timedwait (cond, mutex, abstime)
int ret;
ret = INTERNAL_SYSCALL (clock_gettime, err, 2,
(cond->__data.__nwaiters
& ((1 << COND_NWAITERS_SHIFT) - 1)),
& ((1 << COND_CLOCK_BITS) - 1)),
&rt);
# ifndef __ASSUME_POSIX_TIMERS
if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (ret, err), 0))
@@ -153,9 +153,7 @@ __pthread_cond_timedwait (cond, mutex, abstime)
/* Wait until woken by signal or broadcast. */
err = lll_futex_timed_wait (&cond->__data.__futex,
futex_val, &rt,
// XYZ check mutex flag
LLL_SHARED);
futex_val, &rt);
/* Disable asynchronous cancellation. */
__pthread_disable_asynccancel (cbuffer.oldtype);
@@ -191,16 +189,14 @@ __pthread_cond_timedwait (cond, mutex, abstime)
bc_out:
cond->__data.__nwaiters -= 1 << COND_NWAITERS_SHIFT;
cond->__data.__nwaiters -= 1 << COND_CLOCK_BITS;
/* If pthread_cond_destroy was called on this variable already,
notify the pthread_cond_destroy caller all waiters have left
and it can be successfully destroyed. */
if (cond->__data.__total_seq == -1ULL
&& cond->__data.__nwaiters < (1 << COND_NWAITERS_SHIFT))
lll_futex_wake (&cond->__data.__nwaiters, 1,
// XYZ check mutex flag
LLL_SHARED);
&& cond->__data.__nwaiters < (1 << COND_CLOCK_BITS))
lll_futex_wake (&cond->__data.__nwaiters, 1);
/* We are done with the condvar. */
lll_mutex_unlock (cond->__data.__lock);
+10 -18
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -62,18 +62,16 @@ __condvar_cleanup (void *arg)
++cbuffer->cond->__data.__woken_seq;
}
cbuffer->cond->__data.__nwaiters -= 1 << COND_NWAITERS_SHIFT;
cbuffer->cond->__data.__nwaiters -= 1 << COND_CLOCK_BITS;
/* If pthread_cond_destroy was called on this variable already,
notify the pthread_cond_destroy caller all waiters have left
and it can be successfully destroyed. */
destroying = 0;
if (cbuffer->cond->__data.__total_seq == -1ULL
&& cbuffer->cond->__data.__nwaiters < (1 << COND_NWAITERS_SHIFT))
&& cbuffer->cond->__data.__nwaiters < (1 << COND_CLOCK_BITS))
{
lll_futex_wake (&cbuffer->cond->__data.__nwaiters, 1,
// XYZ check mutex flag
LLL_SHARED);
lll_futex_wake (&cbuffer->cond->__data.__nwaiters, 1);
destroying = 1;
}
@@ -82,9 +80,7 @@ __condvar_cleanup (void *arg)
/* Wake everybody to make sure no condvar signal gets lost. */
if (! destroying)
lll_futex_wake (&cbuffer->cond->__data.__futex, INT_MAX,
// XYZ check mutex flag
LLL_SHARED);
lll_futex_wake (&cbuffer->cond->__data.__futex, INT_MAX);
/* Get the mutex before returning unless asynchronous cancellation
is in effect. */
@@ -115,7 +111,7 @@ __pthread_cond_wait (cond, mutex)
/* We have one new user of the condvar. */
++cond->__data.__total_seq;
++cond->__data.__futex;
cond->__data.__nwaiters += 1 << COND_NWAITERS_SHIFT;
cond->__data.__nwaiters += 1 << COND_CLOCK_BITS;
/* Remember the mutex we are using here. If there is already a
different address store this is a bad user bug. Do not store
@@ -150,9 +146,7 @@ __pthread_cond_wait (cond, mutex)
cbuffer.oldtype = __pthread_enable_asynccancel ();
/* Wait until woken by signal or broadcast. */
lll_futex_wait (&cond->__data.__futex, futex_val,
// XYZ check mutex flag
LLL_SHARED);
lll_futex_wait (&cond->__data.__futex, futex_val);
/* Disable asynchronous cancellation. */
__pthread_disable_asynccancel (cbuffer.oldtype);
@@ -174,16 +168,14 @@ __pthread_cond_wait (cond, mutex)
bc_out:
cond->__data.__nwaiters -= 1 << COND_NWAITERS_SHIFT;
cond->__data.__nwaiters -= 1 << COND_CLOCK_BITS;
/* If pthread_cond_destroy was called on this varaible already,
notify the pthread_cond_destroy caller all waiters have left
and it can be successfully destroyed. */
if (cond->__data.__total_seq == -1ULL
&& cond->__data.__nwaiters < (1 << COND_NWAITERS_SHIFT))
lll_futex_wake (&cond->__data.__nwaiters, 1,
// XYZ check mutex flag
LLL_SHARED);
&& cond->__data.__nwaiters < (1 << COND_CLOCK_BITS))
lll_futex_wake (&cond->__data.__nwaiters, 1);
/* We are done with the condvar. */
lll_mutex_unlock (cond->__data.__lock);
+2 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -26,6 +26,6 @@ pthread_condattr_getclock (attr, clock_id)
clockid_t *clock_id;
{
*clock_id = (((((const struct pthread_condattr *) attr)->value) >> 1)
& ((1 << COND_NWAITERS_SHIFT) - 1));
& ((1 << COND_CLOCK_BITS) - 1));
return 0;
}
+3 -4
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -62,12 +62,11 @@ pthread_condattr_setclock (attr, clock_id)
return EINVAL;
/* Make sure the value fits in the bits we reserved. */
assert (clock_id < (1 << COND_NWAITERS_SHIFT));
assert (clock_id < (1 << COND_CLOCK_BITS));
int *valuep = &((struct pthread_condattr *) attr)->value;
*valuep = ((*valuep & ~(1 << (COND_NWAITERS_SHIFT + 1)) & ~1)
| (clock_id << 1));
*valuep = (*valuep & ~(1 << (COND_CLOCK_BITS + 1)) & ~1) | (clock_id << 1);
return 0;
}
+2 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -385,7 +385,7 @@ start_thread (void *arg)
/* Some other thread might call any of the setXid functions and expect
us to reply. In this case wait until we did that. */
do
lll_private_futex_wait (&pd->setxid_futex, 0);
lll_futex_wait (&pd->setxid_futex, 0);
while (pd->cancelhandling & SETXID_BITMASK);
/* Reset the value so that the stack can be reused. */
+6
View File
@@ -39,6 +39,10 @@ pthread_getattr_np (thread_id, attr)
struct pthread_attr *iattr = (struct pthread_attr *) attr;
int ret = 0;
/* We have to handle cancellation in the following code since we are
locking another threads desriptor. */
pthread_cleanup_push ((void (*) (void *)) lll_unlock_wake_cb, &thread->lock);
lll_lock (thread->lock);
/* The thread library is responsible for keeping the values in the
@@ -175,5 +179,7 @@ pthread_getattr_np (thread_id, attr)
lll_unlock (thread->lock);
pthread_cleanup_pop (0);
return ret;
}
+7 -1
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -38,6 +38,10 @@ __pthread_getschedparam (threadid, policy, param)
int result = 0;
/* We have to handle cancellation in the following code since we are
locking another threads descriptor. */
pthread_cleanup_push ((void (*) (void *)) lll_unlock_wake_cb, &pd->lock);
lll_lock (pd->lock);
/* The library is responsible for maintaining the values at all
@@ -70,6 +74,8 @@ __pthread_getschedparam (threadid, policy, param)
lll_unlock (pd->lock);
pthread_cleanup_pop (0);
return result;
}
strong_alias (__pthread_getschedparam, pthread_getschedparam)
+2 -5
View File
@@ -43,8 +43,7 @@ __pthread_mutex_lock (mutex)
pid_t id = THREAD_GETMEM (THREAD_SELF, tid);
int retval = 0;
switch (__builtin_expect (PTHREAD_MUTEX_TYPE (mutex),
PTHREAD_MUTEX_TIMED_NP))
switch (__builtin_expect (mutex->__data.__kind, PTHREAD_MUTEX_TIMED_NP))
{
/* Recursive mutex. */
case PTHREAD_MUTEX_RECURSIVE_NP:
@@ -409,9 +408,7 @@ __pthread_mutex_lock (mutex)
break;
if (oldval != ceilval)
lll_futex_wait (&mutex->__data.__lock, ceilval | 2,
// XYZ check mutex flag
LLL_SHARED);
lll_futex_wait (&mutex->__data.__lock, ceilval | 2);
}
while (atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
ceilval | 2, ceilval)
+3 -7
View File
@@ -1,5 +1,5 @@
/* Set current priority ceiling of pthread_mutex_t.
Copyright (C) 2006, 2007 Free Software Foundation, Inc.
Copyright (C) 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2006.
@@ -80,9 +80,7 @@ pthread_mutex_setprioceiling (mutex, prioceiling, old_ceiling)
break;
if (oldval != ceilval)
lll_futex_wait (&mutex->__data.__lock, ceilval | 2,
// XYZ check mutex flag
LLL_SHARED);
lll_futex_wait (&mutex->__data.__lock, ceilval | 2);
}
while (atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
ceilval | 2, ceilval)
@@ -112,9 +110,7 @@ pthread_mutex_setprioceiling (mutex, prioceiling, old_ceiling)
| (prioceiling << PTHREAD_MUTEX_PRIO_CEILING_SHIFT);
atomic_full_barrier ();
lll_futex_wake (&mutex->__data.__lock, INT_MAX,
// XYZ check mutex flag
LLL_SHARED);
lll_futex_wake (&mutex->__data.__lock, INT_MAX);
return 0;
}
+2 -5
View File
@@ -37,8 +37,7 @@ pthread_mutex_timedlock (mutex, abstime)
/* We must not check ABSTIME here. If the thread does not block
abstime must not be checked for a valid value. */
switch (__builtin_expect (PTHREAD_MUTEX_TYPE (mutex),
PTHREAD_MUTEX_TIMED_NP))
switch (__builtin_expect (mutex->__data.__kind, PTHREAD_MUTEX_TIMED_NP))
{
/* Recursive mutex. */
case PTHREAD_MUTEX_RECURSIVE_NP:
@@ -442,9 +441,7 @@ pthread_mutex_timedlock (mutex, abstime)
}
lll_futex_timed_wait (&mutex->__data.__lock,
ceilval | 2, &rt,
// XYZ check mutex flag
LLL_SHARED);
ceilval | 2, &rt);
}
}
while (atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
+1 -2
View File
@@ -31,8 +31,7 @@ __pthread_mutex_trylock (mutex)
int oldval;
pid_t id = THREAD_GETMEM (THREAD_SELF, tid);
switch (__builtin_expect (PTHREAD_MUTEX_TYPE (mutex),
PTHREAD_MUTEX_TIMED_NP))
switch (__builtin_expect (mutex->__data.__kind, PTHREAD_MUTEX_TIMED_NP))
{
/* Recursive mutex. */
case PTHREAD_MUTEX_RECURSIVE_NP:
+3 -6
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -31,8 +31,7 @@ __pthread_mutex_unlock_usercnt (mutex, decr)
{
int newowner = 0;
switch (__builtin_expect (PTHREAD_MUTEX_TYPE (mutex),
PTHREAD_MUTEX_TIMED_NP))
switch (__builtin_expect (mutex->__data.__kind, PTHREAD_MUTEX_TIMED_NP))
{
case PTHREAD_MUTEX_RECURSIVE_NP:
/* Recursive mutex. */
@@ -241,9 +240,7 @@ __pthread_mutex_unlock_usercnt (mutex, decr)
newval, oldval));
if ((oldval & ~PTHREAD_MUTEX_PRIO_CEILING_MASK) > 1)
lll_futex_wake (&mutex->__data.__lock, 1,
// XYZ check mutex flag
LLL_SHARED);
lll_futex_wake (&mutex->__data.__lock, 1);
int oldprio = newval >> PTHREAD_MUTEX_PRIO_CEILING_SHIFT;
return __pthread_tpp_change_priority (oldprio, -1);
+4 -35
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -18,7 +18,6 @@
02111-1307 USA. */
#include "pthreadP.h"
#include <kernel-features.h>
static const struct pthread_rwlockattr default_attr =
@@ -38,44 +37,14 @@ __pthread_rwlock_init (rwlock, attr)
iattr = ((const struct pthread_rwlockattr *) attr) ?: &default_attr;
rwlock->__data.__lock = 0;
rwlock->__data.__flags
= iattr->lockkind == PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP;
rwlock->__data.__nr_readers = 0;
rwlock->__data.__writer = 0;
rwlock->__data.__readers_wakeup = 0;
rwlock->__data.__writer_wakeup = 0;
rwlock->__data.__nr_readers_queued = 0;
rwlock->__data.__nr_writers_queued = 0;
rwlock->__data.__writer = 0;
rwlock->__data.__flags
= iattr->lockkind == PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP;
/* The __SHARED field is computed to minimize the work that needs to
be done while handling the futex. There are two inputs: the
availability of private futexes and whether the rwlock is shared
or private. Unfortunately the value of a private rwlock is
fixed: it must be zero. The PRIVATE_FUTEX flag has the value
0x80 in case private futexes are available and zero otherwise.
This leads to the following table:
| pshared | result
| shared private | shared private |
------------+-----------------+-----------------+
!avail 0 | 0 0 | 0 0 |
avail 0x80 | 0x80 0 | 0 0x80 |
If the pshared value is in locking functions XORed with avail
we get the expected result. */
#ifdef __ASSUME_PRIVATE_FUTEX
rwlock->__data.__shared = (iattr->pshared == PTHREAD_PROCESS_PRIVATE
? 0 : FUTEX_PRIVATE_FLAG);
#else
rwlock->__data.__shared = (iattr->pshared == PTHREAD_PROCESS_PRIVATE
? 0
: THREAD_GETMEM (THREAD_SELF,
header.private_futex));
#endif
rwlock->__data.__pad1 = 0;
rwlock->__data.__pad2 = 0;
return 0;
}
+2 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -40,7 +40,7 @@ __pthread_rwlock_rdlock (rwlock)
if (rwlock->__data.__writer == 0
/* ...and if either no writer is waiting or we prefer readers. */
&& (!rwlock->__data.__nr_writers_queued
|| PTHREAD_RWLOCK_PREFER_READER_P (rwlock)))
|| rwlock->__data.__flags == 0))
{
/* Increment the reader counter. Avoid overflow. */
if (__builtin_expect (++rwlock->__data.__nr_readers == 0, 0))
+3 -5
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -43,7 +43,7 @@ pthread_rwlock_timedrdlock (rwlock, abstime)
if (rwlock->__data.__writer == 0
/* ...and if either no writer is waiting or we prefer readers. */
&& (!rwlock->__data.__nr_writers_queued
|| PTHREAD_RWLOCK_PREFER_READER_P (rwlock)))
|| rwlock->__data.__flags == 0))
{
/* Increment the reader counter. Avoid overflow. */
if (++rwlock->__data.__nr_readers == 0)
@@ -114,9 +114,7 @@ pthread_rwlock_timedrdlock (rwlock, abstime)
/* Wait for the writer to finish. */
err = lll_futex_timed_wait (&rwlock->__data.__readers_wakeup,
waitval, &rt,
// XYZ check mutex flag
LLL_SHARED);
waitval, &rt);
/* Get the lock. */
lll_mutex_lock (rwlock->__data.__lock);
+2 -4
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -104,9 +104,7 @@ pthread_rwlock_timedwrlock (rwlock, abstime)
/* Wait for the writer or reader(s) to finish. */
err = lll_futex_timed_wait (&rwlock->__data.__writer_wakeup,
waitval, &rt,
// XYZ check mutex flag
LLL_SHARED);
waitval, &rt);
/* Get the lock. */
lll_mutex_lock (rwlock->__data.__lock);
+2 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -32,7 +32,7 @@ __pthread_rwlock_tryrdlock (rwlock)
if (rwlock->__data.__writer == 0
&& (rwlock->__data.__nr_writers_queued == 0
|| PTHREAD_RWLOCK_PREFER_READER_P (rwlock)))
|| rwlock->__data.__flags == 0))
{
if (__builtin_expect (++rwlock->__data.__nr_readers == 0, 0))
{
+3 -7
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2003, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -38,18 +38,14 @@ __pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
{
++rwlock->__data.__writer_wakeup;
lll_mutex_unlock (rwlock->__data.__lock);
lll_futex_wake (&rwlock->__data.__writer_wakeup, 1,
// XYZ check mutex flag
LLL_SHARED);
lll_futex_wake (&rwlock->__data.__writer_wakeup, 1);
return 0;
}
else if (rwlock->__data.__nr_readers_queued)
{
++rwlock->__data.__readers_wakeup;
lll_mutex_unlock (rwlock->__data.__lock);
lll_futex_wake (&rwlock->__data.__readers_wakeup, INT_MAX,
// XYZ check mutex flag
LLL_SHARED);
lll_futex_wake (&rwlock->__data.__readers_wakeup, INT_MAX);
return 0;
}
}
+7 -1
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -39,6 +39,10 @@ __pthread_setschedparam (threadid, policy, param)
int result = 0;
/* We have to handle cancellation in the following code since we are
locking another threads desriptor. */
pthread_cleanup_push ((void (*) (void *)) lll_unlock_wake_cb, &pd->lock);
lll_lock (pd->lock);
struct sched_param p;
@@ -69,6 +73,8 @@ __pthread_setschedparam (threadid, policy, param)
lll_unlock (pd->lock);
pthread_cleanup_pop (0);
return result;
}
strong_alias (__pthread_setschedparam, pthread_setschedparam)
+7 -1
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -41,6 +41,10 @@ pthread_setschedprio (threadid, prio)
struct sched_param param;
param.sched_priority = prio;
/* We have to handle cancellation in the following code since we are
locking another threads desriptor. */
pthread_cleanup_push ((void (*) (void *)) lll_unlock_wake_cb, &pd->lock);
lll_lock (pd->lock);
/* If the thread should have higher priority because of some
@@ -62,5 +66,7 @@ pthread_setschedprio (threadid, prio)
lll_unlock (pd->lock);
pthread_cleanup_pop (0);
return result;
}
+3 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -27,11 +27,11 @@ __new_sem_getvalue (sem, sval)
sem_t *sem;
int *sval;
{
struct new_sem *isem = (struct new_sem *) sem;
struct sem *isem = (struct sem *) sem;
/* XXX Check for valid SEM parameter. */
*sval = isem->value;
*sval = isem->count;
return 0;
}
+7 -40
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -22,7 +22,6 @@
#include <lowlevellock.h>
#include <shlib-compat.h>
#include "semaphoreP.h"
#include <kernel-features.h>
int
@@ -39,50 +38,18 @@ __new_sem_init (sem, pshared, value)
}
/* Map to the internal type. */
struct new_sem *isem = (struct new_sem *) sem;
struct sem *isem = (struct sem *) sem;
/* Use the values the user provided. */
isem->value = value;
#ifdef __ASSUME_PRIVATE_FUTEX
isem->private = pshared ? 0 : FUTEX_PRIVATE_FLAG;
#else
isem->private = pshared ? 0 : THREAD_GETMEM (THREAD_SELF,
header.private_futex);
#endif
/* Use the value the user provided. */
isem->count = value;
isem->nwaiters = 0;
/* We can completely ignore the PSHARED parameter since inter-process
use needs no special preparation. */
return 0;
}
versioned_symbol (libpthread, __new_sem_init, sem_init, GLIBC_2_1);
#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
int
attribute_compat_text_section
__old_sem_init (sem, pshared, value)
sem_t *sem;
int pshared;
unsigned int value;
{
/* Parameter sanity check. */
if (__builtin_expect (value > SEM_VALUE_MAX, 0))
{
__set_errno (EINVAL);
return -1;
}
/* Map to the internal type. */
struct old_sem *isem = (struct old_sem *) sem;
/* Use the value the user provided. */
isem->value = value;
/* We cannot store the PSHARED attribute. So we always use the
operations needed for shared semaphores. */
return 0;
}
strong_alias (__new_sem_init, __old_sem_init)
compat_symbol (libpthread, __old_sem_init, sem_init, GLIBC_2_0);
#endif
+5 -7
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -304,14 +304,12 @@ sem_open (const char *name, int oflag, ...)
/* Create the initial file content. */
sem_t initsem;
struct new_sem *iinitsem = (struct new_sem *) &initsem;
iinitsem->value = value;
iinitsem->private = 0;
iinitsem->nwaiters = 0;
struct sem *iinitsem = (struct sem *) &initsem;
iinitsem->count = value;
/* Initialize the remaining bytes as well. */
memset ((char *) &initsem + sizeof (struct new_sem), '\0',
sizeof (sem_t) - sizeof (struct new_sem));
memset ((char *) &initsem + sizeof (struct sem), '\0',
sizeof (sem_t) - sizeof (struct sem));
tmpfname = (char *) alloca (mountpoint.dirlen + 6 + 1);
char *xxxxxx = __mempcpy (tmpfname, mountpoint.dir, mountpoint.dirlen);
+1 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -60,10 +60,8 @@ extern int __sem_search (const void *a, const void *b) attribute_hidden;
/* Prototypes of functions with multiple interfaces. */
extern int __new_sem_init (sem_t *sem, int pshared, unsigned int value);
extern int __old_sem_init (sem_t *sem, int pshared, unsigned int value);
extern int __new_sem_destroy (sem_t *sem);
extern int __new_sem_post (sem_t *sem);
extern int __new_sem_wait (sem_t *sem);
extern int __old_sem_wait (sem_t *sem);
extern int __new_sem_trywait (sem_t *sem);
extern int __new_sem_getvalue (sem_t *sem, int *sval);
+1 -1
View File
@@ -131,7 +131,7 @@ typedef struct
= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \
THREAD_GSCOPE_FLAG_UNUSED); \
if (__res == THREAD_GSCOPE_FLAG_WAIT) \
lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
} \
while (0)
#define THREAD_GSCOPE_SET_FLAG() \
-3
View File
@@ -12,6 +12,3 @@ CLEANUP offsetof (struct pthread, cleanup)
CLEANUP_PREV offsetof (struct _pthread_cleanup_buffer, __prev)
MUTEX_FUTEX offsetof (pthread_mutex_t, __data.__lock)
POINTER_GUARD offsetof (tcbhead_t, pointer_guard)
#ifndef __ASSUME_PRIVATE_FUTEX
PRIVATE_FUTEX offsetof (tcbhead_t, private_futex)
#endif
+1 -6
View File
@@ -27,8 +27,6 @@
# include <stdint.h>
# include <stdlib.h>
# include <list.h>
# include <sysdep.h>
# include <kernel-features.h>
/* Type for the dtv. */
@@ -54,9 +52,6 @@ typedef struct
uintptr_t stack_guard;
uintptr_t pointer_guard;
int gscope_flag;
#ifndef __ASSUME_PRIVATE_FUTEX
int private_futex;
#endif
} tcbhead_t;
# define TLS_MULTIPLE_THREADS_IN_TCB 1
@@ -449,7 +444,7 @@ union user_desc_init
: "i" (offsetof (struct pthread, header.gscope_flag)), \
"0" (THREAD_GSCOPE_FLAG_UNUSED)); \
if (__res == THREAD_GSCOPE_FLAG_WAIT) \
lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
} \
while (0)
#define THREAD_GSCOPE_SET_FLAG() \
+1 -1
View File
@@ -173,7 +173,7 @@ register struct pthread *__thread_self __asm__("r13");
= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \
THREAD_GSCOPE_FLAG_UNUSED); \
if (__res == THREAD_GSCOPE_FLAG_WAIT) \
lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
} \
while (0)
#define THREAD_GSCOPE_SET_FLAG() \
-1
View File
@@ -15,4 +15,3 @@ MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads)
PID thread_offsetof (pid)
TID thread_offsetof (tid)
POINTER_GUARD (offsetof (tcbhead_t, pointer_guard) - TLS_TCB_OFFSET - sizeof (tcbhead_t))
PRIVATE_FUTEX_OFFSET thread_offsetof (header.private_futex)
+1 -1
View File
@@ -190,7 +190,7 @@ register void *__thread_register __asm__ ("r13");
= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \
THREAD_GSCOPE_FLAG_UNUSED); \
if (__res == THREAD_GSCOPE_FLAG_WAIT) \
lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
} \
while (0)
#define THREAD_GSCOPE_SET_FLAG() \
+3 -4
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2006 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
@@ -30,7 +30,7 @@
#define AIO_MISC_NOTIFY(waitlist) \
do { \
if (*waitlist->counterp > 0 && --*waitlist->counterp == 0) \
lll_private_futex_wake (waitlist->counterp, 1); \
lll_futex_wake (waitlist->counterp, 1); \
} while (0)
#define AIO_MISC_WAIT(result, futex, timeout, cancel) \
@@ -49,8 +49,7 @@
int status; \
do \
{ \
status = lll_private_futex_timed_wait (futexaddr, oldval, \
timeout); \
status = lll_futex_timed_wait (futexaddr, oldval, timeout); \
if (status != -EWOULDBLOCK) \
break; \
\
+3 -4
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2006 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
@@ -31,7 +31,7 @@
#define GAI_MISC_NOTIFY(waitlist) \
do { \
if (*waitlist->counterp > 0 && --*waitlist->counterp == 0) \
lll_private_futex_wake (waitlist->counterp, 1); \
lll_futex_wake (waitlist->counterp, 1); \
} while (0)
#define GAI_MISC_WAIT(result, futex, timeout, cancel) \
@@ -50,8 +50,7 @@
int status; \
do \
{ \
status = lll_private_futex_timed_wait (futexaddr, oldval, \
timeout); \
status = lll_futex_timed_wait (futexaddr, oldval, timeout); \
if (status != -EWOULDBLOCK) \
break; \
\
+2 -2
View File
@@ -72,7 +72,7 @@ call_initialize_minimal (void)
}
SECTION (".init");
extern void __attribute__ ((section (".init"))) _init (void);
extern void _init (void);
void
_init (void)
{
@@ -93,7 +93,7 @@ asm ("\n/*@_init_EPILOG_ENDS*/");
asm ("\n/*@_fini_PROLOG_BEGINS*/");
SECTION (".fini");
extern void __attribute__ ((section (".fini"))) _fini (void);
extern void _fini (void);
void
_fini (void)
{
+1
View File
@@ -97,6 +97,7 @@ struct pthread_functions
void (*ptr__nptl_deallocate_tsd) (void);
int (*ptr__nptl_setxid) (struct xid_command *);
void (*ptr_freeres) (void);
void (*ptr_wait_lookup_done) (int);
};
/* Variable in libc.so. */
+8 -11
View File
@@ -21,7 +21,6 @@
#define _PTHREAD_H 1
#include <features.h>
#include <endian.h>
#include <sched.h>
#include <time.h>
@@ -121,23 +120,21 @@ enum
};
/* Read-write lock initializers. */
# define PTHREAD_RWLOCK_INITIALIZER \
# if __WORDSIZE == 64
# define PTHREAD_RWLOCK_INITIALIZER \
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
# else
# define PTHREAD_RWLOCK_INITIALIZER \
{ { 0, 0, 0, 0, 0, 0, 0, 0 } }
# endif
# ifdef __USE_GNU
# if __WORDSIZE == 64
# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
# else
# if __BYTE_ORDER == __LITTLE_ENDIAN
# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
{ { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, \
0, 0, 0, 0 } }
# else
# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,\
0 } }
# endif
# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
{ { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, 0 } }
# endif
# endif
#endif /* Unix98 or XOpen2K */
+1 -5
View File
@@ -27,7 +27,6 @@
# include <stdint.h>
# include <stdlib.h>
# include <list.h>
# include <kernel-features.h>
/* Type for the dtv. */
@@ -52,9 +51,6 @@ typedef struct
uintptr_t sysinfo;
uintptr_t stack_guard;
int gscope_flag;
#ifndef __ASSUME_PRIVATE_FUTEX
int private_futex;
#endif
} tcbhead_t;
# ifndef __s390x__
@@ -183,7 +179,7 @@ typedef struct
= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \
THREAD_GSCOPE_FLAG_UNUSED); \
if (__res == THREAD_GSCOPE_FLAG_WAIT) \
lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
} \
while (0)
#define THREAD_GSCOPE_SET_FLAG() \
-3
View File
@@ -10,6 +10,3 @@ MULTIPLE_THREADS_OFFSET offsetof (struct pthread, header.multiple_threads)
TLS_PRE_TCB_SIZE sizeof (struct pthread)
MUTEX_FUTEX offsetof (pthread_mutex_t, __data.__lock)
POINTER_GUARD offsetof (tcbhead_t, pointer_guard)
#ifndef __ASSUME_PRIVATE_FUTEX
PRIVATE_FUTEX offsetof (struct pthread, header.private_futex)
#endif
+1 -5
View File
@@ -26,10 +26,6 @@
# include <stdbool.h>
# include <stddef.h>
# include <stdint.h>
# include <stdlib.h>
# include <list.h>
# include <sysdep.h>
# include <kernel-features.h>
/* Type for the dtv. */
typedef union dtv
@@ -164,7 +160,7 @@ typedef struct
= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \
THREAD_GSCOPE_FLAG_UNUSED); \
if (__res == THREAD_GSCOPE_FLAG_WAIT) \
lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
} \
while (0)
#define THREAD_GSCOPE_SET_FLAG() \
+7 -1
View File
@@ -46,9 +46,15 @@ typedef struct
dtv_t *dtv;
void *self;
int multiple_threads;
#if __WORDSIZE == 64
int gscope_flag;
#endif
uintptr_t sysinfo;
uintptr_t stack_guard;
uintptr_t pointer_guard;
#if __WORDSIZE != 64
int gscope_flag;
#endif
} tcbhead_t;
#else /* __ASSEMBLER__ */
@@ -151,7 +157,7 @@ register struct pthread *__thread_self __asm__("%g7");
= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \
THREAD_GSCOPE_FLAG_UNUSED); \
if (__res == THREAD_GSCOPE_FLAG_WAIT) \
lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
} \
while (0)
#define THREAD_GSCOPE_SET_FLAG() \
+2 -3
View File
@@ -1,4 +1,4 @@
# Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -25,8 +25,7 @@ libpthread-sysdep_routines += pt-fork pthread_mutex_cond_lock
gen-as-const-headers += lowlevelcond.sym lowlevelrwlock.sym \
lowlevelbarrier.sym unwindbuf.sym \
lowlevelrobustlock.sym pthread-pi-defines.sym \
structsem.sym
lowlevelrobustlock.sym pthread-pi-defines.sym
endif
ifeq ($(subdir),posix)
@@ -1,4 +1,4 @@
/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004, 2006 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
@@ -237,6 +237,8 @@ typedef int lll_lock_t;
#define LLL_LOCK_INITIALIZER (0)
#define LLL_LOCK_INITIALIZER_LOCKED (1)
extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
/* The states of a lock are:
0 - untaken
1 - taken by one user
+1 -1
View File
@@ -203,7 +203,7 @@ __libc_fork (void)
if (atomic_decrement_and_test (&allp->handler->refcntr)
&& allp->handler->need_signal)
lll_private_futex_wake (allp->handler->refcntr, 1);
lll_futex_wake (allp->handler->refcntr, 1);
allp = allp->next;
}
@@ -1,4 +1,4 @@
/* Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004, 2005, 2006 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
@@ -128,10 +128,7 @@ typedef union
unsigned int __nr_writers_queued;
/* FLAGS must stay at this position in the structure to maintain
binary compatibility. */
unsigned char __flags;
unsigned char __shared;
unsigned char __pad1;
unsigned char __pad2;
unsigned int __flags;
int __writer;
} __data;
char __size[__SIZEOF_PTHREAD_RWLOCK_T];
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -17,19 +17,14 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <kernel-features.h>
/* All locks in libc are private. Use the kernel feature if possible. */
#define FUTEX_PRIVATE_FLAG 128
#ifdef __ASSUME_PRIVATE_FUTEX
# define FUTEX_WAIT (0 | FUTEX_PRIVATE_FLAG)
# define FUTEX_WAKE (1 | FUTEX_PRIVATE_FLAG)
#else
# define LOAD_FUTEX_WAIT(reg) \
movl %gs:PRIVATE_FUTEX, reg
# define LOAD_FUTEX_WAKE(reg) \
movl %gs:PRIVATE_FUTEX, reg ; \
orl $FUTEX_WAKE, reg
/* In libc.so we do not unconditionally use the lock prefix. Only if
the application is using threads. */
#ifndef UP
# define LOCK \
cmpl $0, %gs:MULTIPLE_THREADS_OFFSET; \
je 0f; \
lock; \
0:
#endif
#include "lowlevellock.S"
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -32,22 +32,8 @@
#define SYS_gettimeofday __NR_gettimeofday
#define SYS_futex 240
#ifndef FUTEX_WAIT
# define FUTEX_WAIT 0
# define FUTEX_WAKE 1
#endif
#ifndef LOAD_FUTEX_WAIT
# if FUTEX_WAIT == 0
# define LOAD_FUTEX_WAIT(reg) \
xorl reg, reg
# else
# define LOAD_FUTEX_WAIT(reg) \
movl $FUTEX_WAIT, reg
# endif
# define LOAD_FUTEX_WAKE(reg) \
movl $FUTEX_WAKE, reg
#endif
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
.globl __lll_mutex_lock_wait
@@ -69,7 +55,7 @@ __lll_mutex_lock_wait:
movl $2, %edx
movl %ecx, %ebx
xorl %esi, %esi /* No timeout. */
LOAD_FUTEX_WAIT (%ecx)
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
cmpl %edx, %eax /* NB: %edx == 2 */
jne 2f
@@ -165,7 +151,7 @@ __lll_mutex_timedlock_wait:
/* Futex call. */
movl %esp, %esi
LOAD_FUTEX_WAIT (%ecx)
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
movl $SYS_futex, %eax
ENTER_KERNEL
movl %eax, %ecx
@@ -219,6 +205,35 @@ __lll_mutex_timedlock_wait:
#endif
#ifdef NOT_IN_libc
.globl lll_unlock_wake_cb
.type lll_unlock_wake_cb,@function
.hidden lll_unlock_wake_cb
.align 16
lll_unlock_wake_cb:
pushl %ebx
pushl %ecx
pushl %edx
movl 20(%esp), %ebx
LOCK
subl $1, (%ebx)
je 1f
movl $FUTEX_WAKE, %ecx
movl $1, %edx /* Wake one thread. */
movl $SYS_futex, %eax
movl $0, (%ebx)
ENTER_KERNEL
1: popl %edx
popl %ecx
popl %ebx
ret
.size lll_unlock_wake_cb,.-lll_unlock_wake_cb
#endif
.globl __lll_mutex_unlock_wake
.type __lll_mutex_unlock_wake,@function
.hidden __lll_mutex_unlock_wake
@@ -237,7 +252,7 @@ __lll_mutex_unlock_wake:
movl %eax, %ebx
movl $0, (%eax)
LOAD_FUTEX_WAKE (%ecx)
movl $FUTEX_WAKE, %ecx
movl $1, %edx /* Wake one thread. */
movl $SYS_futex, %eax
ENTER_KERNEL
@@ -299,8 +314,6 @@ __lll_timedwait_tid:
jz 4f
movl %esp, %esi
/* XXX The kernel so far uses global futex for the wakeup at
all times. */
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
movl %ebp, %ebx
movl $SYS_futex, %eax
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -69,13 +69,7 @@ pthread_barrier_wait:
/* Wait for the remaining threads. The call will return immediately
if the CURR_EVENT memory has meanwhile been changed. */
7:
#if FUTEX_WAIT == 0
movl PRIVATE(%ebx), %ecx
#else
movl $FUTEX_WAIT, %ecx
orl PRIVATE(%ebx), %ecx
#endif
7: xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
xorl %esi, %esi
8: movl $SYS_futex, %eax
ENTER_KERNEL
@@ -126,7 +120,6 @@ pthread_barrier_wait:
so 0x7fffffff is the highest value. */
movl $0x7fffffff, %edx
movl $FUTEX_WAKE, %ecx
orl PRIVATE(%ebx), %ecx
movl $SYS_futex, %eax
ENTER_KERNEL
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -87,7 +87,7 @@ __pthread_cond_timedwait:
addl $1, total_seq(%ebx)
adcl $0, total_seq+4(%ebx)
addl $1, cond_futex(%ebx)
addl $(1 << nwaiters_shift), cond_nwaiters(%ebx)
addl $(1 << clock_bits), cond_nwaiters(%ebx)
#define FRAME_SIZE 24
subl $FRAME_SIZE, %esp
@@ -106,7 +106,7 @@ __pthread_cond_timedwait:
#ifdef __NR_clock_gettime
/* Get the clock number. */
movl cond_nwaiters(%ebx), %ebx
andl $((1 << nwaiters_shift) - 1), %ebx
andl $((1 << clock_bits) - 1), %ebx
/* Only clocks 0 and 1 are allowed so far. Both are handled in the
kernel. */
leal 4(%esp), %ecx
@@ -228,7 +228,7 @@ __pthread_cond_timedwait:
14: addl $1, woken_seq(%ebx)
adcl $0, woken_seq+4(%ebx)
24: subl $(1 << nwaiters_shift), cond_nwaiters(%ebx)
24: subl $(1 << clock_bits), cond_nwaiters(%ebx)
/* Wake up a thread which wants to destroy the condvar object. */
movl total_seq(%ebx), %eax
@@ -236,7 +236,7 @@ __pthread_cond_timedwait:
cmpl $0xffffffff, %eax
jne 25f
movl cond_nwaiters(%ebx), %eax
andl $~((1 << nwaiters_shift) - 1), %eax
andl $~((1 << clock_bits) - 1), %eax
jne 25f
addl $cond_nwaiters, %ebx
@@ -424,7 +424,7 @@ __condvar_tw_cleanup:
7: addl $1, woken_seq(%ebx)
adcl $0, woken_seq+4(%ebx)
3: subl $(1 << nwaiters_shift), cond_nwaiters(%ebx)
3: subl $(1 << clock_bits), cond_nwaiters(%ebx)
/* Wake up a thread which wants to destroy the condvar object. */
xorl %edi, %edi
@@ -433,7 +433,7 @@ __condvar_tw_cleanup:
cmpl $0xffffffff, %eax
jne 4f
movl cond_nwaiters(%ebx), %eax
andl $~((1 << nwaiters_shift) - 1), %eax
andl $~((1 << clock_bits) - 1), %eax
jne 4f
addl $cond_nwaiters, %ebx
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -80,7 +80,7 @@ __pthread_cond_wait:
addl $1, total_seq(%ebx)
adcl $0, total_seq+4(%ebx)
addl $1, cond_futex(%ebx)
addl $(1 << nwaiters_shift), cond_nwaiters(%ebx)
addl $(1 << clock_bits), cond_nwaiters(%ebx)
#define FRAME_SIZE 16
subl $FRAME_SIZE, %esp
@@ -157,7 +157,7 @@ __pthread_cond_wait:
adcl $0, woken_seq+4(%ebx)
/* Unlock */
16: subl $(1 << nwaiters_shift), cond_nwaiters(%ebx)
16: subl $(1 << clock_bits), cond_nwaiters(%ebx)
/* Wake up a thread which wants to destroy the condvar object. */
movl total_seq(%ebx), %eax
@@ -165,7 +165,7 @@ __pthread_cond_wait:
cmpl $0xffffffff, %eax
jne 17f
movl cond_nwaiters(%ebx), %eax
andl $~((1 << nwaiters_shift) - 1), %eax
andl $~((1 << clock_bits) - 1), %eax
jne 17f
addl $cond_nwaiters, %ebx
@@ -315,7 +315,7 @@ __condvar_w_cleanup:
7: addl $1, woken_seq(%ebx)
adcl $0, woken_seq+4(%ebx)
3: subl $(1 << nwaiters_shift), cond_nwaiters(%ebx)
3: subl $(1 << clock_bits), cond_nwaiters(%ebx)
/* Wake up a thread which wants to destroy the condvar object. */
xorl %edi, %edi
@@ -324,7 +324,7 @@ __condvar_w_cleanup:
cmpl $0xffffffff, %eax
jne 4f
movl cond_nwaiters(%ebx), %eax
andl $~((1 << nwaiters_shift) - 1), %eax
andl $~((1 << clock_bits) - 1), %eax
jne 4f
addl $cond_nwaiters, %ebx
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -61,7 +61,7 @@ __pthread_rwlock_rdlock:
jne 14f
cmpl $0, WRITERS_QUEUED(%ebx)
je 5f
cmpb $0, FLAGS(%ebx)
cmpl $0, FLAGS(%ebx)
je 5f
3: addl $1, READERS_QUEUED(%ebx)
@@ -77,18 +77,8 @@ __pthread_rwlock_rdlock:
#endif
jne 10f
11:
#if __ASSUME_PRIVATE_FUTEX
movzbl PSHARED(%ebx), %ecx
xorl $FUTEX_PRIVATE_FLAG|FUTEX_WAIT, %ecx
#else
movzbl PSHARED(%ebx), %ecx
# if FUTEX_WAIT != 0
orl $FUTEX_WAIT, %ecx
# endif
xorl %gs:PRIVATE_FUTEX, %ecx
#endif
addl $READERS_WAKEUP, %ebx
11: addl $READERS_WAKEUP, %ebx
movl %esi, %ecx /* movl $FUTEX_WAIT, %ecx */
movl $SYS_futex, %eax
ENTER_KERNEL
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -65,7 +65,7 @@ pthread_rwlock_timedrdlock:
jne 14f
cmpl $0, WRITERS_QUEUED(%ebp)
je 5f
cmpb $0, FLAGS(%ebp)
cmpl $0, FLAGS(%ebp)
je 5f
/* Check the value of the timeout parameter. */
@@ -108,18 +108,8 @@ pthread_rwlock_timedrdlock:
/* Futex call. */
movl %ecx, (%esp) /* Store relative timeout. */
movl %edx, 4(%esp)
movl %esi, %edx
#if __ASSUME_PRIVATE_FUTEX
movzbl PSHARED(%ebp), %ecx
xorl $FUTEX_PRIVATE_FLAG|FUTEX_WAIT, %ecx
#else
movzbl PSHARED(%ebp), %ecx
# if FUTEX_WAIT != 0
orl $FUTEX_WAIT, %ecx
# endif
xorl %gs:PRIVATE_FUTEX, %ecx
#endif
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
movl %esp, %esi
leal READERS_WAKEUP(%ebp), %ebx
movl $SYS_futex, %eax
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -106,18 +106,8 @@ pthread_rwlock_timedwrlock:
/* Futex call. */
movl %ecx, (%esp) /* Store relative timeout. */
movl %edx, 4(%esp)
movl %esi, %edx
#if __ASSUME_PRIVATE_FUTEX
movzbl PSHARED(%ebp), %ecx
xorl $FUTEX_PRIVATE_FLAG|FUTEX_WAIT, %ecx
#else
movzbl PSHARED(%ebp), %ecx
# if FUTEX_WAIT != 0
orl $FUTEX_WAIT, %ecx
# endif
xorl %gs:PRIVATE_FUTEX, %ecx
#endif
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
movl %esp, %esi
leal WRITERS_WAKEUP(%ebp), %ebx
movl $SYS_futex, %eax
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -61,8 +61,9 @@ __pthread_rwlock_unlock:
5: movl $0, WRITER(%edi)
movl $1, %edx
movl $1, %ecx
leal WRITERS_WAKEUP(%edi), %ebx
movl %ecx, %edx
cmpl $0, WRITERS_QUEUED(%edi)
jne 0f
@@ -82,16 +83,7 @@ __pthread_rwlock_unlock:
#endif
jne 7f
8:
#if __ASSUME_PRIVATE_FUTEX
movzbl PSHARED(%edi), %ecx
xorl $FUTEX_PRIVATE_FLAG|FUTEX_WAKE, %ecx
#else
movzbl PSHARED(%edi), %ecx
orl $FUTEX_WAKE, %ecx
xorl %gs:PRIVATE_FUTEX, %ecx
#endif
movl $SYS_futex, %eax
8: movl $SYS_futex, %eax
ENTER_KERNEL
xorl %eax, %eax
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -75,18 +75,8 @@ __pthread_rwlock_wrlock:
#endif
jne 10f
11:
#if __ASSUME_PRIVATE_FUTEX
movzbl PSHARED(%ebx), %ecx
xorl $FUTEX_PRIVATE_FLAG|FUTEX_WAIT, %ecx
#else
movzbl PSHARED(%ebx), %ecx
# if FUTEX_WAIT != 0
orl $FUTEX_WAIT, %ecx
# endif
xorl %gs:PRIVATE_FUTEX, %ecx
#endif
addl $WRITERS_WAKEUP, %ebx
11: addl $WRITERS_WAKEUP, %ebx
movl %esi, %ecx /* movl $FUTEX_WAIT, %ecx */
movl $SYS_futex, %eax
ENTER_KERNEL
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -20,7 +20,6 @@
#include <sysdep.h>
#include <shlib-compat.h>
#include <pthread-errnos.h>
#include <structsem.h>
#ifndef UP
# define LOCK lock
@@ -41,27 +40,19 @@ __new_sem_post:
pushl %ebx
movl 8(%esp), %ebx
LOCK
#if VALUE == 0
addl $1, (%ebx)
#else
addl $1, VALUE(%ebx)
#endif
cmpl $0, NWAITERS(%ebx)
je 2f
movl $FUTEX_WAKE, %ecx
orl PRIVATE(%ebx), %ecx
movl $1, %edx
LOCK
xaddl %edx, (%ebx)
movl $SYS_futex, %eax
movl $FUTEX_WAKE, %ecx
addl $1, %edx
ENTER_KERNEL
testl %eax, %eax
js 1f
2: xorl %eax, %eax
xorl %eax, %eax
popl %ebx
ret
@@ -20,7 +20,6 @@
#include <sysdep.h>
#include <shlib-compat.h>
#include <pthread-errnos.h>
#include <structsem.h>
#ifndef UP
# define LOCK lock
@@ -30,12 +29,7 @@
#define SYS_gettimeofday __NR_gettimeofday
#define SYS_futex 240
#define FUTEX_WAIT 0
#if VALUE != 0
# error "code needs to be rewritten for VALUE != 0"
#endif
#define FUTEX_WAKE 1
.text
@@ -43,8 +37,14 @@
.globl sem_timedwait
.type sem_timedwait,@function
.align 16
cfi_startproc
sem_timedwait:
.LSTARTCODE:
/* First check for cancellation. */
movl %gs:CANCELHANDLING, %eax
andl $0xfffffff9, %eax
cmpl $8, %eax
je 10f
movl 4(%esp), %ecx
movl (%ecx), %eax
@@ -61,24 +61,24 @@ sem_timedwait:
/* Check whether the timeout value is valid. */
1: pushl %esi
.Lpush_esi:
cfi_adjust_cfa_offset(4)
pushl %edi
.Lpush_edi:
cfi_adjust_cfa_offset(4)
pushl %ebx
.Lpush_ebx:
cfi_adjust_cfa_offset(4)
subl $12, %esp
.Lsub_esp:
cfi_adjust_cfa_offset(12)
movl 32(%esp), %edi
cfi_offset(7, -12) /* %edi */
/* Check for invalid nanosecond field. */
cmpl $1000000000, 4(%edi)
movl $EINVAL, %esi
cfi_offset(6, -8) /* %esi */
jae 6f
LOCK
incl NWAITERS(%ecx)
cfi_offset(3, -16) /* %ebx */
7: xorl %ecx, %ecx
movl %esp, %ebx
movl %ecx, %edx
@@ -103,26 +103,19 @@ sem_timedwait:
movl %ecx, (%esp) /* Store relative timeout. */
movl %edx, 4(%esp)
.LcleanupSTART:
call __pthread_enable_asynccancel
movl %eax, 8(%esp)
movl 28(%esp), %ebx /* Load semaphore address. */
#if FUTEX_WAIT == 0
movl PRIVATE(%ebx), %ecx
#else
movl $FUTEX_WAIT, %ecx
orl PRIVATE(%ebx), %ecx
#endif
movl 28(%esp), %ebx
xorl %ecx, %ecx
movl %esp, %esi
xorl %edx, %edx
movl $SYS_futex, %eax
xorl %edx, %edx
ENTER_KERNEL
movl %eax, %esi
movl 8(%esp), %eax
call __pthread_disable_asynccancel
.LcleanupEND:
testl %esi, %esi
je 9f
@@ -138,22 +131,24 @@ sem_timedwait:
cmpxchgl %ecx, (%ebx)
jne 8b
xorl %eax, %eax
10: LOCK
decl NWAITERS(%ebx)
addl $12, %esp
.Ladd_esp:
cfi_adjust_cfa_offset(-12)
xorl %eax, %eax
popl %ebx
.Lpop_ebx:
cfi_adjust_cfa_offset(-4)
cfi_restore(3)
popl %edi
.Lpop_edi:
cfi_adjust_cfa_offset(-4)
cfi_restore(7)
popl %esi
.Lpop_esi:
cfi_adjust_cfa_offset(-4)
cfi_restore(6)
ret
.Lafter_ret:
cfi_adjust_cfa_offset(24)
cfi_offset(6, -8) /* %esi */
cfi_offset(7, -12) /* %edi */
cfi_offset(3, -16) /* %ebx */
3: negl %esi
6:
#ifdef PIC
@@ -177,163 +172,25 @@ sem_timedwait:
movl %esi, (%eax)
#endif
movl 28(%esp), %ebx /* Load semaphore address. */
addl $12, %esp
cfi_adjust_cfa_offset(-12)
orl $-1, %eax
jmp 10b
.size sem_timedwait,.-sem_timedwait
popl %ebx
cfi_adjust_cfa_offset(-4)
cfi_restore(3)
popl %edi
cfi_adjust_cfa_offset(-4)
cfi_restore(7)
popl %esi
cfi_adjust_cfa_offset(-4)
cfi_restore(6)
ret
.type sem_wait_cleanup,@function
sem_wait_cleanup:
10: /* Canceled. */
movl $0xffffffff, %gs:RESULT
LOCK
decl NWAITERS(%ebx)
movl %eax, (%esp)
.LcallUR:
call _Unwind_Resume@PLT
hlt
.LENDCODE:
.size sem_wait_cleanup,.-sem_wait_cleanup
.section .gcc_except_table,"a",@progbits
.LexceptSTART:
.byte 0xff # @LPStart format (omit)
.byte 0xff # @TType format (omit)
.byte 0x01 # call-site format
# DW_EH_PE_uleb128
.uleb128 .Lcstend-.Lcstbegin
.Lcstbegin:
.uleb128 .LcleanupSTART-.LSTARTCODE
.uleb128 .LcleanupEND-.LcleanupSTART
.uleb128 sem_wait_cleanup-.LSTARTCODE
.uleb128 0
.uleb128 .LcallUR-.LSTARTCODE
.uleb128 .LENDCODE-.LcallUR
.uleb128 0
.uleb128 0
.Lcstend:
.section .eh_frame,"a",@progbits
.LSTARTFRAME:
.long .LENDCIE-.LSTARTCIE # Length of the CIE.
.LSTARTCIE:
.long 0 # CIE ID.
.byte 1 # Version number.
#ifdef SHARED
.string "zPLR" # NUL-terminated augmentation
# string.
#else
.string "zPL" # NUL-terminated augmentation
# string.
#endif
.uleb128 1 # Code alignment factor.
.sleb128 -4 # Data alignment factor.
.byte 8 # Return address register
# column.
#ifdef SHARED
.uleb128 7 # Augmentation value length.
.byte 0x9b # Personality: DW_EH_PE_pcrel
# + DW_EH_PE_sdata4
# + DW_EH_PE_indirect
.long DW.ref.__gcc_personality_v0-.
.byte 0x1b # LSDA Encoding: DW_EH_PE_pcrel
# + DW_EH_PE_sdata4.
.byte 0x1b # FDE Encoding: DW_EH_PE_pcrel
# + DW_EH_PE_sdata4.
#else
.uleb128 6 # Augmentation value length.
.byte 0x0 # Personality: absolute
.long __gcc_personality_v0
.byte 0x0 # LSDA Encoding: absolute
#endif
.byte 0x0c # DW_CFA_def_cfa
.uleb128 4
.uleb128 4
.byte 0x88 # DW_CFA_offset, column 0x10
.uleb128 1
.align 4
.LENDCIE:
.long .LENDFDE-.LSTARTFDE # Length of the FDE.
.LSTARTFDE:
.long .LSTARTFDE-.LSTARTFRAME # CIE pointer.
#ifdef SHARED
.long .LSTARTCODE-. # PC-relative start address
# of the code.
#else
.long .LSTARTCODE # Start address of the code.
#endif
.long .LENDCODE-.LSTARTCODE # Length of the code.
.uleb128 4 # Augmentation size
#ifdef SHARED
.long .LexceptSTART-.
#else
.long .LexceptSTART
#endif
.byte 4 # DW_CFA_advance_loc4
.long .Lpush_esi-.LSTARTCODE
.byte 14 # DW_CFA_def_cfa_offset
.uleb128 8
.byte 0x86 # DW_CFA_offset %esi
.uleb128 2
.byte 4 # DW_CFA_advance_loc4
.long .Lpush_edi-.Lpush_esi
.byte 14 # DW_CFA_def_cfa_offset
.uleb128 12
.byte 0x87 # DW_CFA_offset %edi
.uleb128 3
.byte 4 # DW_CFA_advance_loc4
.long .Lpush_ebx-.Lpush_edi
.byte 14 # DW_CFA_def_cfa_offset
.uleb128 16
.byte 0x83 # DW_CFA_offset %ebx
.uleb128 4
.byte 4 # DW_CFA_advance_loc4
.long .Lsub_esp-.Lpush_ebx
.byte 14 # DW_CFA_def_cfa_offset
.uleb128 28
.byte 4 # DW_CFA_advance_loc4
.long .Ladd_esp-.Lsub_esp
.byte 14 # DW_CFA_def_cfa_offset
.uleb128 16
.byte 4 # DW_CFA_advance_loc4
.long .Lpop_ebx-.Ladd_esp
.byte 14 # DW_CFA_def_cfa_offset
.uleb128 12
.byte 0xc3 # DW_CFA_restore %ebx
.byte 4 # DW_CFA_advance_loc4
.long .Lpop_edi-.Lpop_ebx
.byte 14 # DW_CFA_def_cfa_offset
.uleb128 8
.byte 0xc7 # DW_CFA_restore %edi
.byte 4 # DW_CFA_advance_loc4
.long .Lpop_esi-.Lpop_edi
.byte 14 # DW_CFA_def_cfa_offset
.uleb128 4
.byte 0xc6 # DW_CFA_restore %esi
.byte 4 # DW_CFA_advance_loc4
.long .Lafter_ret-.Lpop_esi
.byte 14 # DW_CFA_def_cfa_offset
.uleb128 28
.byte 0x86 # DW_CFA_offset %esi
.uleb128 2
.byte 0x87 # DW_CFA_offset %edi
.uleb128 3
.byte 0x83 # DW_CFA_offset %ebx
.uleb128 4
.align 4
.LENDFDE:
#ifdef SHARED
.hidden DW.ref.__gcc_personality_v0
.weak DW.ref.__gcc_personality_v0
.section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
.align 4
.type DW.ref.__gcc_personality_v0, @object
.size DW.ref.__gcc_personality_v0, 4
DW.ref.__gcc_personality_v0:
.long __gcc_personality_v0
#endif
orl $0x10, %gs:CANCELHANDLING
movl %gs:CLEANUP_JMP_BUF, %eax
jmp HIDDEN_JUMPTARGET (__pthread_unwind)
cfi_endproc
.size sem_timedwait,.-sem_timedwait
+35 -258
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -20,7 +20,6 @@
#include <sysdep.h>
#include <shlib-compat.h>
#include <pthread-errnos.h>
#include <structsem.h>
#ifndef UP
# define LOCK lock
@@ -29,261 +28,22 @@
#endif
#define SYS_futex 240
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#if VALUE != 0
# error "code needs to be rewritten for VALUE != 0"
#endif
.text
.globl __new_sem_wait
.type __new_sem_wait,@function
.align 16
__new_sem_wait:
.LSTARTCODE:
pushl %ebx
.Lpush_ebx:
pushl %esi
.Lpush_esi:
subl $4, %esp
.Lsub_esp:
movl 16(%esp), %ebx
movl (%ebx), %eax
2: testl %eax, %eax
je 1f
leal -1(%eax), %edx
LOCK
cmpxchgl %edx, (%ebx)
jne 2b
7: xorl %eax, %eax
9: movl 4(%esp), %esi
movl 8(%esp), %ebx
addl $12, %esp
.Ladd_esp:
ret
.Lafter_ret:
1: LOCK
incl NWAITERS(%ebx)
.LcleanupSTART:
6: call __pthread_enable_asynccancel
movl %eax, (%esp)
#if FUTEX_WAIT == 0
movl PRIVATE(%ebx), %ecx
#else
movl $FUTEX_WAIT, %ecx
orl PRIVATE(%ebx), %ecx
#endif
xorl %esi, %esi
xorl %edx, %edx
movl $SYS_futex, %eax
ENTER_KERNEL
movl %eax, %esi
movl (%esp), %eax
call __pthread_disable_asynccancel
.LcleanupEND:
testl %esi, %esi
je 3f
cmpl $-EWOULDBLOCK, %esi
jne 4f
3:
movl (%ebx), %eax
5: testl %eax, %eax
je 6b
leal -1(%eax), %edx
LOCK
cmpxchgl %edx, (%ebx)
jne 5b
LOCK
decl NWAITERS(%ebx)
jmp 7b
4: LOCK
decl NWAITERS(%ebx)
negl %esi
#ifdef PIC
call __i686.get_pc_thunk.bx
#else
movl $8f, %ebx
8:
#endif
addl $_GLOBAL_OFFSET_TABLE_, %ebx
#if USE___THREAD
# ifdef NO_TLS_DIRECT_SEG_REFS
movl errno@gotntpoff(%ebx), %edx
addl %gs:0, %edx
movl %esi, (%edx)
# else
movl errno@gotntpoff(%ebx), %edx
movl %esi, %gs:(%edx)
# endif
#else
call __errno_location@plt
movl %esi, (%eax)
#endif
orl $-1, %eax
jmp 9b
.size __new_sem_wait,.-__new_sem_wait
versioned_symbol(libpthread, __new_sem_wait, sem_wait, GLIBC_2_1)
.type sem_wait_cleanup,@function
sem_wait_cleanup:
LOCK
decl NWAITERS(%ebx)
movl %eax, (%esp)
.LcallUR:
call _Unwind_Resume@PLT
hlt
.LENDCODE:
.size sem_wait_cleanup,.-sem_wait_cleanup
.section .gcc_except_table,"a",@progbits
.LexceptSTART:
.byte 0xff # @LPStart format (omit)
.byte 0xff # @TType format (omit)
.byte 0x01 # call-site format
# DW_EH_PE_uleb128
.uleb128 .Lcstend-.Lcstbegin
.Lcstbegin:
.uleb128 .LcleanupSTART-.LSTARTCODE
.uleb128 .LcleanupEND-.LcleanupSTART
.uleb128 sem_wait_cleanup-.LSTARTCODE
.uleb128 0
.uleb128 .LcallUR-.LSTARTCODE
.uleb128 .LENDCODE-.LcallUR
.uleb128 0
.uleb128 0
.Lcstend:
.section .eh_frame,"a",@progbits
.LSTARTFRAME:
.long .LENDCIE-.LSTARTCIE # Length of the CIE.
.LSTARTCIE:
.long 0 # CIE ID.
.byte 1 # Version number.
#ifdef SHARED
.string "zPLR" # NUL-terminated augmentation
# string.
#else
.string "zPL" # NUL-terminated augmentation
# string.
#endif
.uleb128 1 # Code alignment factor.
.sleb128 -4 # Data alignment factor.
.byte 8 # Return address register
# column.
#ifdef SHARED
.uleb128 7 # Augmentation value length.
.byte 0x9b # Personality: DW_EH_PE_pcrel
# + DW_EH_PE_sdata4
# + DW_EH_PE_indirect
.long DW.ref.__gcc_personality_v0-.
.byte 0x1b # LSDA Encoding: DW_EH_PE_pcrel
# + DW_EH_PE_sdata4.
.byte 0x1b # FDE Encoding: DW_EH_PE_pcrel
# + DW_EH_PE_sdata4.
#else
.uleb128 6 # Augmentation value length.
.byte 0x0 # Personality: absolute
.long __gcc_personality_v0
.byte 0x0 # LSDA Encoding: absolute
#endif
.byte 0x0c # DW_CFA_def_cfa
.uleb128 4
.uleb128 4
.byte 0x88 # DW_CFA_offset, column 0x10
.uleb128 1
.align 4
.LENDCIE:
.long .LENDFDE-.LSTARTFDE # Length of the FDE.
.LSTARTFDE:
.long .LSTARTFDE-.LSTARTFRAME # CIE pointer.
#ifdef SHARED
.long .LSTARTCODE-. # PC-relative start address
# of the code.
#else
.long .LSTARTCODE # Start address of the code.
#endif
.long .LENDCODE-.LSTARTCODE # Length of the code.
.uleb128 4 # Augmentation size
#ifdef SHARED
.long .LexceptSTART-.
#else
.long .LexceptSTART
#endif
.byte 4 # DW_CFA_advance_loc4
.long .Lpush_ebx-.LSTARTCODE
.byte 14 # DW_CFA_def_cfa_offset
.uleb128 8
.byte 0x83 # DW_CFA_offset %ebx
.uleb128 2
.byte 4 # DW_CFA_advance_loc4
.long .Lpush_esi-.Lpush_ebx
.byte 14 # DW_CFA_def_cfa_offset
.uleb128 12
.byte 0x86 # DW_CFA_offset %esi
.uleb128 3
.byte 4 # DW_CFA_advance_loc4
.long .Lsub_esp-.Lpush_esi
.byte 14 # DW_CFA_def_cfa_offset
.uleb128 16
.byte 4 # DW_CFA_advance_loc4
.long .Ladd_esp-.Lsub_esp
.byte 14 # DW_CFA_def_cfa_offset
.uleb128 4
.byte 0xc3 # DW_CFA_restore %ebx
.byte 0xc6 # DW_CFA_restore %esi
.byte 4 # DW_CFA_advance_loc4
.long .Lafter_ret-.Ladd_esp
.byte 14 # DW_CFA_def_cfa_offset
.uleb128 16
.byte 0x83 # DW_CFA_offset %ebx
.uleb128 2
.byte 0x86 # DW_CFA_offset %esi
.uleb128 3
.align 4
.LENDFDE:
#ifdef SHARED
.hidden DW.ref.__gcc_personality_v0
.weak DW.ref.__gcc_personality_v0
.section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
.align 4
.type DW.ref.__gcc_personality_v0, @object
.size DW.ref.__gcc_personality_v0, 4
DW.ref.__gcc_personality_v0:
.long __gcc_personality_v0
#endif
#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
.section ".text.compat", "ax"
.global __old_sem_wait
.type __old_sem_wait,@function
.align 16
cfi_startproc
__old_sem_wait:
__new_sem_wait:
/* First check for cancellation. */
movl %gs:CANCELHANDLING, %eax
andl $0xfffffff9, %eax
cmpl $8, %eax
je 5f
pushl %ebx
cfi_adjust_cfa_offset(4)
pushl %esi
@@ -292,9 +52,9 @@ __old_sem_wait:
cfi_adjust_cfa_offset(4)
movl 16(%esp), %ebx
cfi_offset(ebx, -8)
cfi_offset(3, -8) /* %ebx */
cfi_offset(esi, -12)
cfi_offset(6, -12) /* %esi */
3: movl (%ebx), %eax
2: testl %eax, %eax
je 1f
@@ -305,17 +65,17 @@ __old_sem_wait:
jne 2b
xorl %eax, %eax
5: movl 4(%esp), %esi
movl 4(%esp), %esi
cfi_restore(6)
movl 8(%esp), %ebx
cfi_restore(3)
addl $12, %esp
cfi_restore(ebx)
cfi_restore(esi)
cfi_adjust_cfa_offset(-12)
ret
cfi_adjust_cfa_offset(12)
cfi_offset(ebx, -8)
cfi_offset(esi, -12)
cfi_offset(3, -8) /* %ebx */
cfi_offset(6, -12) /* %esi */
1: call __pthread_enable_asynccancel
movl %eax, (%esp)
@@ -355,8 +115,25 @@ __old_sem_wait:
movl %esi, (%eax)
#endif
orl $-1, %eax
jmp 5b
movl 4(%esp), %esi
cfi_restore(6)
movl 8(%esp), %ebx
cfi_restore(3)
addl $12, %esp
cfi_adjust_cfa_offset(-12)
ret
5: /* Canceled. */
movl $0xffffffff, %gs:RESULT
LOCK
orl $0x10, %gs:CANCELHANDLING
movl %gs:CLEANUP_JMP_BUF, %eax
jmp HIDDEN_JUMPTARGET (__pthread_unwind)
cfi_endproc
.size __old_sem_wait,.-__old_sem_wait
.size __new_sem_wait,.-__new_sem_wait
versioned_symbol(libpthread, __new_sem_wait, sem_wait, GLIBC_2_1)
#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
.global __old_sem_wait
__old_sem_wait = __new_sem_wait
compat_symbol(libpthread, __old_sem_wait, sem_wait, GLIBC_2_0)
#endif
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -23,8 +23,6 @@
#include <time.h>
#include <sys/param.h>
#include <bits/pthreadtypes.h>
#include <kernel-features.h>
#include <tcb-offsets.h>
#ifndef LOCK_INSTR
# ifdef UP
@@ -40,14 +38,6 @@
#define FUTEX_LOCK_PI 6
#define FUTEX_UNLOCK_PI 7
#define FUTEX_TRYLOCK_PI 8
#define FUTEX_PRIVATE_FLAG 128
/* Values for 'private' parameter of locking macros. Yes, the
definition seems to be backwards. But it is not. The bit will be
reversed before passing to the system call. */
#define LLL_PRIVATE 0
#define LLL_SHARED FUTEX_PRIVATE_FLAG
/* Initializer for compatibility lock. */
@@ -154,11 +144,23 @@ LLL_STUB_UNWIND_INFO_START \
LLL_STUB_UNWIND_INFO_END
#define lll_futex_wait(futex, val, private) \
lll_futex_timed_wait (futex, val, NULL, private)
#define lll_futex_wait(futex, val) \
({ \
int __status; \
register __typeof (val) _val asm ("edx") = (val); \
__asm __volatile (LLL_EBX_LOAD \
LLL_ENTER_KERNEL \
LLL_EBX_LOAD \
: "=a" (__status) \
: "0" (SYS_futex), LLL_EBX_REG (futex), "S" (0), \
"c" (FUTEX_WAIT), "d" (_val), \
"i" (offsetof (tcbhead_t, sysinfo)) \
: "memory"); \
__status; \
})
#define lll_futex_timed_wait(futex, val, timeout, private) \
#define lll_futex_timed_wait(futex, val, timeout) \
({ \
int __status; \
register __typeof (val) _val asm ("edx") = (val); \
@@ -174,7 +176,7 @@ LLL_STUB_UNWIND_INFO_END
})
#define lll_futex_wake(futex, nr, private) \
#define lll_futex_wake(futex, nr) \
do { \
int __ignore; \
register __typeof (nr) _nr asm ("edx") = (nr); \
@@ -189,77 +191,6 @@ LLL_STUB_UNWIND_INFO_END
} while (0)
#define lll_private_futex_wait(futex, val) \
lll_private_futex_timed_wait (futex, val, NULL)
#ifdef __ASSUME_PRIVATE_FUTEX
# define lll_private_futex_timed_wait(futex, val, timeout) \
({ \
int __status; \
register __typeof (val) _val asm ("edx") = (val); \
__asm __volatile (LLL_EBX_LOAD \
LLL_ENTER_KERNEL \
LLL_EBX_LOAD \
: "=a" (__status) \
: "0" (SYS_futex), LLL_EBX_REG (futex), "S" (timeout), \
"c" (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)), "d" (_val), \
"i" (offsetof (tcbhead_t, sysinfo)) \
: "memory"); \
__status; \
})
# define lll_private_futex_wake(futex, nr) \
do { \
int __ignore; \
register __typeof (nr) _nr asm ("edx") = (nr); \
__asm __volatile (LLL_EBX_LOAD \
LLL_ENTER_KERNEL \
LLL_EBX_LOAD \
: "=a" (__ignore) \
: "0" (SYS_futex), LLL_EBX_REG (futex), \
"c" (FUTEX_WAKE | FUTEX_PRIVATE_FLAG), "d" (_nr), \
"i" (0) /* phony, to align next arg's number */, \
"i" (offsetof (tcbhead_t, sysinfo))); \
} while (0)
#else
# define lll_private_futex_timed_wait(futex, val, timeout) \
({ \
int __status; \
int __ignore; \
register __typeof (val) _val asm ("edx") = (val); \
__asm __volatile ("movl %%gs:%P7, %%ecx\n\t" \
LLL_EBX_LOAD \
LLL_ENTER_KERNEL \
LLL_EBX_LOAD \
: "=a" (__status), "=c" (__ignore) \
: LLL_EBX_REG (futex), "0" (SYS_futex), "S" (timeout), \
"d" (_val), "i" (offsetof (tcbhead_t, sysinfo)), \
"i" (PRIVATE_FUTEX) \
: "memory"); \
__status; \
})
# define lll_private_futex_wake(futex, nr) \
do { \
int __ignore; \
int __ignore2; \
register __typeof (nr) _nr asm ("edx") = (nr); \
__asm __volatile ("orl %%gs:%P7, %%ecx\n\t" \
LLL_EBX_LOAD \
LLL_ENTER_KERNEL \
LLL_EBX_LOAD \
: "=a" (__ignore), "=c" (__ignore2) \
: LLL_EBX_REG (futex), "0" (SYS_futex), \
"1" (FUTEX_WAKE), "d" (_nr), \
"i" (offsetof (tcbhead_t, sysinfo)), \
"i" (PRIVATE_FUTEX)); \
} while (0)
#endif
/* Does not preserve %eax and %ecx. */
extern int __lll_mutex_lock_wait (int val, int *__futex)
__attribute ((regparm (2))) attribute_hidden;
@@ -483,6 +414,21 @@ extern int __lll_mutex_unlock_wake (int *__futex)
"i" (offsetof (tcbhead_t, sysinfo))); })
#define lll_futex_wake(futex, nr) \
do { \
int __ignore; \
register __typeof (nr) _nr asm ("edx") = (nr); \
__asm __volatile (LLL_EBX_LOAD \
LLL_ENTER_KERNEL \
LLL_EBX_LOAD \
: "=a" (__ignore) \
: "0" (SYS_futex), LLL_EBX_REG (futex), \
"c" (FUTEX_WAKE), "d" (_nr), \
"i" (0) /* phony, to align next arg's number */, \
"i" (offsetof (tcbhead_t, sysinfo))); \
} while (0)
#define lll_mutex_islocked(futex) \
(futex != 0)
@@ -502,6 +448,7 @@ extern int __lll_lock_wait (int val, int *__futex)
__attribute ((regparm (2))) attribute_hidden;
extern int __lll_unlock_wake (int *__futex)
__attribute ((regparm (1))) attribute_hidden;
extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
/* The states of a lock are:
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -19,8 +19,6 @@
#include <unwindbuf.h>
#include <sysdep.h>
#include <kernel-features.h>
#ifndef UP
# define LOCK lock
@@ -28,10 +26,8 @@
# define LOCK
#endif
#define SYS_futex 240
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define FUTEX_PRIVATE_FLAG 128
#define SYS_futex 240
#define FUTEX_WAKE 1
.comm __fork_generation, 4, 4
@@ -94,16 +90,7 @@ __pthread_once:
jnz 3f /* Different for generation -> run initializer. */
/* Somebody else got here first. Wait. */
#ifdef __ASSUME_PRIVATE_FUTEX
movl $FUTEX_WAIT|FUTEX_PRIVATE_FLAG, %ecx
#else
# if FUTEX_WAIT == 0
movl %gs:PRIVATE_FUTEX, %ecx
# else
movl $FUTEX_WAIT, %ecx
orl %gs:PRIVATE_FUTEX, %ecx
# endif
#endif
movl %esi, %ecx /* movl $FUTEX_WAIT, %ecx */
movl $SYS_futex, %eax
ENTER_KERNEL
jmp 6b
@@ -144,12 +131,7 @@ __pthread_once:
/* Wake up all other threads. */
movl $0x7fffffff, %edx
#ifdef __ASSUME_PRIVATE_FUTEX
movl $FUTEX_WAKE|FUTEX_PRIVATE_FLAG, %ecx
#else
movl $FUTEX_WAKE, %ecx
orl %gs:PRIVATE_FUTEX, %ecx
#endif
movl $SYS_futex, %eax
ENTER_KERNEL
@@ -170,12 +152,7 @@ __pthread_once:
movl $0, (%ebx)
movl $0x7fffffff, %edx
#ifdef __ASSUME_PRIVATE_FUTEX
movl $FUTEX_WAKE|FUTEX_PRIVATE_FLAG, %ecx
#else
movl $FUTEX_WAKE, %ecx
orl %gs:PRIVATE_FUTEX, %ecx
#endif
movl $SYS_futex, %eax
ENTER_KERNEL
@@ -1,4 +1,4 @@
/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
@@ -226,6 +226,8 @@ extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *)
/* Type for lock object. */
typedef int lll_lock_t;
extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
/* Initializers for lock. */
#define LLL_LOCK_INITIALIZER (0)
#define LLL_LOCK_INITIALIZER_LOCKED (1)

Some files were not shown because too many files have changed in this diff Show More