summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-06-12 14:47:12 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-06-12 14:47:12 +0000
commit4076561cfa2a537917b2d6a38e337a4217b623a7 (patch)
treedba01f9005854a8a880a4cbe9b7736cfb931fd34
parent0a57a4f8f1e443295267885e3d2048f6bbb0899f (diff)
downloadeglibc2-4076561cfa2a537917b2d6a38e337a4217b623a7.tar.gz
Merge changes between r18907 and r19077 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@19078 7b3dc134-2b1b-0410-93df-9e9f96275f8d
-rw-r--r--libc/ChangeLog145
-rw-r--r--libc/NEWS36
-rw-r--r--libc/iconvdata/ibm930.c5
-rw-r--r--libc/localedata/ChangeLog21
-rw-r--r--libc/localedata/locales/an_ES2
-rw-r--r--libc/localedata/locales/ast_ES1
-rw-r--r--libc/localedata/locales/br_FR2
-rw-r--r--libc/localedata/locales/cy_GB2
-rw-r--r--libc/localedata/locales/de_BE2
-rw-r--r--libc/localedata/locales/de_LU2
-rw-r--r--libc/localedata/locales/el_GR2
-rw-r--r--libc/localedata/locales/en_IE2
-rw-r--r--libc/localedata/locales/eu_ES2
-rw-r--r--libc/localedata/locales/fr_LU2
-rw-r--r--libc/localedata/locales/fy_NL2
-rw-r--r--libc/localedata/locales/ga_IE2
-rw-r--r--libc/localedata/locales/gd_GB2
-rw-r--r--libc/localedata/locales/gl_ES2
-rw-r--r--libc/localedata/locales/gv_GB2
-rw-r--r--libc/localedata/locales/it_IT2
-rw-r--r--libc/localedata/locales/kw_GB2
-rw-r--r--libc/localedata/locales/lij_IT2
-rw-r--r--libc/localedata/locales/lt_LT2
-rw-r--r--libc/localedata/locales/lv_LV2
-rw-r--r--libc/localedata/locales/mt_MT2
-rw-r--r--libc/localedata/locales/nl_BE2
-rw-r--r--libc/localedata/locales/oc_FR2
-rw-r--r--libc/localedata/locales/tr_CY2
-rw-r--r--libc/localedata/locales/tr_TR5
-rw-r--r--libc/localedata/locales/wa_BE4
-rw-r--r--libc/manual/Makefile3
-rw-r--r--libc/manual/argp.texi12
-rw-r--r--libc/manual/contrib.texi2
-rw-r--r--libc/manual/maint.texi81
-rw-r--r--libc/manual/platform.texi28
-rw-r--r--libc/misc/sys/cdefs.h6
-rw-r--r--libc/nptl/ChangeLog15
-rw-r--r--libc/nptl/sysdeps/pthread/pthread.h4
-rw-r--r--libc/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.S2
-rw-r--r--libc/stdlib/longlong.h2
-rw-r--r--libc/sysdeps/i386/fpu/Implies1
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c25
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h10
-rw-r--r--libc/sysdeps/ieee754/ldbl-128ibm/s_erfl.c21
-rw-r--r--libc/sysdeps/powerpc/Makefile5
-rw-r--r--libc/sysdeps/powerpc/powerpc32/Versions3
-rw-r--r--libc/sysdeps/powerpc/powerpc32/mcount.c17
-rw-r--r--libc/sysdeps/powerpc/sys/platform/ppc.h47
-rw-r--r--libc/sysdeps/powerpc/test-gettimebase.c46
-rw-r--r--libc/sysdeps/sh/sh4/fpu/bits/fenv.h14
-rw-r--r--libc/sysdeps/sh/sh4/fpu/fegetenv.c5
-rw-r--r--libc/sysdeps/sh/sh4/fpu/fegetexcept.c3
-rw-r--r--libc/sysdeps/sh/sh4/fpu/fegetround.c2
-rw-r--r--libc/sysdeps/sh/sh4/fpu/fesetround.c6
-rw-r--r--libc/sysdeps/sh/sh4/fpu/fraiseexcpt.c2
-rw-r--r--libc/sysdeps/sh/sh4/fpu/ftestexcept.c3
-rw-r--r--libc/sysdeps/unix/Makefile6
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/sys/debugreg.h90
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/sys/io.h184
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist1
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/nptl/ld.abilist16
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist19
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/nptl/libm.abilist30
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/nptl/librt.abilist7
-rw-r--r--libc/sysdeps/unix/sysv/linux/tst-getcpu.c11
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86/bits/sigcontext.h (renamed from libc/sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h)34
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86/sys/debugreg.h (renamed from libc/sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h)0
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86/sys/io.h (renamed from libc/sysdeps/unix/sysv/linux/x86_64/sys/io.h)2
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86/sys/perm.h (renamed from libc/sysdeps/unix/sysv/linux/x86_64/sys/perm.h)0
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86/sys/reg.h (renamed from libc/sysdeps/unix/sysv/linux/x86_64/sys/reg.h)0
-rw-r--r--libc/sysdeps/x86/bits/string.h (renamed from libc/sysdeps/i386/i486/bits/string.h)326
-rw-r--r--libc/sysdeps/x86/fpu/bits/fenv.h (renamed from libc/sysdeps/i386/fpu/bits/fenv.h)10
-rw-r--r--libc/sysdeps/x86_64/fpu/Implies1
-rw-r--r--libc/sysdeps/x86_64/fpu/bits/fenv.h131
-rw-r--r--ports/ChangeLog.alpha32
-rw-r--r--ports/ChangeLog.powerpc5
-rw-r--r--ports/sysdeps/alpha/_mcount.S3
-rw-r--r--ports/sysdeps/alpha/alphaev6/stxcpy.S33
-rw-r--r--ports/sysdeps/alpha/alphaev6/stxncpy.S68
-rw-r--r--ports/sysdeps/alpha/bzero.S21
-rw-r--r--ports/sysdeps/alpha/fpu/e_sqrt.c3
-rw-r--r--ports/sysdeps/alpha/memset.S25
-rw-r--r--ports/sysdeps/alpha/strncmp.S251
-rw-r--r--ports/sysdeps/alpha/stxcpy.S30
-rw-r--r--ports/sysdeps/alpha/stxncpy.S54
-rw-r--r--ports/sysdeps/unix/alpha/getegid.S (renamed from libc/sysdeps/x86_64/bits/string.h)19
-rw-r--r--ports/sysdeps/unix/alpha/geteuid.S (renamed from libc/sysdeps/unix/sysv/linux/i386/sys/perm.h)25
-rw-r--r--ports/sysdeps/unix/alpha/getppid.S (renamed from libc/sysdeps/unix/sysv/linux/i386/sys/reg.h)32
-rw-r--r--ports/sysdeps/unix/alpha/sysdep.h6
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S31
-rw-r--r--ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist1
91 files changed, 1118 insertions, 1017 deletions
diff --git a/libc/ChangeLog b/libc/ChangeLog
index 49daa0e35..e352549ea 100644
--- a/libc/ChangeLog
+++ b/libc/ChangeLog
@@ -1,3 +1,148 @@
+2012-06-12 Thomas Schwinge <thomas@codesourcery.com>
+
+ * sysdeps/unix/Makefile ($(objpfx)stub-syscalls.c): Fix case for
+ non-default versions.
+
+2012-06-11 Roland McGrath <roland@hack.frob.com>
+
+ [BZ #14218]
+ * manual/argp.texi (Argp): Reword argp_parse description slightly.
+
+2012-06-09 Thomas Schwinge <thomas@codesourcery.com>
+
+ * sysdeps/sh/sh4/fpu/bits/fenv.h (__FE_UNDEFINED): Define.
+ (FE_UPWARD, FE_DOWNWARD): Don't define.
+ * sysdeps/sh/sh4/fpu/fegetround.c (fegetround): Adapt to that.
+ * sysdeps/sh/sh4/fpu/fesetround.c (fesetround): Likewise.
+
+ * sysdeps/sh/sh4/fpu/fegetenv.c (fegetenv): Do not re-write fpscr after
+ reading it.
+ * sysdeps/sh/sh4/fpu/fegetexcept.c (fegetexcept): Likewise.
+ * sysdeps/sh/sh4/fpu/ftestexcept.c (fetestexcept): Likewise.
+
+2012-06-09 Kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+ * sysdeps/unix/sysv/linux/sh/nptl/ld.abilist: New file.
+ * sysdeps/unix/sysv/linux/sh/nptl/libc.abilist: Refreshed.
+ * sysdeps/unix/sysv/linux/sh/nptl/libm.abilist: Refreshed.
+ * sysdeps/unix/sysv/linux/sh/nptl/librt.abilist: Refreshed.
+
+2012-06-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #14117]
+ * sysdeps/i386/fpu/bits/fenv.h: Removed.
+ * sysdeps/i386/fpu/Implies: New file.
+ * sysdeps/x86_64/fpu/Implies: Likewise.
+ * sysdeps/x86_64/fpu/bits/fenv.h: Renamed to ...
+ * sysdeps/x86/fpu/bits/fenv.h: This.
+
+ * sysdeps/x86_64/fpu/bits/fenv.h (feraiseexcept): Check
+ __SSE_MATH__.
+
+2012-06-06 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ [BZ #14134]
+ * iconvdata/ibm930.c (BODY) [FROM_LOOP]: Check for invalid
+ character 0xffff that matches the last element of the
+ conversion table.
+
+2012-06-05 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
+
+ * sysdeps/ieee754/ldbl-128ibm/e_fmodl.c: Fix for wrong ldbl128-ibm
+ fmodl commit.
+
+2012-06-05 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
+
+ * sysdeps/ieee754/ldbl-128ibm/s_erfl.c: Fix spurious underflow for
+ values higher than 25.6283.
+
+2012-06-04 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
+
+ * sysdeps/ieee754/ldbl-128ibm/e_fmodl.c (__ieee754_fmodl): Fix
+ subnormal exponent extraction and add some __builtin_expect.
+ * sysdeps/ieee754/ldbl-128ibm/math_ldbl.h (ldbl_extract_mantissa):
+ Fix for subnormal mantissa calculation.
+
+2012-06-04 Mike Frysinger <vapier@gentoo.org>
+
+ * sysdeps/unix/sysv/linux/tst-getcpu.c (do_test): Call perror when
+ cpu2 is -1 and errno is not ENOSYS.
+
+2012-06-04 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #14117]
+ * sysdeps/i386/i486/bits/string.h: Renamed to ...
+ * sysdeps/x86/bits/string.h: This.
+ * sysdeps/x86_64/bits/string.h: Removed.
+
+ * sysdeps/i386/i486/bits/string.h: Define inline functions only
+ if not compiling for x86-64, but compiling for >= i486.
+
+ * sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h: Renamed to ...
+ * sysdeps/unix/sysv/linux/x86/bits/sigcontext.h: This.
+
+ * sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h (FP_XSTATE_MAGIC1):
+ New macro from Linux kernel 3.4.0.
+ (FP_XSTATE_MAGIC2): Likewise.
+ (FP_XSTATE_MAGIC2_SIZE): Likewise.
+ (X86_FXSR_MAGIC): New macro from Linux i386 kernel.
+ (struct _fpx_sw_bytes): New struct.
+ (struct _xsave_hdr): Likewise.
+ (struct _ymmh_state): Likewise.
+ (struct _xstate): Likewise.
+
+ * sysdeps/unix/sysv/linux/i386/sys/debugreg.h: Removed.
+ * sysdeps/unix/sysv/linux/i386/sys/reg.h: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h: Renamed to ...
+ * sysdeps/unix/sysv/linux/x86/sys/debugreg.h: This.
+ * sysdeps/unix/sysv/linux/x86_64/sys/reg.h: Renamed to ...
+ * sysdeps/unix/sysv/linux/x86/sys/reg.h: This.
+
+ * sysdeps/unix/sysv/linux/i386/sys/io.h: Removed.
+ * sysdeps/unix/sysv/linux/x86_64/sys/io.h: Renamed to ...
+ * sysdeps/unix/sysv/linux/x86/sys/io.h: This.
+ * sysdeps/unix/sysv/linux/i386/sys/perm.h: Removed.
+ * sysdeps/unix/sysv/linux/x86_64/sys/perm.h: Renamed to ...
+ * sysdeps/unix/sysv/linux/x86/sys/perm.h: This.
+
+2012-06-04 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
+
+ [BZ #13743]
+ * sysdeps/powerpc/sys/platform/ppc.h: New file for PowerPC features.
+ * sysdeps/powerpc/Makefile (tests): Add test-gettimebase.
+ (sysdep_headers): Include sys/platform/ppc.h.
+ * sysdeps/powerpc/test-gettimebase.c: Test for
+ __ppc_get_timebase() to catch future ISA opcode/insn changes.
+ * manual/Makefile (appendices): Include platform.texi.
+ * manual/contrib.texi (Contributors): Update @node pointers.
+ * manual/maint.texi (Maintenance): Likewise.
+ (Platform): New node.
+ * manual/platform.texi: New file. Document the new features.
+
+2012-06-04 Siddhesh Poyarekar <siddhesh@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ [BZ #14188]
+ * misc/sys/cdefs.h (__glibc_unlikely): New macro to wrap cases
+ where __builtin_expect is unavailable.
+
+2012-06-03 David S. Miller <davem@davemloft.net>
+
+ * stdlib/longlong.h: Updated from GCC.
+
+2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
+
+ [BZ #14042]
+ * sysdeps/powerpc/powerpc32/mcount.c: New file.
+ * sysdeps/powerpc/powerpc32/Versions (GLIBC_2.16): Add
+ __mcount_internal.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist
+ (GLIBC_2.16): Likewise.
+
+2012-06-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/sys/io.h (outsw): Fix a typo.
+
2012-06-01 Joseph Myers <joseph@codesourcery.com>
* sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile
diff --git a/libc/NEWS b/libc/NEWS
index 2f596ffd2..1cb50ef65 100644
--- a/libc/NEWS
+++ b/libc/NEWS
@@ -16,20 +16,20 @@ Version 2.16
6884, 6890, 6894, 6895, 6907, 6911, 6959, 7064, 9739, 9902, 10110, 10135,
10140, 10153, 10210, 10254, 10346, 10375, 10545, 10716, 10846, 11174,
11322, 11365, 11451, 11494, 11521, 11677, 11837, 11959, 12047, 12097,
- 12193, 12297, 12298, 12301, 12340, 12354, 12416, 12495, 13058, 13361,
- 13525, 13526, 13527, 13528, 13529, 13530, 13531, 13532, 13533, 13547,
- 13551, 13552, 13553, 13555, 13556, 13559, 13563, 13566, 13576, 13583,
- 13592, 13594, 13613, 13618, 13637, 13656, 13658, 13673, 13691, 13695,
- 13704, 13705, 13706, 13726, 13738, 13739, 13750, 13758, 13760, 13761,
- 13775, 13786, 13787, 13792, 13806, 13824, 13840, 13841, 13844, 13846,
- 13851, 13852, 13854, 13871, 13872, 13873, 13879, 13883, 13884, 13885,
- 13886, 13892, 13895, 13908, 13910, 13911, 13912, 13913, 13914, 13915,
- 13916, 13917, 13918, 13919, 13920, 13921, 13922, 13923, 13924, 13926,
- 13927, 13928, 13938, 13941, 13942, 13954, 13955, 13956, 13963, 13967,
- 13968, 13970, 13973, 13979, 13983, 13986, 14012, 14027, 14033, 14034,
- 14036, 14040, 14043, 14044, 14048, 14049, 14053, 14055, 14059, 14064,
- 14075, 14080, 14083, 14103, 14104, 14109, 14112, 14122, 14123, 14153,
- 14183
+ 12193, 12297, 12298, 12301, 12340, 12354, 12416, 12495, 13058, 13223,
+ 13361, 13525, 13526, 13527, 13528, 13529, 13530, 13531, 13532, 13533,
+ 13547, 13551, 13552, 13553, 13555, 13556, 13559, 13563, 13566, 13576,
+ 13583, 13592, 13594, 13613, 13618, 13637, 13656, 13658, 13673, 13691,
+ 13695, 13704, 13705, 13706, 13726, 13738, 13739, 13743, 13750, 13758,
+ 13760, 13761, 13775, 13786, 13787, 13792, 13806, 13824, 13840, 13841,
+ 13844, 13846, 13851, 13852, 13854, 13871, 13872, 13873, 13879, 13883,
+ 13884, 13885, 13886, 13892, 13895, 13908, 13910, 13911, 13912, 13913,
+ 13914, 13915, 13916, 13917, 13918, 13919, 13920, 13921, 13922, 13923,
+ 13924, 13926, 13927, 13928, 13938, 13941, 13942, 13954, 13955, 13956,
+ 13963, 13967, 13968, 13970, 13973, 13979, 13983, 13986, 13996, 14012,
+ 14027, 14033, 14034, 14036, 14040, 14043, 14044, 14048, 14049, 14053,
+ 14055, 14059, 14064, 14075, 14080, 14083, 14103, 14104, 14109, 14112,
+ 14122, 14123, 14134, 14153, 14183, 14188, 14199, 14218
* Support for the x32 ABI on x86-64 added. The x32 target is selected by
configuring glibc with:
@@ -92,7 +92,8 @@ Version 2.16
* Optimized expf for x86-32 and x86-64. Implemented by Liubov Dmitrieva.
-* More optimized functions for PowerPC. Implemented by Adhemerval Zanella.
+* More optimized functions for PowerPC. Implemented by Adhemerval Zanella
+ and Will Schmidt.
* More optimized functions for SPARC. Implemented by David S. Miller.
@@ -110,6 +111,11 @@ Version 2.16
/lib/ld-linux.so.3 dynamic linker used for the base EABI.
* Support for CRIS has been removed from ports.
+
+* A new class of installed header has been documented for low-level
+ platform-specific functionality. PowerPC added the first instance with a
+ function to provide time base register access. Contributed by Tulio
+ Magno Quites Machado Filho.
Version 2.15
diff --git a/libc/iconvdata/ibm930.c b/libc/iconvdata/ibm930.c
index 25a9be02d..587d54f08 100644
--- a/libc/iconvdata/ibm930.c
+++ b/libc/iconvdata/ibm930.c
@@ -1,5 +1,5 @@
/* Conversion from and to IBM930.
- Copyright (C) 2000-2002, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Masahide Washizawa <washi@yamato.ibm.co.jp>, 2000.
@@ -162,7 +162,8 @@ enum
while (ch > rp2->end) \
++rp2; \
\
- if (__builtin_expect (ch < rp2->start, 0) \
+ if (__builtin_expect (rp2->start == 0xffff, 0) \
+ || __builtin_expect (ch < rp2->start, 0) \
|| (res = __ibm930db_to_ucs4[ch + rp2->idx], \
__builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \
{ \
diff --git a/libc/localedata/ChangeLog b/libc/localedata/ChangeLog
index 975e59fff..7af0cb8d7 100644
--- a/libc/localedata/ChangeLog
+++ b/libc/localedata/ChangeLog
@@ -1,3 +1,24 @@
+2012-06-04 Petr Baudis <pasky@ucw.cz>
+
+ [BZ#13996]
+ * locales/tr_TR: Change currency from YTL to TL.
+ Patch by <gokcen@pardus.org.tr>.
+
+2012-06-04 Serkan Kaba <serkan@gentoo.org>
+
+ [BZ#13223]
+ * locales/tr_TR: Fix first_weekday and first_workday.
+
+2012-06-01 Jeff Law <law@redhat.com>
+
+ [BZ#14199]
+ * locales/en_ES: Fix first_weekday and first_workday.
+ * locales/{ast_ES, br_FR, cy_GB, de_DE, de_LU}: Likewise.
+ * locales/{el_GR, en_IE, eu_ES, fr_LU, fy_NL}: Likewise.
+ * locales/{ga_IE, gd_GB, gl_ES, gv_GB, it_IT}: Likewise.
+ * locales/{kw_GB, lij_IT, lt_LT, lv_LV, mt_MT}: Likewise.
+ * locales/{nl_BE, oc_FR, tr_CY, wa_BE}: Likewise.
+
2012-04-20 Chandan Kumar <chandankumar.093047@gmail.com>
[BZ#13968]
diff --git a/libc/localedata/locales/an_ES b/libc/localedata/locales/an_ES
index a9722c5da..2a50c12ef 100644
--- a/libc/localedata/locales/an_ES
+++ b/libc/localedata/locales/an_ES
@@ -103,6 +103,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_workday 2
+first_weekday 2
END LC_TIME
LC_PAPER
diff --git a/libc/localedata/locales/ast_ES b/libc/localedata/locales/ast_ES
index eb048d5bb..2817c1acc 100644
--- a/libc/localedata/locales/ast_ES
+++ b/libc/localedata/locales/ast_ES
@@ -109,6 +109,7 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_workday 2
first_weekday 2
END LC_TIME
diff --git a/libc/localedata/locales/br_FR b/libc/localedata/locales/br_FR
index 3ca47ccd4..3f477fbb0 100644
--- a/libc/localedata/locales/br_FR
+++ b/libc/localedata/locales/br_FR
@@ -141,6 +141,8 @@ d_fmt "<U0025><U0064><U002E><U0025><U006D><U002E><U0025><U0059>"
t_fmt "<U0025><U0054>"
am_pm "<U0020>";"<U0020>"
t_fmt_ampm "<U0025><U0049><U0065><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
+first_workday 2
+first_weekday 2
END LC_TIME
LC_PAPER
diff --git a/libc/localedata/locales/cy_GB b/libc/localedata/locales/cy_GB
index aaffde9f7..3005a63e0 100644
--- a/libc/localedata/locales/cy_GB
+++ b/libc/localedata/locales/cy_GB
@@ -253,6 +253,8 @@ t_fmt_ampm "<U0025><U006C><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U00
date_fmt "<U0025><U0061><U0020><U0025><U0065><U0020><U0025><U0062>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_workday 2
+first_weekday 2
END LC_TIME
LC_MESSAGES
diff --git a/libc/localedata/locales/de_BE b/libc/localedata/locales/de_BE
index 3e7f11d08..f313e544b 100644
--- a/libc/localedata/locales/de_BE
+++ b/libc/localedata/locales/de_BE
@@ -119,6 +119,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_weekday 2
+first_workday 2
END LC_TIME
LC_PAPER
diff --git a/libc/localedata/locales/de_LU b/libc/localedata/locales/de_LU
index 66baf3fb6..f398ddc04 100644
--- a/libc/localedata/locales/de_LU
+++ b/libc/localedata/locales/de_LU
@@ -119,6 +119,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_workday 2
+first_weekday 2
END LC_TIME
LC_PAPER
diff --git a/libc/localedata/locales/el_GR b/libc/localedata/locales/el_GR
index bb1db143f..e4d61d6df 100644
--- a/libc/localedata/locales/el_GR
+++ b/libc/localedata/locales/el_GR
@@ -139,6 +139,8 @@ t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U002
%
% Appropriate date representation (date(1)) "%a %d %b %Y %r %Z"
date_fmt "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U0020><U0025><U0072><U0020><U0025><U005A>"
+first_workday 2
+first_weekday 2
END LC_TIME
LC_PAPER
diff --git a/libc/localedata/locales/en_IE b/libc/localedata/locales/en_IE
index 171e3b16b..5b544754d 100644
--- a/libc/localedata/locales/en_IE
+++ b/libc/localedata/locales/en_IE
@@ -115,6 +115,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_workday 2
+first_weekday 2
END LC_TIME
LC_MESSAGES
diff --git a/libc/localedata/locales/eu_ES b/libc/localedata/locales/eu_ES
index f433aed75..c65f167d1 100644
--- a/libc/localedata/locales/eu_ES
+++ b/libc/localedata/locales/eu_ES
@@ -131,6 +131,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_workday 2
+first_weekday 2
END LC_TIME
LC_PAPER
diff --git a/libc/localedata/locales/fr_LU b/libc/localedata/locales/fr_LU
index 8cb90b361..210027707 100644
--- a/libc/localedata/locales/fr_LU
+++ b/libc/localedata/locales/fr_LU
@@ -120,6 +120,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_workday 2
+first_weekday 2
END LC_TIME
LC_PAPER
diff --git a/libc/localedata/locales/fy_NL b/libc/localedata/locales/fy_NL
index b0cde4b27..0855a5560 100644
--- a/libc/localedata/locales/fy_NL
+++ b/libc/localedata/locales/fy_NL
@@ -92,6 +92,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_workday 2
+first_weekday 2
END LC_TIME
LC_NUMERIC
diff --git a/libc/localedata/locales/ga_IE b/libc/localedata/locales/ga_IE
index a8086a605..aa95d7ecd 100644
--- a/libc/localedata/locales/ga_IE
+++ b/libc/localedata/locales/ga_IE
@@ -117,6 +117,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_workday 2
+first_weekday 2
END LC_TIME
LC_MESSAGES
diff --git a/libc/localedata/locales/gd_GB b/libc/localedata/locales/gd_GB
index a83839c56..4d422840b 100644
--- a/libc/localedata/locales/gd_GB
+++ b/libc/localedata/locales/gd_GB
@@ -122,6 +122,8 @@ d_fmt "<U0025><U0064><U002F><U0025><U006D><U002F><U0025><U0079>"
t_fmt "<U0025><U0054>"
am_pm "";""
t_fmt_ampm ""
+first_workday 2
+first_weekday 2
END LC_TIME
LC_MESSAGES
diff --git a/libc/localedata/locales/gl_ES b/libc/localedata/locales/gl_ES
index 4efe5c182..8414fff3f 100644
--- a/libc/localedata/locales/gl_ES
+++ b/libc/localedata/locales/gl_ES
@@ -121,6 +121,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_workday 2
+first_weekday 2
END LC_TIME
LC_PAPER
diff --git a/libc/localedata/locales/gv_GB b/libc/localedata/locales/gv_GB
index 16efd8d27..f83ddeabb 100644
--- a/libc/localedata/locales/gv_GB
+++ b/libc/localedata/locales/gv_GB
@@ -131,6 +131,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_workday 2
+first_weekday 2
END LC_TIME
LC_MESSAGES
diff --git a/libc/localedata/locales/it_IT b/libc/localedata/locales/it_IT
index 31acd5359..47ee18199 100644
--- a/libc/localedata/locales/it_IT
+++ b/libc/localedata/locales/it_IT
@@ -124,6 +124,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0065><U0020><U0025>/
<U0062><U0020><U0025><U0059><U002C><U0020><U0025><U0048><U002E>/
<U0025><U004D><U002E><U0025><U0053><U002C><U0020><U0025><U005A>"
+first_workday 2
+first_weekday 2
END LC_TIME
LC_PAPER
diff --git a/libc/localedata/locales/kw_GB b/libc/localedata/locales/kw_GB
index 35d7c83b2..f4003a335 100644
--- a/libc/localedata/locales/kw_GB
+++ b/libc/localedata/locales/kw_GB
@@ -123,6 +123,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_workday 2
+first_weekday 2
END LC_TIME
LC_MESSAGES
diff --git a/libc/localedata/locales/lij_IT b/libc/localedata/locales/lij_IT
index 1ee99788b..cac3ae5c3 100644
--- a/libc/localedata/locales/lij_IT
+++ b/libc/localedata/locales/lij_IT
@@ -93,6 +93,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0065><U0020><U0025>/
<U0062><U0020><U0025><U0059><U002C><U0020><U0025><U0048><U002E>/
<U0025><U004D><U002E><U0025><U0053><U002C><U0020><U0025><U005A>"
+first_workday 2
+first_weekday 2
END LC_TIME
LC_PAPER
diff --git a/libc/localedata/locales/lt_LT b/libc/localedata/locales/lt_LT
index b709d83f9..5b529e1c4 100644
--- a/libc/localedata/locales/lt_LT
+++ b/libc/localedata/locales/lt_LT
@@ -2191,6 +2191,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_workday 2
+first_weekday 2
END LC_TIME
LC_MESSAGES
diff --git a/libc/localedata/locales/lv_LV b/libc/localedata/locales/lv_LV
index fdf0f372a..aedce0259 100644
--- a/libc/localedata/locales/lv_LV
+++ b/libc/localedata/locales/lv_LV
@@ -2183,6 +2183,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_workday 2
+first_weekday 2
END LC_TIME
LC_MESSAGES
diff --git a/libc/localedata/locales/mt_MT b/libc/localedata/locales/mt_MT
index d31908e61..e79081a23 100644
--- a/libc/localedata/locales/mt_MT
+++ b/libc/localedata/locales/mt_MT
@@ -234,6 +234,8 @@ t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053>/
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_workday 2
+first_weekday 2
END LC_TIME
diff --git a/libc/localedata/locales/nl_BE b/libc/localedata/locales/nl_BE
index 869eda682..5bb5b18d8 100644
--- a/libc/localedata/locales/nl_BE
+++ b/libc/localedata/locales/nl_BE
@@ -104,6 +104,8 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_workday 2
+first_weekday 2
END LC_TIME
LC_PAPER
diff --git a/libc/localedata/locales/oc_FR b/libc/localedata/locales/oc_FR
index 156f81243..2a7f83643 100644
--- a/libc/localedata/locales/oc_FR
+++ b/libc/localedata/locales/oc_FR
@@ -123,6 +123,8 @@ d_fmt "<U0025><U0064><U002E><U0025><U006D><U002E><U0025><U0059>"
t_fmt "<U0025><U0054>"
am_pm "";""
t_fmt_ampm ""
+first_workday 2
+first_weekday 2
END LC_TIME
LC_NAME
diff --git a/libc/localedata/locales/tr_CY b/libc/localedata/locales/tr_CY
index daeffc1b9..0b90b375b 100644
--- a/libc/localedata/locales/tr_CY
+++ b/libc/localedata/locales/tr_CY
@@ -66,6 +66,8 @@ END LC_NUMERIC
LC_TIME
copy "tr_TR"
+first_workday 2
+first_weekday 2
END LC_TIME
LC_PAPER
diff --git a/libc/localedata/locales/tr_TR b/libc/localedata/locales/tr_TR
index fa44fb058..867e66fc8 100644
--- a/libc/localedata/locales/tr_TR
+++ b/libc/localedata/locales/tr_TR
@@ -3480,7 +3480,8 @@ END LC_MESSAGES
LC_MONETARY
% ISO-4217 (2004-10-25): TRY 949 2
int_curr_symbol "<U0054><U0052><U0059><U0020>"
-currency_symbol "<U0059><U0054><U004C>"
+% TL
+currency_symbol "<U0054><U004C>"
mon_decimal_point "<U002C>"
mon_thousands_sep "<U002E>"
mon_grouping 3;3
@@ -3540,6 +3541,8 @@ t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053>/
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_weekday 2
+first_workday 2
END LC_TIME
LC_PAPER
diff --git a/libc/localedata/locales/wa_BE b/libc/localedata/locales/wa_BE
index f02e527bf..b05142408 100644
--- a/libc/localedata/locales/wa_BE
+++ b/libc/localedata/locales/wa_BE
@@ -162,8 +162,8 @@ d_fmt "<U0025><U0064><U002F><U0025><U006D><U002F><U0025><U0059>"
t_fmt "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
am_pm "<U0041><U004D>";"<U0050><U004D>"
t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-% prumî djoû del samwinne (1=londi)
-first_weekday 1
+first_weekday 2
+first_workday 2
END LC_TIME
LC_NAME
diff --git a/libc/manual/Makefile b/libc/manual/Makefile
index 52c51cf0a..6fddff059 100644
--- a/libc/manual/Makefile
+++ b/libc/manual/Makefile
@@ -45,7 +45,8 @@ chapters = $(addsuffix .texi, \
resource setjmp signal startup process job nss \
users sysinfo conf crypt debug)
add-chapters = $(wildcard $(foreach d, $(add-ons), ../$d/$d.texi))
-appendices = lang.texi header.texi install.texi maint.texi contrib.texi
+appendices = lang.texi header.texi install.texi maint.texi platform.texi \
+ contrib.texi
licenses = freemanuals.texi lgpl-2.1.texi fdl-1.3.texi
-include $(objpfx)texis
diff --git a/libc/manual/argp.texi b/libc/manual/argp.texi
index b37232306..097c5c6a7 100644
--- a/libc/manual/argp.texi
+++ b/libc/manual/argp.texi
@@ -38,13 +38,13 @@ needed in @code{main}.
@deftypefun {error_t} argp_parse (const struct argp *@var{argp}, int @var{argc}, char **@var{argv}, unsigned @var{flags}, int *@var{arg_index}, void *@var{input})
The @code{argp_parse} function parses the arguments in @var{argv}, of
length @var{argc}, using the argp parser @var{argp}. @xref{Argp
-Parsers}.
+Parsers}. Passing a null pointer for @var{argp} is the same as using
+a @code{struct argp} containing all zeros.
-A value of zero is the same as a @code{struct argp}containing all
-zeros. @var{flags} is a set of flag bits that modify the parsing
-behavior. @xref{Argp Flags}. @var{input} is passed through to the argp
-parser @var{argp}, and has meaning defined by @var{argp}. A typical
-usage is to pass a pointer to a structure which is used for specifying
+@var{flags} is a set of flag bits that modify the parsing behavior.
+@xref{Argp Flags}. @var{input} is passed through to the argp parser
+@var{argp}, and has meaning defined by @var{argp}. A typical usage is
+to pass a pointer to a structure which is used for specifying
parameters to the parser and passing back the results.
Unless the @code{ARGP_NO_EXIT} or @code{ARGP_NO_HELP} flags are included
diff --git a/libc/manual/contrib.texi b/libc/manual/contrib.texi
index 4d16f4e6e..00e13ab31 100644
--- a/libc/manual/contrib.texi
+++ b/libc/manual/contrib.texi
@@ -1,4 +1,4 @@
-@node Contributors, Free Manuals, Maintenance, Top
+@node Contributors, Free Manuals, Platform, Top
@c %MENU% Who wrote what parts of the GNU C Library
@appendix Contributors to @theglibc{}
diff --git a/libc/manual/maint.texi b/libc/manual/maint.texi
index e1fdbdbd2..e6fedcfa7 100644
--- a/libc/manual/maint.texi
+++ b/libc/manual/maint.texi
@@ -1,4 +1,4 @@
-@node Maintenance, Contributors, Installation, Top
+@node Maintenance, Platform, Installation, Top
@c %MENU% How to enhance and port the GNU C Library
@appendix Library Maintenance
@@ -104,6 +104,85 @@ This variable is used for secondary object files needed to build
@code{others} or @code{tests}.
@end table
+@menu
+* Platform: Adding Platform-specific. Adding platform-specific
+ features.
+@end menu
+
+@node Adding Platform-specific
+@appendixsubsec Platform-specific types, macros and functions
+
+It's sometimes necessary to provide nonstandard, platform-specific
+features to developers. The C library is traditionally the
+lowest library layer, so it makes sense for it to provide these
+low-level features. However, including these features in the C
+library may be a disadvantage if another package provides them
+as well as there will be two conflicting versions of them. Also,
+the features won't be available to projects that do not use
+@theglibc{} but use other GNU tools, like GCC.
+
+The current guidelines are:
+@itemize @bullet
+@item
+If the header file provides features that only make sense on a particular
+machine architecture and have nothing to do with an operating system, then
+the features should ultimately be provided as GCC built-in functions. Until
+then, @theglibc{} may provide them in the header file. When the GCC built-in
+functions become available, those provided in the header file should be made
+conditionally available prior to the GCC version in which the built-in
+function was made available.
+
+@item
+If the header file provides features that are specific to an operating system,
+both GCC and @theglibc{} could provide it, but @theglibc{} is preferred
+as it already has a lot of information about the operating system.
+
+@item
+If the header file provides features that are specific to an operating system
+but used by @theglibc{}, then @theglibc{} should provide them.
+@end itemize
+
+The general solution for providing low-level features is to export them as
+follows:
+
+@itemize @bullet
+@item
+A nonstandard, low-level header file that defines macros and inline
+functions should be called @file{sys/platform/@var{name}.h}.
+
+@item
+Each header file's name should include the platform name, to avoid
+users thinking there is anything in common between different the
+header files for different platforms. For example, a
+@file{sys/platform/@var{arch}.h} name such as
+@file{sys/platform/ppc.h} is better than @file{sys/platform.h}.
+
+@item
+A platform-specific header file provided by @theglibc{} should coordinate
+with GCC such that compiler built-in versions of the functions and macros are
+preferred if available. This means that user programs will only ever need to
+include @file{sys/platform/@var{arch}.h}, keeping the same names of types,
+macros, and functions for convenience and portability.
+
+@item
+Each included symbol must have the prefix @code{__@var{arch}_}, such as
+@code{__ppc_get_timebase}.
+@end itemize
+
+
+The easiest way to provide a header file is to add it to the
+@code{sysdep_headers} variable. For example, the combination of
+Linux-specific header files on PowerPC could be provided like this:
+
+@smallexample
+sysdep_headers += sys/platform/ppc.h
+@end smallexample
+
+Then ensure that you have added a @file{sys/platform/ppc.h}
+header file in the machine-specific directory, e.g.,
+@file{sysdeps/powerpc/sys/platform/ppc.h}.
+
+
@node Porting
@appendixsec Porting @theglibc{}
diff --git a/libc/manual/platform.texi b/libc/manual/platform.texi
new file mode 100644
index 000000000..02b5c554a
--- /dev/null
+++ b/libc/manual/platform.texi
@@ -0,0 +1,28 @@
+@node Platform, Contributors, Maintenance, Top
+@c %MENU% Describe all platform-specific facilities provided
+@appendix Platform-specific facilities
+
+@Theglibc{} can provide machine-specific functionality.
+
+@menu
+* PowerPC:: Facilities Specific to the PowerPC Architecture
+@end menu
+
+@node PowerPC
+@appendixsec PowerPC-specific Facilities
+
+Facilities specific to PowerPC that are not specific to a particular
+operating system are declared in @file{sys/platform/ppc.h}.
+
+@deftypefun {uint64_t} __ppc_get_timebase (void)
+Read the current value of the Time Base Register.
+
+The @dfn{Time Base Register} is a 64-bit register that stores a monotonically
+incremented value updated at a system-dependent frequency that may be
+different from the processor frequency. More information is available in
+@cite{Power ISA 2.06b - Book II - Section 5.2}.
+
+@code{__ppc_get_timebase} uses the processor's time base facility directly
+without requiring assistance from the operating system, so it is very
+efficient.
+@end deftypefun
diff --git a/libc/misc/sys/cdefs.h b/libc/misc/sys/cdefs.h
index f4e96dbe6..b94147efe 100644
--- a/libc/misc/sys/cdefs.h
+++ b/libc/misc/sys/cdefs.h
@@ -369,6 +369,12 @@
# endif
#endif
+#if __GNUC__ >= 3
+# define __glibc_unlikely(cond) __builtin_expect((cond), 0)
+#else
+# define __glibc_unlikely(cond) (cond)
+#endif
+
#include <bits/wordsize.h>
#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
diff --git a/libc/nptl/ChangeLog b/libc/nptl/ChangeLog
index f96646784..1ff8d978d 100644
--- a/libc/nptl/ChangeLog
+++ b/libc/nptl/ChangeLog
@@ -1,3 +1,18 @@
+2012-06-07 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
+
+ [BZ #14205]
+ * sysdeps/sparc/sparc32/pthread_spin_lock.S: Do not use v9
+ branches.
+
+2012-06-04 Siddhesh Poyarekar <siddhesh@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ [BZ #14188]
+ * sysdeps/pthread/pthread.h
+ [!(defined __GNUC__ && defined __EXCEPTIONS)]
+ (pthread_cleanup_push, pthread_cleanup_push_defer_np): Use
+ __libc_unlikely instead of __builtin_expect.
+
2012-05-30 H.J. Lu <hongjiu.lu@intel.com>
[BZ #14117]
diff --git a/libc/nptl/sysdeps/pthread/pthread.h b/libc/nptl/sysdeps/pthread/pthread.h
index 88c7c257a..246c1a0cd 100644
--- a/libc/nptl/sysdeps/pthread/pthread.h
+++ b/libc/nptl/sysdeps/pthread/pthread.h
@@ -659,7 +659,7 @@ __pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame)
void *__cancel_arg = (arg); \
int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \
__cancel_buf.__cancel_jmp_buf, 0); \
- if (__builtin_expect (__not_first_call, 0)) \
+ if (__glibc_unlikely (__not_first_call)) \
{ \
__cancel_routine (__cancel_arg); \
__pthread_unwind_next (&__cancel_buf); \
@@ -694,7 +694,7 @@ extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
void *__cancel_arg = (arg); \
int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \
__cancel_buf.__cancel_jmp_buf, 0); \
- if (__builtin_expect (__not_first_call, 0)) \
+ if (__glibc_unlikely (__not_first_call)) \
{ \
__cancel_routine (__cancel_arg); \
__pthread_unwind_next (&__cancel_buf); \
diff --git a/libc/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.S b/libc/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.S
index 580796981..315512170 100644
--- a/libc/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.S
+++ b/libc/nptl/sysdeps/sparc/sparc32/pthread_spin_lock.S
@@ -28,5 +28,5 @@ ENTRY(pthread_spin_lock)
2: orcc %g1, 0x0, %g0
bne,a 2b
ldub [%o0], %g1
- ba,a,pt %xcc, 1b
+ ba,a 1b
END(pthread_spin_lock)
diff --git a/libc/stdlib/longlong.h b/libc/stdlib/longlong.h
index ad42907f5..042771839 100644
--- a/libc/stdlib/longlong.h
+++ b/libc/stdlib/longlong.h
@@ -1343,7 +1343,7 @@ UDItype __umulsidi3 (USItype, USItype);
__asm__ ("subcc\t%r5,%6,%1\n\t" \
"sub\t%r3,%4,%0\n\t" \
"movcs\t%%xcc, 1, %2\n\t" \
- "add\t%0, %2, %0" \
+ "sub\t%0, %2, %0" \
: "=r" ((UDItype)(sh)), \
"=&r" ((UDItype)(sl)), \
"+r" (__carry) \
diff --git a/libc/sysdeps/i386/fpu/Implies b/libc/sysdeps/i386/fpu/Implies
new file mode 100644
index 000000000..2b745a34f
--- /dev/null
+++ b/libc/sysdeps/i386/fpu/Implies
@@ -0,0 +1 @@
+x86/fpu
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
index 10cda317a..a60963c84 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
@@ -27,7 +27,7 @@ static const long double one = 1.0, Zero[] = {0.0, -0.0,};
long double
__ieee754_fmodl (long double x, long double y)
{
- int64_t n,hx,hy,hz,ix,iy,sx,i;
+ int64_t n,hx,hy,hz,ix,iy,sx, i;
u_int64_t lx,ly,lz;
int temp;
@@ -38,41 +38,42 @@ __ieee754_fmodl (long double x, long double y)
hy &= 0x7fffffffffffffffLL; /* |y| */
/* purge off exception values */
- if((hy|(ly&0x7fffffffffffffff))==0||(hx>=0x7ff0000000000000LL)|| /* y=0,or x not finite */
- (hy>0x7ff0000000000000LL)) /* or y is NaN */
+ if(__builtin_expect((hy|(ly&0x7fffffffffffffff))==0 ||
+ (hx>=0x7ff0000000000000LL)|| /* y=0,or x not finite */
+ (hy>0x7ff0000000000000LL),0)) /* or y is NaN */
return (x*y)/(x*y);
- if(hx<=hy) {
+ if(__builtin_expect(hx<=hy,0)) {
if((hx<hy)||(lx<ly)) return x; /* |x|<|y| return x */
if(lx==ly)
return Zero[(u_int64_t)sx>>63]; /* |x|=|y| return x*0*/
}
/* determine ix = ilogb(x) */
- if(hx<0x0010000000000000LL) { /* subnormal x */
+ if(__builtin_expect(hx<0x0010000000000000LL,0)) { /* subnormal x */
if(hx==0) {
for (ix = -1043, i=lx; i>0; i<<=1) ix -=1;
} else {
- for (ix = -1022, i=hx<<19; i>0; i<<=1) ix -=1;
+ for (ix = -1022, i=(hx<<11); i>0; i<<=1) ix -=1;
}
} else ix = (hx>>52)-0x3ff;
/* determine iy = ilogb(y) */
- if(hy<0x0010000000000000LL) { /* subnormal y */
+ if(__builtin_expect(hy<0x0010000000000000LL,0)) { /* subnormal y */
if(hy==0) {
for (iy = -1043, i=ly; i>0; i<<=1) iy -=1;
} else {
- for (iy = -1022, i=hy<<19; i>0; i<<=1) iy -=1;
+ for (iy = -1022, i=(hy<<11); i>0; i<<=1) iy -=1;
}
} else iy = (hy>>52)-0x3ff;
/* Make the IBM extended format 105 bit mantissa look like the ieee854 112
- bit mantissa so the following operatations will give the correct
+ bit mantissa so the following operations will give the correct
result. */
ldbl_extract_mantissa(&hx, &lx, &temp, x);
ldbl_extract_mantissa(&hy, &ly, &temp, y);
/* set up {hx,lx}, {hy,ly} and align y to x */
- if(ix >= -1022)
+ if(__builtin_expect(ix >= -1022, 1))
hx = 0x0001000000000000LL|(0x0000ffffffffffffLL&hx);
else { /* subnormal x, shift x to normal */
n = -1022-ix;
@@ -84,7 +85,7 @@ __ieee754_fmodl (long double x, long double y)
lx = 0;
}
}
- if(iy >= -1022)
+ if(__builtin_expect(iy >= -1022, 1))
hy = 0x0001000000000000LL|(0x0000ffffffffffffLL&hy);
else { /* subnormal y, shift y to normal */
n = -1022-iy;
@@ -118,7 +119,7 @@ __ieee754_fmodl (long double x, long double y)
hx = hx+hx+(lx>>63); lx = lx+lx;
iy -= 1;
}
- if(iy>= -1022) { /* normalize output */
+ if(__builtin_expect(iy>= -1022,0)) { /* normalize output */
x = ldbl_insert_mantissa((sx>>63), iy, hx, lx);
} else { /* subnormal output */
n = -1022 - iy;
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h b/libc/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
index d055d6597..be9ac71cb 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
@@ -6,20 +6,20 @@
#include <ieee754.h>
static inline void
-ldbl_extract_mantissa (int64_t *hi64, u_int64_t *lo64, int *exp, long double x)
+ldbl_extract_mantissa (int64_t *hi64, uint64_t *lo64, int *exp, long double x)
{
/* We have 105 bits of mantissa plus one implicit digit. Since
106 bits are representable we use the first implicit digit for
the number before the decimal point and the second implicit bit
as bit 53 of the mantissa. */
- unsigned long long hi, lo;
+ uint64_t hi, lo;
int ediff;
union ibm_extended_long_double eldbl;
eldbl.d = x;
*exp = eldbl.ieee.exponent - IBM_EXTENDED_LONG_DOUBLE_BIAS;
- lo = ((long long)eldbl.ieee.mantissa2 << 32) | eldbl.ieee.mantissa3;
- hi = ((long long)eldbl.ieee.mantissa0 << 32) | eldbl.ieee.mantissa1;
+ lo = ((int64_t)eldbl.ieee.mantissa2 << 32) | eldbl.ieee.mantissa3;
+ hi = ((int64_t)eldbl.ieee.mantissa0 << 32) | eldbl.ieee.mantissa1;
/* If the lower double is not a denomal or zero then set the hidden
53rd bit. */
if (eldbl.ieee.exponent2 > 0x001)
@@ -31,8 +31,8 @@ ldbl_extract_mantissa (int64_t *hi64, u_int64_t *lo64, int *exp, long double x)
ediff = eldbl.ieee.exponent - eldbl.ieee.exponent2;
if (ediff > 53)
lo = lo >> (ediff-53);
+ hi |= (1ULL << 52);
}
- hi |= (1ULL << 52);
if ((eldbl.ieee.negative != eldbl.ieee.negative2)
&& ((eldbl.ieee.exponent2 != 0) && (lo != 0LL)))
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_erfl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_erfl.c
index 1e4992477..05e65af7d 100644
--- a/libc/sysdeps/ieee754/ldbl-128ibm/s_erfl.c
+++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_erfl.c
@@ -72,6 +72,8 @@
* z=1/x^2
* The interval is partitioned into several segments
* of width 1/8 in 1/x.
+ * erf(x) = 1.0 - erfc(x) if x < 25.6283 else
+ * erf(x) = sign(x)*(1.0 - tiny)
*
* Note1:
* To compute exp(-x*x-0.5625+R/S), let s be a single
@@ -85,6 +87,9 @@
* erfc(x) ~ ---------- * ( 1 + Poly(1/x^2) )
* x*sqrt(pi)
*
+ * Note3:
+ * For x higher than 25.6283, erf(x) underflows.
+ *
* 5. For inf > x >= 107
* erf(x) = sign(x) *(1 - tiny) (raise inexact)
* erfc(x) = tiny*tiny (raise underflow) if x > 0
@@ -773,9 +778,19 @@ __erfl (long double x)
if (ix >= 0x3ff00000) /* |x| >= 1.0 */
{
- y = __erfcl (x);
- return (one - y);
- /* return (one - __erfcl (x)); */
+ if (ix >= 0x4039A0DE)
+ {
+ /* __erfcl (x) underflows if x > 25.6283 */
+ if (sign)
+ return one-tiny;
+ else
+ return tiny-one;
+ }
+ else
+ {
+ y = __erfcl (x);
+ return (one - y);
+ }
}
u.parts32.w0 = ix;
a = u.value;
diff --git a/libc/sysdeps/powerpc/Makefile b/libc/sysdeps/powerpc/Makefile
index 23a9a1673..79dd6fa97 100644
--- a/libc/sysdeps/powerpc/Makefile
+++ b/libc/sysdeps/powerpc/Makefile
@@ -26,3 +26,8 @@ gen-as-const-headers += rtld-global-offsets.sym
# get offset to __locale_struct.__ctype_tolower
gen-as-const-headers += locale-defines.sym
endif
+
+ifeq ($(subdir),misc)
+sysdep_headers += sys/platform/ppc.h
+tests += test-gettimebase
+endif
diff --git a/libc/sysdeps/powerpc/powerpc32/Versions b/libc/sysdeps/powerpc/powerpc32/Versions
index ad4972e4d..b0782fecd 100644
--- a/libc/sysdeps/powerpc/powerpc32/Versions
+++ b/libc/sysdeps/powerpc/powerpc32/Versions
@@ -8,6 +8,9 @@ libc {
__fixsfdi; __fixunssfdi;
__floatdidf; __floatdisf;
}
+ GLIBC_2.16 {
+ __mcount_internal;
+ }
GLIBC_PRIVATE {
__mcount_internal;
}
diff --git a/libc/sysdeps/powerpc/powerpc32/mcount.c b/libc/sysdeps/powerpc/powerpc32/mcount.c
new file mode 100644
index 000000000..0476bf61d
--- /dev/null
+++ b/libc/sysdeps/powerpc/powerpc32/mcount.c
@@ -0,0 +1,17 @@
+#include <shlib-compat.h>
+
+#define __mcount_internal ___mcount_internal
+
+#include <gmon/mcount.c>
+
+#undef __mcount_internal
+
+/* __mcount_internal was added in glibc 2.15 with version GLIBC_PRIVATE,
+ but it should have been put in version GLIBC_2.15. Mark the
+ GLIBC_PRIVATE version obsolete and add it to GLIBC_2.16 instead. */
+default_symbol_version (___mcount_internal, __mcount_internal, GLIBC_2.16);
+
+#if SHLIB_COMPAT (libc, GLIBC_2_15, GLIBC_2_16)
+strong_alias (___mcount_internal, ___mcount_internal_private);
+symbol_version (___mcount_internal_private, __mcount_internal, GLIBC_PRIVATE);
+#endif
diff --git a/libc/sysdeps/powerpc/sys/platform/ppc.h b/libc/sysdeps/powerpc/sys/platform/ppc.h
new file mode 100644
index 000000000..165652c7c
--- /dev/null
+++ b/libc/sysdeps/powerpc/sys/platform/ppc.h
@@ -0,0 +1,47 @@
+/* Facilities specific to the PowerPC architecture
+ Copyright (C) 2012 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _SYS_PLATFORM_PPC_H
+#define _SYS_PLATFORM_PPC_H 1
+
+#include <stdint.h>
+
+/* Read the Time Base Register. */
+static inline uint64_t
+__ppc_get_timebase (void)
+{
+#ifdef __powerpc64__
+ uint64_t __tb;
+ /* "volatile" is necessary here, because the user expects this assembly
+ isn't moved after an optimization. */
+ __asm__ volatile ("mfspr %0, 268" : "=r" (__tb));
+ return __tb;
+#else /* not __powerpc64__ */
+ uint32_t __tbu, __tbl, __tmp; \
+ __asm__ volatile ("0:\n\t"
+ "mftbu %0\n\t"
+ "mftbl %1\n\t"
+ "mftbu %2\n\t"
+ "cmpw %0, %2\n\t"
+ "bne- 0b"
+ : "=r" (__tbu), "=r" (__tbl), "=r" (__tmp));
+ return (((uint64_t) __tbu << 32) | __tbl);
+#endif /* not __powerpc64__ */
+}
+
+#endif /* sys/platform/ppc.h */
diff --git a/libc/sysdeps/powerpc/test-gettimebase.c b/libc/sysdeps/powerpc/test-gettimebase.c
new file mode 100644
index 000000000..0e828ff86
--- /dev/null
+++ b/libc/sysdeps/powerpc/test-gettimebase.c
@@ -0,0 +1,46 @@
+/* Check __ppc_get_timebase() for architecture changes
+ Copyright (C) 2012 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, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Test if __ppc_get_timebase() is compatible with the current processor and if
+ it's changing between reads. A read failure might indicate a Power ISA or
+ binutils change. */
+
+#include <inttypes.h>
+#include <stdio.h>
+
+#include <sys/platform/ppc.h>
+
+static int
+do_test (void)
+{
+ uint64_t t1, t2, t3;
+ t1 = __ppc_get_timebase ();
+ printf ("Time Base = %"PRIu64"\n", t1);
+ t2 = __ppc_get_timebase ();
+ printf ("Time Base = %"PRIu64"\n", t2);
+ t3 = __ppc_get_timebase ();
+ printf ("Time Base = %"PRIu64"\n", t3);
+ if (t1 != t2 && t1 != t3 && t2 != t3)
+ return 0;
+
+ printf ("Fail: timebase reads should always be different.");
+ return 1;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/libc/sysdeps/sh/sh4/fpu/bits/fenv.h b/libc/sysdeps/sh/sh4/fpu/bits/fenv.h
index 38c303ff2..93159499d 100644
--- a/libc/sysdeps/sh/sh4/fpu/bits/fenv.h
+++ b/libc/sysdeps/sh/sh4/fpu/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2012 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
@@ -39,19 +39,17 @@ enum
#define FE_ALL_EXCEPT \
(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
-/* The SH FPU supports all of the four defined rounding modes. We
- use again the bit positions in the FPU control word as the values
- for the appropriate macros. */
+/* The SH FPU supports two of the four defined rounding modes: round to nearest
+ and round to zero. We use again the bit positions in the FPU control word
+ as the values for the appropriate macros. */
enum
{
+ __FE_UNDEFINED = -1,
+
FE_TONEAREST = 0x0,
#define FE_TONEAREST FE_TONEAREST
FE_TOWARDZERO = 0x1,
#define FE_TOWARDZERO FE_TOWARDZERO
- FE_UPWARD = 0x2,
-#define FE_UPWARD FE_UPWARD
- FE_DOWNWARD = 0x3
-#define FE_DOWNWARD FE_DOWNWARD
};
diff --git a/libc/sysdeps/sh/sh4/fpu/fegetenv.c b/libc/sysdeps/sh/sh4/fpu/fegetenv.c
index ca7de1628..cb3ca2715 100644
--- a/libc/sysdeps/sh/sh4/fpu/fegetenv.c
+++ b/libc/sysdeps/sh/sh4/fpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment.
- Copyright (C) 1997, 1998, 1999, 2000, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 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
@@ -24,9 +24,6 @@ fegetenv (fenv_t *envp)
{
fpu_control_t temp;
_FPU_GETCW (temp);
- /* When read fpscr, this was initialized.
- We need to rewrite value of temp. */
- _FPU_SETCW (temp);
envp->__fpscr = temp;
diff --git a/libc/sysdeps/sh/sh4/fpu/fegetexcept.c b/libc/sysdeps/sh/sh4/fpu/fegetexcept.c
index a2faaac33..038fe973c 100644
--- a/libc/sysdeps/sh/sh4/fpu/fegetexcept.c
+++ b/libc/sysdeps/sh/sh4/fpu/fegetexcept.c
@@ -27,9 +27,6 @@ fegetexcept (void)
/* Get current exceptions. */
_FPU_GETCW (temp);
- /* When read fpscr, this was initialized.
- We need to rewrite value of temp. */
- _FPU_SETCW (temp);
return (temp >> 5) & FE_ALL_EXCEPT;
}
diff --git a/libc/sysdeps/sh/sh4/fpu/fegetround.c b/libc/sysdeps/sh/sh4/fpu/fegetround.c
index 736838311..adaeb8a85 100644
--- a/libc/sysdeps/sh/sh4/fpu/fegetround.c
+++ b/libc/sysdeps/sh/sh4/fpu/fegetround.c
@@ -28,5 +28,5 @@ fegetround (void)
/* Get control word. */
_FPU_GETCW (cw);
- return cw & 0x3;
+ return cw & 0x1;
}
diff --git a/libc/sysdeps/sh/sh4/fpu/fesetround.c b/libc/sysdeps/sh/sh4/fpu/fesetround.c
index 4edf9c5d8..91c159b40 100644
--- a/libc/sysdeps/sh/sh4/fpu/fesetround.c
+++ b/libc/sysdeps/sh/sh4/fpu/fesetround.c
@@ -1,5 +1,5 @@
/* Set current rounding direction.
- Copyright (C) 1998, 2000, 2005, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998.
@@ -25,7 +25,7 @@ fesetround (int round)
{
fpu_control_t cw;
- if ((round & ~0x3) != 0)
+ if ((round & ~0x1) != 0)
/* ROUND is no valid rounding mode. */
return 1;
@@ -33,7 +33,7 @@ fesetround (int round)
_FPU_GETCW (cw);
/* Set rounding bits. */
- cw &= ~0x3;
+ cw &= ~0x1;
cw |= round;
/* Set new state. */
_FPU_SETCW (cw);
diff --git a/libc/sysdeps/sh/sh4/fpu/fraiseexcpt.c b/libc/sysdeps/sh/sh4/fpu/fraiseexcpt.c
index 729e8bf3e..974f192e1 100644
--- a/libc/sysdeps/sh/sh4/fpu/fraiseexcpt.c
+++ b/libc/sysdeps/sh/sh4/fpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions.
- Copyright (C) 1997, 1998, 2000, 2002, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>, 2012.
diff --git a/libc/sysdeps/sh/sh4/fpu/ftestexcept.c b/libc/sysdeps/sh/sh4/fpu/ftestexcept.c
index c61af4ce0..8f0961148 100644
--- a/libc/sysdeps/sh/sh4/fpu/ftestexcept.c
+++ b/libc/sysdeps/sh/sh4/fpu/ftestexcept.c
@@ -26,9 +26,6 @@ fetestexcept (int excepts)
/* Get current exceptions. */
_FPU_GETCW (temp);
- /* When read fpscr, this was initialized.
- We need to rewrite value of temp. */
- _FPU_SETCW (temp);
return temp & excepts & FE_ALL_EXCEPT;
}
diff --git a/libc/sysdeps/unix/Makefile b/libc/sysdeps/unix/Makefile
index c8ef96d50..9e95b567c 100644
--- a/libc/sysdeps/unix/Makefile
+++ b/libc/sysdeps/unix/Makefile
@@ -51,9 +51,9 @@ $(objpfx)stub-syscalls.c: $(common-objpfx)sysd-syscalls \
echo "strong_alias (_no_syscall, $${call}_$${ver})"; \
echo "default_symbol_version \
($${call}_$${ver}, $$call, $$ver);" ;; \
- *@@*) ver=$${call##*@}; call=$${call%%*@}; \
- echo "strong_alias (_no_syscall, $${call}_$${ver})"; \
- echo "symbol_version ($${call}_$${ver}, $$call, $$ver);" ;; \
+ *@*) ver=$${call##*@}; call=$${call%%*@}; \
+ echo "strong_alias (_no_syscall, $${call}_$${ver})"; \
+ echo "symbol_version ($${call}_$${ver}, $$call, $$ver);" ;; \
*) echo "weak_alias (_no_syscall, $$call)"; \
echo "stub_warning ($$call)"; \
echo "weak_alias (_no_syscall, __GI_$$call)" ;; \
diff --git a/libc/sysdeps/unix/sysv/linux/i386/sys/debugreg.h b/libc/sysdeps/unix/sysv/linux/i386/sys/debugreg.h
deleted file mode 100644
index ac1926b5b..000000000
--- a/libc/sysdeps/unix/sysv/linux/i386/sys/debugreg.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Copyright (C) 1998, 2000 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, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _SYS_DEBUGREG_H
-#define _SYS_DEBUGREG_H 1
-
-/* Indicate the register numbers for a number of the specific
- debug registers. Registers 0-3 contain the addresses we wish to trap on */
-#define DR_FIRSTADDR 0 /* u_debugreg[DR_FIRSTADDR] */
-#define DR_LASTADDR 3 /* u_debugreg[DR_LASTADDR] */
-
-#define DR_STATUS 6 /* u_debugreg[DR_STATUS] */
-#define DR_CONTROL 7 /* u_debugreg[DR_CONTROL] */
-
-/* Define a few things for the status register. We can use this to determine
- which debugging register was responsible for the trap. The other bits
- are either reserved or not of interest to us. */
-
-#define DR_TRAP0 (0x1) /* db0 */
-#define DR_TRAP1 (0x2) /* db1 */
-#define DR_TRAP2 (0x4) /* db2 */
-#define DR_TRAP3 (0x8) /* db3 */
-
-#define DR_STEP (0x4000) /* single-step */
-#define DR_SWITCH (0x8000) /* task switch */
-
-/* Now define a bunch of things for manipulating the control register.
- The top two bytes of the control register consist of 4 fields of 4
- bits - each field corresponds to one of the four debug registers,
- and indicates what types of access we trap on, and how large the data
- field is that we are looking at */
-
-#define DR_CONTROL_SHIFT 16 /* Skip this many bits in ctl register */
-#define DR_CONTROL_SIZE 4 /* 4 control bits per register */
-
-#define DR_RW_EXECUTE (0x0) /* Settings for the access types to trap on */
-#define DR_RW_WRITE (0x1)
-#define DR_RW_READ (0x3)
-
-#define DR_LEN_1 (0x0) /* Settings for data length to trap on */
-#define DR_LEN_2 (0x4)
-#define DR_LEN_4 (0xC)
-
-/* The low byte to the control register determine which registers are
- enabled. There are 4 fields of two bits. One bit is "local", meaning
- that the processor will reset the bit after a task switch and the other
- is global meaning that we have to explicitly reset the bit. With linux,
- you can use either one, since we explicitly zero the register when we enter
- kernel mode. */
-
-#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit */
-#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit */
-#define DR_ENABLE_SIZE 2 /* 2 enable bits per register */
-
-#define DR_LOCAL_ENABLE_MASK (0x55) /* Set local bits for all 4 regs */
-#define DR_GLOBAL_ENABLE_MASK (0xAA) /* Set global bits for all 4 regs */
-
-/* The second byte to the control register has a few special things.
-
- On the i386, you should set the DR_LOCAL_SLOWDOWN or
- DR_GLOBAL_SLOWDOWN bits if you want to know exactly which
- instruction triggered the watchpoint. Setting these bits causes
- the processor to run more slowly, but leaving them clear makes it
- treat watchpoint hits as imprecise exceptions, so you can't
- reliably determine which instruction caused the hit.
-
- The i486 and all later IA-32 processors ignore DR_LOCAL_SLOWDOWN
- and DR_GLOBAL_SLOWDOWN. They always report the exception
- precisely, except in some rare cases, which the user can't do
- anything about. */
-
-#define DR_CONTROL_RESERVED (0xFC00) /* Reserved by Intel */
-#define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */
-#define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */
-
-#endif /* sys/debugreg.h */
diff --git a/libc/sysdeps/unix/sysv/linux/i386/sys/io.h b/libc/sysdeps/unix/sysv/linux/i386/sys/io.h
deleted file mode 100644
index 3ddcee7b4..000000000
--- a/libc/sysdeps/unix/sysv/linux/i386/sys/io.h
+++ /dev/null
@@ -1,184 +0,0 @@
-/* Copyright (C) 1996, 2000, 2009 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- 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, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _SYS_IO_H
-#define _SYS_IO_H 1
-
-#include <features.h>
-
-__BEGIN_DECLS
-
-/* If TURN_ON is TRUE, request for permission to do direct i/o on the
- port numbers in the range [FROM,FROM+NUM-1]. Otherwise, turn I/O
- permission off for that range. This call requires root privileges.
-
- Portability note: not all Linux platforms support this call. Most
- platforms based on the PC I/O architecture probably will, however.
- E.g., Linux/Alpha for Alpha PCs supports this. */
-extern int ioperm (unsigned long int __from, unsigned long int __num,
- int __turn_on) __THROW;
-
-/* Set the I/O privilege level to LEVEL. If LEVEL>3, permission to
- access any I/O port is granted. This call requires root
- privileges. */
-extern int iopl (int __level) __THROW;
-
-#if defined __GNUC__ && __GNUC__ >= 2
-
-static __inline unsigned char
-inb (unsigned short int __port)
-{
- unsigned char _v;
-
- __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (__port));
- return _v;
-}
-
-static __inline unsigned char
-inb_p (unsigned short int __port)
-{
- unsigned char _v;
-
- __asm__ __volatile__ ("inb %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (__port));
- return _v;
-}
-
-static __inline unsigned short int
-inw (unsigned short int __port)
-{
- unsigned short _v;
-
- __asm__ __volatile__ ("inw %w1,%0":"=a" (_v):"Nd" (__port));
- return _v;
-}
-
-static __inline unsigned short int
-inw_p (unsigned short int __port)
-{
- unsigned short int _v;
-
- __asm__ __volatile__ ("inw %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (__port));
- return _v;
-}
-
-static __inline unsigned int
-inl (unsigned short int __port)
-{
- unsigned int _v;
-
- __asm__ __volatile__ ("inl %w1,%0":"=a" (_v):"Nd" (__port));
- return _v;
-}
-
-static __inline unsigned int
-inl_p (unsigned short int __port)
-{
- unsigned int _v;
- __asm__ __volatile__ ("inl %w1,%0\noutb %%al,$0x80":"=a" (_v)
- :"Nd" (__port));
- return _v;
-}
-
-static __inline void
-outb (unsigned char value, unsigned short int __port)
-{
- __asm__ __volatile__ ("outb %b0,%w1": :"a" (value), "Nd" (__port));
-}
-
-static __inline void
-outb_p (unsigned char value, unsigned short int __port)
-{
- __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80": :"a" (value),
- "Nd" (__port));
-}
-
-static __inline void
-outw (unsigned short int value, unsigned short int __port)
-{
- __asm__ __volatile__ ("outw %w0,%w1": :"a" (value), "Nd" (__port));
-
-}
-
-static __inline void
-outw_p (unsigned short int value, unsigned short int __port)
-{
- __asm__ __volatile__ ("outw %w0,%w1\noutb %%al,$0x80": :"a" (value),
- "Nd" (__port));
-}
-
-static __inline void
-outl (unsigned int value, unsigned short int __port)
-{
- __asm__ __volatile__ ("outl %0,%w1": :"a" (value), "Nd" (__port));
-}
-
-static __inline void
-outl_p (unsigned int value, unsigned short int __port)
-{
- __asm__ __volatile__ ("outl %0,%w1\noutb %%al,$0x80": :"a" (value),
- "Nd" (__port));
-}
-
-static __inline void
-insb (unsigned short int __port, void *__addr, unsigned long int __count)
-{
- __asm__ __volatile__ ("cld ; rep ; insb":"=D" (__addr), "=c" (__count)
- :"d" (__port), "0" (__addr), "1" (__count));
-}
-
-static __inline void
-insw (unsigned short int __port, void *__addr, unsigned long int __count)
-{
- __asm__ __volatile__ ("cld ; rep ; insw":"=D" (__addr), "=c" (__count)
- :"d" (__port), "0" (__addr), "1" (__count));
-}
-
-static __inline void
-insl (unsigned short int __port, void *__addr, unsigned long int __count)
-{
- __asm__ __volatile__ ("cld ; rep ; insl":"=D" (__addr), "=c" (__count)
- :"d" (__port), "0" (__addr), "1" (__count));
-}
-
-static __inline void
-outsb (unsigned short int __port, const void *__addr,
- unsigned long int __count)
-{
- __asm__ __volatile__ ("cld ; rep ; outsb":"=S" (__addr), "=c" (__count)
- :"d" (__port), "0" (__addr), "1" (__count));
-}
-
-static __inline void
-outsw (unsigned short int __port, const void *__addr,
- unsigned long int __count)
-{
- __asm__ __volatile__ ("cld ; rep ; outsw":"=S" (__addr), "=c" (__count)
- :"d" (__port), "0" (__addr), "1" (__count));
-}
-
-static __inline void
-outsl (unsigned short int __port, const void *__addr,
- unsigned long int __count)
-{
- __asm__ __volatile__ ("cld ; rep ; outsl":"=S" (__addr), "=c" (__count)
- :"d" (__port), "0" (__addr), "1" (__count));
-}
-
-#endif /* GNU C */
-
-__END_DECLS
-#endif /* _SYS_IO_H */
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist
index bacdb6aab..706d2a9eb 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist
@@ -1762,6 +1762,7 @@ GLIBC_2.15
GLIBC_2.16
GLIBC_2.16 A
__getauxval F
+ __mcount_internal F
__poll_chk F
__ppoll_chk F
aligned_alloc F
diff --git a/libc/sysdeps/unix/sysv/linux/sh/nptl/ld.abilist b/libc/sysdeps/unix/sysv/linux/sh/nptl/ld.abilist
new file mode 100644
index 000000000..ee01179b3
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/sh/nptl/ld.abilist
@@ -0,0 +1,16 @@
+GLIBC_2.2
+ GLIBC_2.2 A
+ __libc_memalign F
+ __libc_stack_end D 0x4
+ _dl_mcount F
+ _r_debug D 0x14
+ calloc F
+ free F
+ malloc F
+ realloc F
+GLIBC_2.3
+ GLIBC_2.3 A
+ __tls_get_addr F
+GLIBC_2.4
+ GLIBC_2.4 A
+ __stack_chk_guard D 0x4
diff --git a/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist
index ae57b67f0..7c1425f89 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist
@@ -11,7 +11,6 @@ GLIBC_2.10
accept4 F
endsgent F
fallocate F
- fallocate64 F
fgetsgent F
fgetsgent_r F
getsgent F
@@ -36,6 +35,7 @@ GLIBC_2.11
GLIBC_2.11 A
__longjmp_chk F
execvpe F
+ fallocate64 F
mkostemps F
mkostemps64 F
mkstemps F
@@ -50,9 +50,7 @@ GLIBC_2.12
sys_nerr D 0x4
GLIBC_2.13
GLIBC_2.13 A
- __fentry__ F
fanotify_init F
- fanotify_mark F
prlimit F
prlimit64 F
GLIBC_2.14
@@ -210,6 +208,7 @@ GLIBC_2.2
_IO_wdefault_xsputn F
_IO_wdo_write F
_IO_wdoallocbuf F
+ _IO_wfile_jumps D 0x54
_IO_wfile_overflow F
_IO_wfile_seekoff F
_IO_wfile_sync F
@@ -265,6 +264,7 @@ GLIBC_2.2
__finitef F
__finitel F
__flbf F
+ __fork F
__fpending F
__fpu_control D 0x4
__fpurge F
@@ -503,7 +503,7 @@ GLIBC_2.2
_longjmp F
_mcleanup F
_mcount F
- _nl_default_dirname D 0x20
+ _nl_default_dirname D 0x12
_nl_domain_bindings D 0x4
_nl_msg_cat_cntr D 0x4
_null_auth D 0xc
@@ -514,6 +514,7 @@ GLIBC_2.2
_obstack_free F
_obstack_memory_used F
_obstack_newchunk F
+ _res D 0x200
_res_hconf D 0x30
_rpc_dtablesize F
_seterr_reply F
@@ -1949,6 +1950,9 @@ GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.2 A
__register_atfork F
+ epoll_create F
+ epoll_ctl F
+ epoll_wait F
lchmod F
pthread_cond_broadcast F
pthread_cond_destroy F
@@ -1959,6 +1963,7 @@ GLIBC_2.3.2
strptime_l F
GLIBC_2.3.3
GLIBC_2.3.3 A
+ _sys_siglist D 0x104
gnu_dev_major F
gnu_dev_makedev F
gnu_dev_minor F
@@ -1970,10 +1975,14 @@ GLIBC_2.3.3
inet6_option_space F
nftw F
nftw64 F
+ posix_fadvise64 F
+ posix_fallocate64 F
remap_file_pages F
sched_getaffinity F
sched_setaffinity F
semtimedop F
+ sys_sigabbrev D 0x104
+ sys_siglist D 0x104
GLIBC_2.3.4
GLIBC_2.3.4 A
__chk_fail F
@@ -2058,6 +2067,7 @@ GLIBC_2.4
__wmemset_chk F
__wprintf_chk F
__xmknodat F
+ _sys_errlist D 0x210
_sys_nerr D 0x4
eaccess F
faccessat F
@@ -2078,6 +2088,7 @@ GLIBC_2.4
readlinkat F
renameat F
symlinkat F
+ sys_errlist D 0x210
sys_nerr D 0x4
unlinkat F
unshare F
diff --git a/libc/sysdeps/unix/sysv/linux/sh/nptl/libm.abilist b/libc/sysdeps/unix/sysv/linux/sh/nptl/libm.abilist
index 911153b11..d85192910 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/nptl/libm.abilist
+++ b/libc/sysdeps/unix/sysv/linux/sh/nptl/libm.abilist
@@ -4,83 +4,56 @@ GLIBC_2.15
__acosf_finite F
__acosh_finite F
__acoshf_finite F
- __acoshl_finite F
- __acosl_finite F
__asin_finite F
__asinf_finite F
- __asinl_finite F
__atan2_finite F
__atan2f_finite F
- __atan2l_finite F
__atanh_finite F
__atanhf_finite F
- __atanhl_finite F
__cosh_finite F
__coshf_finite F
- __coshl_finite F
__exp10_finite F
__exp10f_finite F
- __exp10l_finite F
__exp2_finite F
__exp2f_finite F
- __exp2l_finite F
__exp_finite F
__expf_finite F
- __expl_finite F
__fmod_finite F
__fmodf_finite F
- __fmodl_finite F
__gamma_r_finite F
__gammaf_r_finite F
- __gammal_r_finite F
__hypot_finite F
__hypotf_finite F
- __hypotl_finite F
__j0_finite F
__j0f_finite F
- __j0l_finite F
__j1_finite F
__j1f_finite F
- __j1l_finite F
__jn_finite F
__jnf_finite F
- __jnl_finite F
__lgamma_r_finite F
__lgammaf_r_finite F
- __lgammal_r_finite F
__log10_finite F
__log10f_finite F
- __log10l_finite F
__log2_finite F
__log2f_finite F
- __log2l_finite F
__log_finite F
__logf_finite F
- __logl_finite F
__pow_finite F
__powf_finite F
- __powl_finite F
__remainder_finite F
__remainderf_finite F
- __remainderl_finite F
__scalb_finite F
__scalbf_finite F
- __scalbl_finite F
__sinh_finite F
__sinhf_finite F
- __sinhl_finite F
__sqrt_finite F
__sqrtf_finite F
- __sqrtl_finite F
__y0_finite F
__y0f_finite F
- __y0l_finite F
__y1_finite F
__y1f_finite F
- __y1l_finite F
__yn_finite F
__ynf_finite F
- __ynl_finite F
GLIBC_2.2
GLIBC_2.2 A
_LIB_VERSION D 0x4
@@ -394,3 +367,6 @@ GLIBC_2.2
yn F
ynf F
ynl F
+GLIBC_2.4
+ GLIBC_2.4 A
+ exp2l F
diff --git a/libc/sysdeps/unix/sysv/linux/sh/nptl/librt.abilist b/libc/sysdeps/unix/sysv/linux/sh/nptl/librt.abilist
index 371d135c8..af7df27cb 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/nptl/librt.abilist
+++ b/libc/sysdeps/unix/sysv/linux/sh/nptl/librt.abilist
@@ -31,13 +31,6 @@ GLIBC_2.2
timer_getoverrun F
timer_gettime F
timer_settime F
-GLIBC_2.3.3
- GLIBC_2.3.3 A
- timer_create F
- timer_delete F
- timer_getoverrun F
- timer_gettime F
- timer_settime F
GLIBC_2.3.4
GLIBC_2.3.4 A
mq_close F
diff --git a/libc/sysdeps/unix/sysv/linux/tst-getcpu.c b/libc/sysdeps/unix/sysv/linux/tst-getcpu.c
index bf3cb57dd..77baebc0a 100644
--- a/libc/sysdeps/unix/sysv/linux/tst-getcpu.c
+++ b/libc/sysdeps/unix/sysv/linux/tst-getcpu.c
@@ -31,10 +31,15 @@ do_test (void)
else
{
int cpu2 = sched_getcpu ();
- if (cpu2 == -1 && errno == ENOSYS)
+ if (cpu2 == -1)
{
- puts ("getcpu syscall not implemented");
- return 0;
+ if (errno == ENOSYS)
+ {
+ puts ("getcpu syscall not implemented");
+ return 0;
+ }
+ perror ("getcpu failed");
+ result = 1;
}
if (cpu2 != cpu)
{
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h b/libc/sysdeps/unix/sysv/linux/x86/bits/sigcontext.h
index d9ba716bc..06f36cba4 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h
+++ b/libc/sysdeps/unix/sysv/linux/x86/bits/sigcontext.h
@@ -22,6 +22,19 @@
# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
#endif
+#define FP_XSTATE_MAGIC1 0x46505853U
+#define FP_XSTATE_MAGIC2 0x46505845U
+#define FP_XSTATE_MAGIC2_SIZE sizeof(FP_XSTATE_MAGIC2)
+
+struct _fpx_sw_bytes
+{
+ __uint32_t magic1;
+ __uint32_t extended_size;
+ __uint64_t xstate_bv;
+ __uint32_t xstate_size;
+ __uint32_t padding[7];
+};
+
struct _fpreg
{
unsigned short significand[4];
@@ -75,6 +88,8 @@ struct _fpstate
# define sigcontext_struct sigcontext
#endif
+#define X86_FXSR_MAGIC 0x0000
+
struct sigcontext
{
unsigned short gs, __gsh;
@@ -157,4 +172,23 @@ struct sigcontext
#endif /* __x86_64__ */
+struct _xsave_hdr
+{
+ __uint64_t xstate_bv;
+ __uint64_t reserved1[2];
+ __uint64_t reserved2[5];
+};
+
+struct _ymmh_state
+{
+ __uint32_t ymmh_space[64];
+};
+
+struct _xstate
+{
+ struct _fpstate fpstate;
+ struct _xsave_hdr xstate_hdr;
+ struct _ymmh_state ymmh;
+};
+
#endif /* _BITS_SIGCONTEXT_H */
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h b/libc/sysdeps/unix/sysv/linux/x86/sys/debugreg.h
index de10277e2..de10277e2 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h
+++ b/libc/sysdeps/unix/sysv/linux/x86/sys/debugreg.h
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sys/io.h b/libc/sysdeps/unix/sysv/linux/x86/sys/io.h
index 534b6d3a0..ce9fd948b 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sys/io.h
+++ b/libc/sysdeps/unix/sysv/linux/x86/sys/io.h
@@ -165,7 +165,7 @@ static __inline void
outsw (unsigned short int __port, const void *__addr,
unsigned long int __count)
{
- __asm__ __volatile__ ("cld ; rep ; outsw":"=S" (____addr), "=c" (__count)
+ __asm__ __volatile__ ("cld ; rep ; outsw":"=S" (__addr), "=c" (__count)
:"d" (__port), "0" (__addr), "1" (__count));
}
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sys/perm.h b/libc/sysdeps/unix/sysv/linux/x86/sys/perm.h
index cbfeaf825..cbfeaf825 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sys/perm.h
+++ b/libc/sysdeps/unix/sysv/linux/x86/sys/perm.h
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sys/reg.h b/libc/sysdeps/unix/sysv/linux/x86/sys/reg.h
index 9a23ee0e4..9a23ee0e4 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sys/reg.h
+++ b/libc/sysdeps/unix/sysv/linux/x86/sys/reg.h
diff --git a/libc/sysdeps/i386/i486/bits/string.h b/libc/sysdeps/x86/bits/string.h
index a5edf5190..147930296 100644
--- a/libc/sysdeps/i386/i486/bits/string.h
+++ b/libc/sysdeps/x86/bits/string.h
@@ -1,6 +1,5 @@
-/* Optimized, inlined string functions. i486 version.
- Copyright (C) 1997,1998,1999,2000,2001,2002,2003,2004,2007,2011,2012
- Free Software Foundation, Inc.
+/* Optimized, inlined string functions. i486/x86-64 version.
+ Copyright (C) 2001-2012 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
@@ -24,25 +23,34 @@
/* The ix86 processors can access unaligned multi-byte variables. */
#define _STRING_ARCH_unaligned 1
+/* Enable inline functions only for i486 or better when compiling for
+ ia32. */
+#if !defined __x86_64__ && (defined __i486__ || defined __pentium__ \
+ || defined __pentiumpro__ || defined __pentium4__ \
+ || defined __nocona__ || defined __atom__ \
+ || defined __core2__ || defined __corei7__ \
+ || defined __k6__ || defined __geode__ \
+ || defined __k8__ || defined __athlon__ \
+ || defined __amdfam10__)
/* We only provide optimizations if the user selects them and if
GNU CC is used. */
-#if !defined __NO_STRING_INLINES && defined __USE_STRING_INLINES \
+# if !defined __NO_STRING_INLINES && defined __USE_STRING_INLINES \
&& defined __GNUC__ && __GNUC__ >= 2 && !__BOUNDED_POINTERS__
-#ifndef __STRING_INLINE
-# ifndef __extern_inline
-# define __STRING_INLINE inline
-# else
-# define __STRING_INLINE __extern_inline
+# ifndef __STRING_INLINE
+# ifndef __extern_inline
+# define __STRING_INLINE inline
+# else
+# define __STRING_INLINE __extern_inline
+# endif
# endif
-#endif
/* The macros are used in some of the optimized implementations below. */
-#define __STRING_SMALL_GET16(src, idx) \
+# define __STRING_SMALL_GET16(src, idx) \
((((const unsigned char *) (src))[idx + 1] << 8) \
| ((const unsigned char *) (src))[idx])
-#define __STRING_SMALL_GET32(src, idx) \
+# define __STRING_SMALL_GET32(src, idx) \
(((((const unsigned char *) (src))[idx + 3] << 8 \
| ((const unsigned char *) (src))[idx + 2]) << 8 \
| ((const unsigned char *) (src))[idx + 1]) << 8 \
@@ -50,12 +58,12 @@
/* Copy N bytes of SRC to DEST. */
-#define _HAVE_STRING_ARCH_memcpy 1
-#define memcpy(dest, src, n) \
+# define _HAVE_STRING_ARCH_memcpy 1
+# define memcpy(dest, src, n) \
(__extension__ (__builtin_constant_p (n) \
? __memcpy_c ((dest), (src), (n)) \
: __memcpy_g ((dest), (src), (n))))
-#define __memcpy_c(dest, src, n) \
+# define __memcpy_c(dest, src, n) \
((n) == 0 \
? (dest) \
: (((n) % 4 == 0) \
@@ -139,11 +147,11 @@ __memcpy_g (void *__dest, const void *__src, size_t __n)
return __dest;
}
-#define _HAVE_STRING_ARCH_memmove 1
-#ifndef _FORCE_INLINES
+# define _HAVE_STRING_ARCH_memmove 1
+# ifndef _FORCE_INLINES
/* Copy N bytes of SRC to DEST, guaranteeing
correct behavior for overlapping strings. */
-#define memmove(dest, src, n) __memmove_g (dest, src, n)
+# define memmove(dest, src, n) __memmove_g (dest, src, n)
__STRING_INLINE void *__memmove_g (void *, const void *, size_t)
__asm__ ("memmove");
@@ -173,12 +181,12 @@ __memmove_g (void *__dest, const void *__src, size_t __n)
"m" ( *(struct { __extension__ char __x[__n]; } *)__src));
return __dest;
}
-#endif
+# endif
/* Compare N bytes of S1 and S2. */
-#define _HAVE_STRING_ARCH_memcmp 1
-#ifndef _FORCE_INLINES
-# ifndef __PIC__
+# define _HAVE_STRING_ARCH_memcmp 1
+# ifndef _FORCE_INLINES
+# ifndef __PIC__
/* gcc has problems to spill registers when using PIC. */
__STRING_INLINE int
memcmp (const void *__s1, const void *__s2, size_t __n)
@@ -200,13 +208,13 @@ memcmp (const void *__s1, const void *__s2, size_t __n)
: "cc");
return __res;
}
+# endif
# endif
-#endif
/* Set N bytes of S to C. */
-#define _HAVE_STRING_ARCH_memset 1
-#define _USE_STRING_ARCH_memset 1
-#define memset(s, c, n) \
+# define _HAVE_STRING_ARCH_memset 1
+# define _USE_STRING_ARCH_memset 1
+# define memset(s, c, n) \
(__extension__ (__builtin_constant_p (n) && (n) <= 16 \
? ((n) == 1 \
? __memset_c1 ((s), (c)) \
@@ -219,11 +227,11 @@ memcmp (const void *__s1, const void *__s2, size_t __n)
? __memset_gcn ((s), (c), (n)) \
: memset ((s), (c), (n))))))
-#define __memset_c1(s, c) ({ void *__s = (s); \
- *((unsigned char *) __s) = (unsigned char) (c); \
- __s; })
+# define __memset_c1(s, c) ({ void *__s = (s); \
+ *((unsigned char *) __s) = (unsigned char) (c); \
+ __s; })
-#define __memset_gc(s, c, n) \
+# define __memset_gc(s, c, n) \
({ void *__s = (s); \
union { \
unsigned int __ui; \
@@ -300,7 +308,7 @@ memcmp (const void *__s1, const void *__s2, size_t __n)
\
__s; })
-#define __memset_ccn(s, c, n) \
+# define __memset_ccn(s, c, n) \
(((n) % 4 == 0) \
? __memset_ccn_by4 (s, ((unsigned int) ((unsigned char) (c))) * 0x01010101,\
n) \
@@ -318,7 +326,7 @@ __memset_ccn_by4 (void *__s, unsigned int __c, size_t __n)
{
register void *__tmp = __s;
register unsigned long int __d0;
-#ifdef __i686__
+# ifdef __i686__
__asm__ __volatile__
("cld\n\t"
"rep; stosl"
@@ -326,7 +334,7 @@ __memset_ccn_by4 (void *__s, unsigned int __c, size_t __n)
"=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
: "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
: "cc");
-#else
+# else
__asm__ __volatile__
("1:\n\t"
"movl %0,(%1)\n\t"
@@ -337,7 +345,7 @@ __memset_ccn_by4 (void *__s, unsigned int __c, size_t __n)
"=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
: "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
: "cc");
-#endif
+# endif
return __s;
}
@@ -349,7 +357,7 @@ __memset_ccn_by2 (void *__s, unsigned int __c, size_t __n)
{
register unsigned long int __d0, __d1;
register void *__tmp = __s;
-#ifdef __i686__
+# ifdef __i686__
__asm__ __volatile__
("cld\n\t"
"rep; stosl\n"
@@ -358,7 +366,7 @@ __memset_ccn_by2 (void *__s, unsigned int __c, size_t __n)
"=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
: "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
: "cc");
-#else
+# else
__asm__ __volatile__
("1:\tmovl %0,(%1)\n\t"
"leal 4(%1),%1\n\t"
@@ -373,7 +381,7 @@ __memset_ccn_by2 (void *__s, unsigned int __c, size_t __n)
return __s;
}
-#define __memset_gcn(s, c, n) \
+# define __memset_gcn(s, c, n) \
(((n) % 4 == 0) \
? __memset_gcn_by4 (s, c, n) \
: (((n) % 2 == 0) \
@@ -431,19 +439,19 @@ __memset_gcn_by2 (void *__s, int __c, size_t __n)
/* Search N bytes of S for C. */
-#define _HAVE_STRING_ARCH_memchr 1
-#ifndef _FORCE_INLINES
+# define _HAVE_STRING_ARCH_memchr 1
+# ifndef _FORCE_INLINES
__STRING_INLINE void *
memchr (const void *__s, int __c, size_t __n)
{
register unsigned long int __d0;
-#ifdef __i686__
+# ifdef __i686__
register unsigned long int __d1;
-#endif
+# endif
register unsigned char *__res;
if (__n == 0)
return NULL;
-#ifdef __i686__
+# ifdef __i686__
__asm__ __volatile__
("cld\n\t"
"repne; scasb\n\t"
@@ -452,7 +460,7 @@ memchr (const void *__s, int __c, size_t __n)
: "a" (__c), "0" (__s), "1" (__n), "2" (1),
"m" ( *(struct { __extension__ char __x[__n]; } *)__s)
: "cc");
-#else
+# else
__asm__ __volatile__
("cld\n\t"
"repne; scasb\n\t"
@@ -463,26 +471,26 @@ memchr (const void *__s, int __c, size_t __n)
: "a" (__c), "0" (__s), "1" (__n),
"m" ( *(struct { __extension__ char __x[__n]; } *)__s)
: "cc");
-#endif
+# endif
return __res - 1;
}
-#endif
+# endif
-#define _HAVE_STRING_ARCH_memrchr 1
-#ifndef _FORCE_INLINES
+# define _HAVE_STRING_ARCH_memrchr 1
+# ifndef _FORCE_INLINES
__STRING_INLINE void *__memrchr (const void *__s, int __c, size_t __n);
__STRING_INLINE void *
__memrchr (const void *__s, int __c, size_t __n)
{
register unsigned long int __d0;
-# ifdef __i686__
+# ifdef __i686__
register unsigned long int __d1;
-# endif
+# endif
register void *__res;
if (__n == 0)
return NULL;
-# ifdef __i686__
+# ifdef __i686__
__asm__ __volatile__
("std\n\t"
"repne; scasb\n\t"
@@ -493,7 +501,7 @@ __memrchr (const void *__s, int __c, size_t __n)
: "a" (__c), "0" (__s + __n - 1), "1" (__n), "2" (-1),
"m" ( *(struct { __extension__ char __x[__n]; } *)__s)
: "cc");
-# else
+# else
__asm__ __volatile__
("std\n\t"
"repne; scasb\n\t"
@@ -505,19 +513,19 @@ __memrchr (const void *__s, int __c, size_t __n)
: "a" (__c), "0" (__s + __n - 1), "1" (__n),
"m" ( *(struct { __extension__ char __x[__n]; } *)__s)
: "cc");
-# endif
+# endif
return __res;
}
-# ifdef __USE_GNU
-# define memrchr(s, c, n) __memrchr ((s), (c), (n))
+# ifdef __USE_GNU
+# define memrchr(s, c, n) __memrchr ((s), (c), (n))
+# endif
# endif
-#endif
/* Return pointer to C in S. */
-#define _HAVE_STRING_ARCH_rawmemchr 1
+# define _HAVE_STRING_ARCH_rawmemchr 1
__STRING_INLINE void *__rawmemchr (const void *__s, int __c);
-#ifndef _FORCE_INLINES
+# ifndef _FORCE_INLINES
__STRING_INLINE void *
__rawmemchr (const void *__s, int __c)
{
@@ -532,19 +540,19 @@ __rawmemchr (const void *__s, int __c)
: "cc");
return __res - 1;
}
-# ifdef __USE_GNU
+# ifdef __USE_GNU
__STRING_INLINE void *
rawmemchr (const void *__s, int __c)
{
return __rawmemchr (__s, __c);
}
-# endif /* use GNU */
-#endif
+# endif /* use GNU */
+# endif
/* Return the length of S. */
-#define _HAVE_STRING_ARCH_strlen 1
-#define strlen(str) \
+# define _HAVE_STRING_ARCH_strlen 1
+# define strlen(str) \
(__extension__ (__builtin_constant_p (str) \
? __builtin_strlen (str) \
: __strlen_g (str)))
@@ -570,8 +578,8 @@ __strlen_g (const char *__str)
/* Copy SRC to DEST. */
-#define _HAVE_STRING_ARCH_strcpy 1
-#define strcpy(dest, src) \
+# define _HAVE_STRING_ARCH_strcpy 1
+# define strcpy(dest, src) \
(__extension__ (__builtin_constant_p (src) \
? (sizeof ((src)[0]) == 1 && strlen (src) + 1 <= 8 \
? __strcpy_a_small ((dest), (src), strlen (src) + 1) \
@@ -580,7 +588,7 @@ __strlen_g (const char *__str)
strlen (src) + 1)) \
: __strcpy_g ((dest), (src))))
-#define __strcpy_a_small(dest, src, srclen) \
+# define __strcpy_a_small(dest, src, srclen) \
(__extension__ ({ char *__dest = (dest); \
union { \
unsigned int __ui; \
@@ -654,16 +662,16 @@ __strcpy_g (char *__dest, const char *__src)
}
-#ifdef __USE_GNU
-# define _HAVE_STRING_ARCH_stpcpy 1
+# ifdef __USE_GNU
+# define _HAVE_STRING_ARCH_stpcpy 1
/* Copy SRC to DEST. */
-# define __stpcpy(dest, src) \
+# define __stpcpy(dest, src) \
(__extension__ (__builtin_constant_p (src) \
? (strlen (src) + 1 <= 8 \
? __stpcpy_a_small ((dest), (src), strlen (src) + 1) \
: __stpcpy_c ((dest), (src), strlen (src) + 1)) \
: __stpcpy_g ((dest), (src))))
-# define __stpcpy_c(dest, src, srclen) \
+# define __stpcpy_c(dest, src, srclen) \
((srclen) % 4 == 0 \
? __mempcpy_by4 (dest, src, srclen) - 1 \
: ((srclen) % 2 == 0 \
@@ -671,9 +679,9 @@ __strcpy_g (char *__dest, const char *__src)
: __mempcpy_byn (dest, src, srclen) - 1))
/* In glibc itself we use this symbol for namespace reasons. */
-# define stpcpy(dest, src) __stpcpy ((dest), (src))
+# define stpcpy(dest, src) __stpcpy ((dest), (src))
-# define __stpcpy_a_small(dest, src, srclen) \
+# define __stpcpy_a_small(dest, src, srclen) \
(__extension__ ({ union { \
unsigned int __ui; \
unsigned short int __usi; \
@@ -826,19 +834,19 @@ __stpcpy_g (char *__dest, const char *__src)
: "cc");
return __tmp - 1;
}
-#endif
+# endif
/* Copy no more than N characters of SRC to DEST. */
-#define _HAVE_STRING_ARCH_strncpy 1
-#define strncpy(dest, src, n) \
+# define _HAVE_STRING_ARCH_strncpy 1
+# define strncpy(dest, src, n) \
(__extension__ (__builtin_constant_p (src) \
? ((strlen (src) + 1 >= ((size_t) (n)) \
? (char *) memcpy ((char *) (dest), \
(const char *) (src), n) \
: __strncpy_cg ((dest), (src), strlen (src) + 1, n))) \
: __strncpy_gg ((dest), (src), n)))
-#define __strncpy_cg(dest, src, srclen, n) \
+# define __strncpy_cg(dest, src, srclen, n) \
(((srclen) % 4 == 0) \
? __strncpy_by4 (dest, src, srclen, n) \
: (((srclen) % 2 == 0) \
@@ -962,8 +970,8 @@ __strncpy_gg (char *__dest, const char *__src, size_t __n)
/* Append SRC onto DEST. */
-#define _HAVE_STRING_ARCH_strcat 1
-#define strcat(dest, src) \
+# define _HAVE_STRING_ARCH_strcat 1
+# define strcat(dest, src) \
(__extension__ (__builtin_constant_p (src) \
? __strcat_c ((dest), (src), strlen (src) + 1) \
: __strcat_g ((dest), (src))))
@@ -974,7 +982,7 @@ __STRING_INLINE char *__strcat_c (char *__dest, const char __src[],
__STRING_INLINE char *
__strcat_c (char *__dest, const char __src[], size_t __srclen)
{
-#ifdef __i686__
+# ifdef __i686__
register unsigned long int __d0;
register char *__tmp;
__asm__ __volatile__
@@ -985,7 +993,7 @@ __strcat_c (char *__dest, const char __src[], size_t __srclen)
"m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
: "cc");
--__tmp;
-#else
+# else
register char *__tmp = __dest - 1;
__asm__ __volatile__
("1:\n\t"
@@ -997,7 +1005,7 @@ __strcat_c (char *__dest, const char __src[], size_t __srclen)
: "0" (__tmp),
"m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
: "cc");
-#endif
+# endif
(void) memcpy (__tmp, __src, __srclen);
return __dest;
}
@@ -1031,8 +1039,8 @@ __strcat_g (char *__dest, const char *__src)
/* Append no more than N characters from SRC onto DEST. */
-#define _HAVE_STRING_ARCH_strncat 1
-#define strncat(dest, src, n) \
+# define _HAVE_STRING_ARCH_strncat 1
+# define strncat(dest, src, n) \
(__extension__ ({ char *__dest = (dest); \
__builtin_constant_p (src) && __builtin_constant_p (n) \
? (strlen (src) < ((size_t) (n)) \
@@ -1050,7 +1058,7 @@ __strncat_g (char *__dest, const char __src[], size_t __n)
{
register char *__tmp = __dest;
register char __dummy;
-#ifdef __i686__
+# ifdef __i686__
__asm__ __volatile__
("repne; scasb\n"
"movl %4, %3\n\t"
@@ -1068,7 +1076,7 @@ __strncat_g (char *__dest, const char __src[], size_t __n)
: "=&a" (__dummy), "=&D" (__tmp), "=&S" (__src), "=&c" (__n)
: "g" (__n), "0" (0), "1" (__tmp), "2" (__src), "3" (0xffffffff)
: "memory", "cc");
-#else
+# else
--__tmp;
__asm__ __volatile__
("1:\n\t"
@@ -1096,8 +1104,8 @@ __strncat_g (char *__dest, const char __src[], size_t __n)
/* Compare S1 and S2. */
-#define _HAVE_STRING_ARCH_strcmp 1
-#define strcmp(s1, s2) \
+# define _HAVE_STRING_ARCH_strcmp 1
+# define strcmp(s1, s2) \
(__extension__ (__builtin_constant_p (s1) && __builtin_constant_p (s2) \
&& (sizeof ((s1)[0]) != 1 || strlen (s1) >= 4) \
&& (sizeof ((s2)[0]) != 1 || strlen (s2) >= 4) \
@@ -1124,7 +1132,7 @@ __strncat_g (char *__dest, const char __src[], size_t __n)
strlen (s2))) \
: __strcmp_gg ((s1), (s2))))))
-#define __strcmp_cc(s1, s2, l) \
+# define __strcmp_cc(s1, s2, l) \
(__extension__ ({ register int __result = (s1)[0] - (s2)[0]; \
if (l > 0 && __result == 0) \
{ \
@@ -1138,7 +1146,7 @@ __strncat_g (char *__dest, const char __src[], size_t __n)
} \
__result; }))
-#define __strcmp_cg(s1, s2, l1) \
+# define __strcmp_cg(s1, s2, l1) \
(__extension__ ({ const unsigned char *__s2 = (s2); \
register int __result = (s1)[0] - __s2[0]; \
if (l1 > 0 && __result == 0) \
@@ -1153,7 +1161,7 @@ __strncat_g (char *__dest, const char __src[], size_t __n)
} \
__result; }))
-#define __strcmp_gc(s1, s2, l2) \
+# define __strcmp_gc(s1, s2, l2) \
(__extension__ ({ const unsigned char *__s1 = (s1); \
register int __result = __s1[0] - (s2)[0]; \
if (l2 > 0 && __result == 0) \
@@ -1200,8 +1208,8 @@ __strcmp_gg (const char *__s1, const char *__s2)
/* Compare N characters of S1 and S2. */
-#define _HAVE_STRING_ARCH_strncmp 1
-#define strncmp(s1, s2, n) \
+# define _HAVE_STRING_ARCH_strncmp 1
+# define strncmp(s1, s2, n) \
(__extension__ (__builtin_constant_p (s1) && strlen (s1) < ((size_t) (n)) \
? strcmp ((s1), (s2)) \
: (__builtin_constant_p (s2) && strlen (s2) < ((size_t) (n))\
@@ -1244,9 +1252,9 @@ __strncmp_g (const char *__s1, const char *__s2, size_t __n)
/* Find the first occurrence of C in S. */
-#define _HAVE_STRING_ARCH_strchr 1
-#define _USE_STRING_ARCH_strchr 1
-#define strchr(s, c) \
+# define _HAVE_STRING_ARCH_strchr 1
+# define _USE_STRING_ARCH_strchr 1
+# define strchr(s, c) \
(__extension__ (__builtin_constant_p (c) \
? ((c) == '\0' \
? (char *) __rawmemchr ((s), (c)) \
@@ -1304,8 +1312,8 @@ __strchr_g (const char *__s, int __c)
/* Find the first occurrence of C in S or the final NUL byte. */
-#define _HAVE_STRING_ARCH_strchrnul 1
-#define __strchrnul(s, c) \
+# define _HAVE_STRING_ARCH_strchrnul 1
+# define __strchrnul(s, c) \
(__extension__ (__builtin_constant_p (c) \
? ((c) == '\0' \
? (char *) __rawmemchr ((s), c) \
@@ -1360,29 +1368,29 @@ __strchrnul_g (const char *__s, int __c)
: "cc");
return __res;
}
-#ifdef __USE_GNU
-# define strchrnul(s, c) __strchrnul ((s), (c))
-#endif
+# ifdef __USE_GNU
+# define strchrnul(s, c) __strchrnul ((s), (c))
+# endif
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
/* Find the first occurrence of C in S. This is the BSD name. */
-# define _HAVE_STRING_ARCH_index 1
-# define index(s, c) \
+# define _HAVE_STRING_ARCH_index 1
+# define index(s, c) \
(__extension__ (__builtin_constant_p (c) \
? __strchr_c ((s), ((c) & 0xff) << 8) \
: __strchr_g ((s), (c))))
-#endif
+# endif
/* Find the last occurrence of C in S. */
-#define _HAVE_STRING_ARCH_strrchr 1
-#define strrchr(s, c) \
+# define _HAVE_STRING_ARCH_strrchr 1
+# define strrchr(s, c) \
(__extension__ (__builtin_constant_p (c) \
? __strrchr_c ((s), ((c) & 0xff) << 8) \
: __strrchr_g ((s), (c))))
-#ifdef __i686__
+# ifdef __i686__
__STRING_INLINE char *__strrchr_c (const char *__s, int __c);
__STRING_INLINE char *
@@ -1427,7 +1435,7 @@ __strrchr_g (const char *__s, int __c)
: "cc");
return __res - 1;
}
-#else
+# else
__STRING_INLINE char *__strrchr_c (const char *__s, int __c);
__STRING_INLINE char *
@@ -1476,23 +1484,23 @@ __strrchr_g (const char *__s, int __c)
: "cc");
return __res;
}
-#endif
+# endif
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
/* Find the last occurrence of C in S. This is the BSD name. */
-# define _HAVE_STRING_ARCH_rindex 1
-# define rindex(s, c) \
+# define _HAVE_STRING_ARCH_rindex 1
+# define rindex(s, c) \
(__extension__ (__builtin_constant_p (c) \
? __strrchr_c ((s), ((c) & 0xff) << 8) \
: __strrchr_g ((s), (c))))
-#endif
+# endif
/* Return the length of the initial segment of S which
consists entirely of characters not in REJECT. */
-#define _HAVE_STRING_ARCH_strcspn 1
-#define strcspn(s, reject) \
+# define _HAVE_STRING_ARCH_strcspn 1
+# define strcspn(s, reject) \
(__extension__ (__builtin_constant_p (reject) && sizeof ((reject)[0]) == 1 \
? ((reject)[0] == '\0' \
? strlen (s) \
@@ -1503,7 +1511,7 @@ __strrchr_g (const char *__s, int __c)
__STRING_INLINE size_t __strcspn_c1 (const char *__s, int __reject);
-#ifndef _FORCE_INLINES
+# ifndef _FORCE_INLINES
__STRING_INLINE size_t
__strcspn_c1 (const char *__s, int __reject)
{
@@ -1524,7 +1532,7 @@ __strcspn_c1 (const char *__s, int __reject)
: "cc");
return (__res - 1) - __s;
}
-#endif
+# endif
__STRING_INLINE size_t __strcspn_cg (const char *__s, const char __reject[],
size_t __reject_len);
@@ -1552,7 +1560,7 @@ __strcspn_cg (const char *__s, const char __reject[], size_t __reject_len)
}
__STRING_INLINE size_t __strcspn_g (const char *__s, const char *__reject);
-#ifdef __PIC__
+# ifdef __PIC__
__STRING_INLINE size_t
__strcspn_g (const char *__s, const char *__reject)
@@ -1581,7 +1589,7 @@ __strcspn_g (const char *__s, const char *__reject)
: "memory", "cc");
return (__res - 1) - __s;
}
-#else
+# else
__STRING_INLINE size_t
__strcspn_g (const char *__s, const char *__reject)
{
@@ -1607,13 +1615,13 @@ __strcspn_g (const char *__s, const char *__reject)
: "memory", "cc");
return (__res - 1) - __s;
}
-#endif
+# endif
/* Return the length of the initial segment of S which
consists entirely of characters in ACCEPT. */
-#define _HAVE_STRING_ARCH_strspn 1
-#define strspn(s, accept) \
+# define _HAVE_STRING_ARCH_strspn 1
+# define strspn(s, accept) \
(__extension__ (__builtin_constant_p (accept) && sizeof ((accept)[0]) == 1 \
? ((accept)[0] == '\0' \
? ((void) (s), 0) \
@@ -1622,7 +1630,7 @@ __strcspn_g (const char *__s, const char *__reject)
: __strspn_cg ((s), (accept), strlen (accept)))) \
: __strspn_g ((s), (accept))))
-#ifndef _FORCE_INLINES
+# ifndef _FORCE_INLINES
__STRING_INLINE size_t __strspn_c1 (const char *__s, int __accept);
__STRING_INLINE size_t
@@ -1643,7 +1651,7 @@ __strspn_c1 (const char *__s, int __accept)
: "cc");
return (__res - 1) - __s;
}
-#endif
+# endif
__STRING_INLINE size_t __strspn_cg (const char *__s, const char __accept[],
size_t __accept_len);
@@ -1675,7 +1683,7 @@ __strspn_cg (const char *__s, const char __accept[], size_t __accept_len)
}
__STRING_INLINE size_t __strspn_g (const char *__s, const char *__accept);
-#ifdef __PIC__
+# ifdef __PIC__
__STRING_INLINE size_t
__strspn_g (const char *__s, const char *__accept)
@@ -1703,7 +1711,7 @@ __strspn_g (const char *__s, const char *__accept)
: "memory", "cc");
return (__res - 1) - __s;
}
-#else
+# else
__STRING_INLINE size_t
__strspn_g (const char *__s, const char *__accept)
{
@@ -1728,12 +1736,12 @@ __strspn_g (const char *__s, const char *__accept)
: "memory", "cc");
return (__res - 1) - __s;
}
-#endif
+# endif
/* Find the first occurrence in S of any character in ACCEPT. */
-#define _HAVE_STRING_ARCH_strpbrk 1
-#define strpbrk(s, accept) \
+# define _HAVE_STRING_ARCH_strpbrk 1
+# define strpbrk(s, accept) \
(__extension__ (__builtin_constant_p (accept) && sizeof ((accept)[0]) == 1 \
? ((accept)[0] == '\0' \
? ((void) (s), (char *) 0) \
@@ -1772,7 +1780,7 @@ __strpbrk_cg (const char *__s, const char __accept[], size_t __accept_len)
}
__STRING_INLINE char *__strpbrk_g (const char *__s, const char *__accept);
-#ifdef __PIC__
+# ifdef __PIC__
__STRING_INLINE char *
__strpbrk_g (const char *__s, const char *__accept)
@@ -1805,7 +1813,7 @@ __strpbrk_g (const char *__s, const char *__accept)
: "memory", "cc");
return __res;
}
-#else
+# else
__STRING_INLINE char *
__strpbrk_g (const char *__s, const char *__accept)
{
@@ -1835,12 +1843,12 @@ __strpbrk_g (const char *__s, const char *__accept)
: "memory", "cc");
return __res;
}
-#endif
+# endif
/* Find the first occurrence of NEEDLE in HAYSTACK. */
-#define _HAVE_STRING_ARCH_strstr 1
-#define strstr(haystack, needle) \
+# define _HAVE_STRING_ARCH_strstr 1
+# define strstr(haystack, needle) \
(__extension__ (__builtin_constant_p (needle) && sizeof ((needle)[0]) == 1 \
? ((needle)[0] == '\0' \
? (haystack) \
@@ -1883,7 +1891,7 @@ __strstr_cg (const char *__haystack, const char __needle[],
__STRING_INLINE char *__strstr_g (const char *__haystack,
const char *__needle);
-#ifdef __PIC__
+# ifdef __PIC__
__STRING_INLINE char *
__strstr_g (const char *__haystack, const char *__needle)
@@ -1915,7 +1923,7 @@ __strstr_g (const char *__haystack, const char *__needle)
: "memory", "cc");
return __res;
}
-#else
+# else
__STRING_INLINE char *
__strstr_g (const char *__haystack, const char *__needle)
{
@@ -1944,32 +1952,34 @@ __strstr_g (const char *__haystack, const char *__needle)
: "memory", "cc");
return __res;
}
-#endif
+# endif
/* Bit find functions. We define only the i686 version since for the other
processors gcc generates good code. */
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
-# ifdef __i686__
-# define _HAVE_STRING_ARCH_ffs 1
-# define ffs(word) (__builtin_constant_p (word) \
- ? __builtin_ffs (word) \
- : ({ int __cnt, __tmp; \
- __asm__ __volatile__ \
- ("bsfl %2,%0\n\t" \
- "cmovel %1,%0" \
- : "=&r" (__cnt), "=r" (__tmp) \
- : "rm" (word), "1" (-1)); \
- __cnt + 1; }))
-
-# ifndef ffsl
-# define ffsl(word) ffs(word)
-# endif
-# endif /* i686 */
-#endif /* BSD || X/Open */
+# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+# ifdef __i686__
+# define _HAVE_STRING_ARCH_ffs 1
+# define ffs(word) (__builtin_constant_p (word) \
+ ? __builtin_ffs (word) \
+ : ({ int __cnt, __tmp; \
+ __asm__ __volatile__ \
+ ("bsfl %2,%0\n\t" \
+ "cmovel %1,%0" \
+ : "=&r" (__cnt), "=r" (__tmp) \
+ : "rm" (word), "1" (-1)); \
+ __cnt + 1; }))
+
+# ifndef ffsl
+# define ffsl(word) ffs(word)
+# endif
+# endif /* i686 */
+# endif /* BSD || X/Open */
+
+# ifndef _FORCE_INLINES
+# undef __STRING_INLINE
+# endif
-#ifndef _FORCE_INLINES
-# undef __STRING_INLINE
-#endif
+# endif /* use string inlines && GNU CC */
-#endif /* use string inlines && GNU CC */
+#endif
diff --git a/libc/sysdeps/i386/fpu/bits/fenv.h b/libc/sysdeps/x86/fpu/bits/fenv.h
index e71ceb7b3..b2c01c403 100644
--- a/libc/sysdeps/i386/fpu/bits/fenv.h
+++ b/libc/sysdeps/x86/fpu/bits/fenv.h
@@ -19,7 +19,6 @@
# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
#endif
-
/* Define bits representing the exception. We use the bit positions
of the appropriate bits in the FPU control word. */
enum
@@ -60,8 +59,10 @@ enum
typedef unsigned short int fexcept_t;
-/* Type representing floating-point environment. This function corresponds
- to the layout of the block written by the `fstenv'. */
+/* Type representing floating-point environment. This structure
+ corresponds to the layout of the block written by the `fstenv'
+ instruction and has additional fields for the contents of the MXCSR
+ register as written by the `stmxcsr' instruction. */
typedef struct
{
unsigned short int __control_word;
@@ -77,6 +78,9 @@ typedef struct
unsigned int __data_offset;
unsigned short int __data_selector;
unsigned short int __unused5;
+#ifdef __x86_64__
+ unsigned int __mxcsr;
+#endif
}
fenv_t;
diff --git a/libc/sysdeps/x86_64/fpu/Implies b/libc/sysdeps/x86_64/fpu/Implies
new file mode 100644
index 000000000..2b745a34f
--- /dev/null
+++ b/libc/sysdeps/x86_64/fpu/Implies
@@ -0,0 +1 @@
+x86/fpu
diff --git a/libc/sysdeps/x86_64/fpu/bits/fenv.h b/libc/sysdeps/x86_64/fpu/bits/fenv.h
deleted file mode 100644
index bb790c936..000000000
--- a/libc/sysdeps/x86_64/fpu/bits/fenv.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/* Copyright (C) 1997-2001,2004,2011,2012 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, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _FENV_H
-# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
-#endif
-
-/* Define bits representing the exception. We use the bit positions
- of the appropriate bits in the FPU control word. */
-enum
- {
- FE_INVALID = 0x01,
-#define FE_INVALID FE_INVALID
- __FE_DENORM = 0x02,
- FE_DIVBYZERO = 0x04,
-#define FE_DIVBYZERO FE_DIVBYZERO
- FE_OVERFLOW = 0x08,
-#define FE_OVERFLOW FE_OVERFLOW
- FE_UNDERFLOW = 0x10,
-#define FE_UNDERFLOW FE_UNDERFLOW
- FE_INEXACT = 0x20
-#define FE_INEXACT FE_INEXACT
- };
-
-#define FE_ALL_EXCEPT \
- (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
-
-/* The ix87 FPU supports all of the four defined rounding modes. We
- use again the bit positions in the FPU control word as the values
- for the appropriate macros. */
-enum
- {
- FE_TONEAREST = 0,
-#define FE_TONEAREST FE_TONEAREST
- FE_DOWNWARD = 0x400,
-#define FE_DOWNWARD FE_DOWNWARD
- FE_UPWARD = 0x800,
-#define FE_UPWARD FE_UPWARD
- FE_TOWARDZERO = 0xc00
-#define FE_TOWARDZERO FE_TOWARDZERO
- };
-
-
-/* Type representing exception flags. */
-typedef unsigned short int fexcept_t;
-
-
-/* Type representing floating-point environment. This structure
- corresponds to the layout of the block written by the `fstenv'
- instruction and has additional fields for the contents of the MXCSR
- register as written by the `stmxcsr' instruction. */
-typedef struct
- {
- unsigned short int __control_word;
- unsigned short int __unused1;
- unsigned short int __status_word;
- unsigned short int __unused2;
- unsigned short int __tags;
- unsigned short int __unused3;
- unsigned int __eip;
- unsigned short int __cs_selector;
- unsigned int __opcode:11;
- unsigned int __unused4:5;
- unsigned int __data_offset;
- unsigned short int __data_selector;
- unsigned short int __unused5;
-#ifdef __x86_64__
- unsigned int __mxcsr;
-#endif
- }
-fenv_t;
-
-/* If the default argument is used we use this value. */
-#define FE_DFL_ENV ((const fenv_t *) -1)
-
-#ifdef __USE_GNU
-/* Floating-point environment where none of the exception is masked. */
-# define FE_NOMASK_ENV ((const fenv_t *) -2)
-#endif
-
-
-#ifdef __USE_EXTERN_INLINES
-__BEGIN_DECLS
-
-/* Optimized versions. */
-extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), feraiseexcept);
-__extern_inline int
-__NTH (feraiseexcept (int __excepts))
-{
- if (__builtin_constant_p (__excepts)
- && (__excepts & ~(FE_INVALID | FE_DIVBYZERO)) == 0)
- {
- if ((FE_INVALID & __excepts) != 0)
- {
- /* One example of a invalid operation is 0.0 / 0.0. */
- float __f = 0.0;
-
- __asm__ __volatile__ ("divss %0, %0 " : : "x" (__f));
- (void) &__f;
- }
- if ((FE_DIVBYZERO & __excepts) != 0)
- {
- float __f = 1.0;
- float __g = 0.0;
-
- __asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g));
- (void) &__f;
- }
-
- return 0;
- }
-
- return __feraiseexcept_renamed (__excepts);
-}
-
-__END_DECLS
-#endif
diff --git a/ports/ChangeLog.alpha b/ports/ChangeLog.alpha
index 1d3e6bd57..824083c32 100644
--- a/ports/ChangeLog.alpha
+++ b/ports/ChangeLog.alpha
@@ -1,3 +1,35 @@
+2012-06-06 Richard Henderson <rth@twiddle.net>
+
+ * sysdeps/alpha/strncmp.S: Bound count to LONG_MAX at startup.
+ Re-organize checks vs s2 end-of-count.
+
+ [BZ #13718]
+ * sysdeps/alpha/stxncmp.S: Bound count to LONG_MAX at startup.
+ * sysdeps/alpha/alphaev6/stxncmp.S: Likewise.
+
+ * sysdeps/alpha/fpu/e_sqrt.c: Include <math_private.h> before
+ redefining __ieee758_sqrt.
+
+ * sysdeps/alpha/alphaev6/stxcpy.S: Use cfi markup instead of
+ dual ecoff procedure descriptors.
+ * sysdeps/alpha/alphaev6/stxncpy.S: Likewise.
+ * sysdeps/alpha/bzero.S: Likewise.
+ * sysdeps/alpha/memset.S: Likewise.
+ * sysdeps/alpha/stxcpy.S: Likewise.
+ * sysdeps/alpha/stxncpy.S: Likewise.
+ * sysdeps/unix/alpha/sysdep.h (USEPV_PROF): New.
+
+ * sysdeps/alpha/_mcount.S: Move .prologue after stack alloc.
+
+2012-06-05 Richard Henderson <rth@twiddle.net>
+
+ * sysdeps/unix/sysv/linux/alpha/rt_sigaction.S: Use .cfi_signal_frame
+ instead of a hack using extra nops.
+
+ * sysdeps/unxi/alpha/getppid.S: New file.
+ * sysdeps/unxi/alpha/getegid.S: New file.
+ * sysdeps/unxi/alpha/geteuid.S: New file.
+
2012-06-01 Richard Henderson <rth@twiddle.net>
* sysdeps/alpha/Makefile (CFLAGS-test-misc.c): Set -mieee-with-inexact.
diff --git a/ports/ChangeLog.powerpc b/ports/ChangeLog.powerpc
index ee958ebc9..8ad5badb5 100644
--- a/ports/ChangeLog.powerpc
+++ b/ports/ChangeLog.powerpc
@@ -1,3 +1,8 @@
+2012-06-08 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist:
+ Update.
+
2012-05-31 Joseph Myers <joseph@codesourcery.com>
* sysdeps/powerpc/nofpu/libm-test-ulps: Regenerated.
diff --git a/ports/sysdeps/alpha/_mcount.S b/ports/sysdeps/alpha/_mcount.S
index 9d7c15be7..67c579e67 100644
--- a/ports/sysdeps/alpha/_mcount.S
+++ b/ports/sysdeps/alpha/_mcount.S
@@ -38,9 +38,8 @@
.set noreorder
LEAF(_mcount, 0xb0)
- .prologue 0
-
subq sp, 0xb0, sp
+ .prologue 0
stq a0, 0x00(sp)
mov ra, a0 # a0 = caller-pc
stq a1, 0x08(sp)
diff --git a/ports/sysdeps/alpha/alphaev6/stxcpy.S b/ports/sysdeps/alpha/alphaev6/stxcpy.S
index 37ad737ba..bdc8e72eb 100644
--- a/ports/sysdeps/alpha/alphaev6/stxcpy.S
+++ b/ports/sysdeps/alpha/alphaev6/stxcpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@tamu.edu)
EV6 optimized by Rick Gorton <rick.gorton@alpha-processor.com>.
This file is part of the GNU C Library.
@@ -41,24 +41,20 @@
.arch ev6
.set noat
.set noreorder
- .text
-
-/* There is a problem with either gdb (as of 4.16) or gas (as of 2.7) that
- doesn't like putting the entry point for a procedure somewhere in the
- middle of the procedure descriptor. Work around this by putting the
- aligned copy in its own procedure descriptor */
+ .text
+ .type __stxcpy, @function
+ .globl __stxcpy
+ .usepv __stxcpy, no
- .ent stxcpy_aligned
- .align 4
-stxcpy_aligned:
- .frame sp, 0, t9
- .prologue 0
+ cfi_startproc
+ cfi_return_column (t9)
/* On entry to this basic block:
t0 == the first destination word for masking back in
t1 == the first source word. */
-
+ .align 4
+stxcpy_aligned:
/* Create the 1st output word and detect 0's in the 1st input word. */
lda t2, -1 # E : build a mask against false zero
mskqh t2, a1, t2 # U : detection in the src word (stall)
@@ -115,15 +111,8 @@ $a_eos:
nop
nop
- .end stxcpy_aligned
-
.align 4
- .ent __stxcpy
- .globl __stxcpy
__stxcpy:
- .frame sp, 0, t9
- .prologue 0
-
/* Are source and destination co-aligned? */
xor a0, a1, t0 # E :
unop # E :
@@ -321,7 +310,5 @@ $unaligned:
or t0, t1, t1 # e1 : and put it there
stq_u t1, 0(a0) # .. e0 : (stall)
ret (t9) # e1 :
- nop
-
- .end __stxcpy
+ cfi_endproc
diff --git a/ports/sysdeps/alpha/alphaev6/stxncpy.S b/ports/sysdeps/alpha/alphaev6/stxncpy.S
index 31f85706f..28495df00 100644
--- a/ports/sysdeps/alpha/alphaev6/stxncpy.S
+++ b/ports/sysdeps/alpha/alphaev6/stxncpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@tamu.edu)
EV6 optimized by Rick Gorton <rick.gorton@alpha-processor.com>.
This file is part of the GNU C Library.
@@ -49,22 +49,19 @@
.set noat
.set noreorder
-/* There is a problem with either gdb (as of 4.16) or gas (as of 2.7) that
- doesn't like putting the entry point for a procedure somewhere in the
- middle of the procedure descriptor. Work around this by putting the
- aligned copy in its own procedure descriptor */
+ .text
+ .type __stxncpy, @function
+ .globl __stxncpy
+ .usepv __stxncpy, no
-
- .ent stxncpy_aligned
- .align 4
-stxncpy_aligned:
- .frame sp, 0, t9, 0
- .prologue 0
+ cfi_startproc
+ cfi_return_column (t9)
/* On entry to this basic block:
t0 == the first destination word for masking back in
t1 == the first source word. */
-
+ .align 4
+stxncpy_aligned:
/* Create the 1st output word and detect 0's in the 1st input word. */
lda t2, -1 # E : build a mask against false zero
mskqh t2, a1, t2 # U : detection in the src word (stall)
@@ -111,7 +108,6 @@ $a_loop:
On entry to this basic block we have:
t0 == the source word containing the null
t7 == the cmpbge mask that found it. */
-
$a_eos:
negq t7, t8 # E : find low bit set
and t7, t8, t8 # E : (stall)
@@ -144,38 +140,36 @@ $a_eoc:
nop
nop
- .end stxncpy_aligned
-
.align 4
- .ent __stxncpy
- .globl __stxncpy
__stxncpy:
- .frame sp, 0, t9, 0
- .prologue 0
-
/* Are source and destination co-aligned? */
+ lda t2, -1 # E :
xor a0, a1, t1 # E :
and a0, 7, t0 # E : find dest misalignment
- and t1, 7, t1 # E : (stall)
- addq a2, t0, a2 # E : bias count by dest misalignment (stall)
+ nop # E :
- subq a2, 1, a2 # E :
+ srl t2, 1, t2 # U :
+ and t1, 7, t1 # E :
+ cmovlt a2, t2, a2 # E : bound count to LONG_MAX (stall)
+ nop # E :
+
+ addq a2, t0, a2 # E : bias count by dest misalignment
+ subq a2, 1, a2 # E : (stall)
and a2, 7, t2 # E : (stall)
- srl a2, 3, a2 # U : a2 = loop counter = (count - 1)/8 (stall)
- addq zero, 1, t10 # E :
+ lda t10, 1 # E :
+ srl a2, 3, a2 # U : a2 = loop counter = (count - 1)/8
sll t10, t2, t10 # U : t10 = bitmask of last count byte
- bne t1, $unaligned # U :
+ nop # E :
+ bne t1, $unaligned # U : (stall)
+
/* We are co-aligned; take care of a partial first word. */
ldq_u t1, 0(a1) # L : load first src word
addq a1, 8, a1 # E :
-
- beq t0, stxncpy_aligned # U : avoid loading dest word if not needed
+ beq t0, stxncpy_aligned # U : avoid loading dest word if not needed
ldq_u t0, 0(a0) # L :
- nop
- nop
- br stxncpy_aligned # .. e1 :
+ br stxncpy_aligned # U :
nop
nop
nop
@@ -231,7 +225,7 @@ $u_head:
extqh t2, a1, t0 # U : position lo-bits of hi word (stall)
cmpbge zero, t2, t7 # E :
- nop
+ nop
bne t7, $u_eos # U :
/* Unaligned copy main loop. In order to avoid reading too much,
@@ -314,7 +308,7 @@ $u_final:
1: stq_u t0, 0(a0) # L :
ret (t9) # L0 : Latency=3
- /* Got to end-of-count before end of string.
+ /* Got to end-of-count before end of string.
On entry to this basic block:
t1 == the shifted high-order bits from the previous source word */
$u_eoc:
@@ -325,7 +319,7 @@ $u_eoc:
ldq_u t2, 8(a1) # L : load final src word
nop
- extqh t2, a1, t0 # U : extract low bits for last word (stall)
+ extqh t2, a1, t0 # U : extract low bits for last word (stall)
or t1, t0, t1 # E : (stall)
1: cmpbge zero, t1, t7 # E :
@@ -394,9 +388,5 @@ $unaligned:
stq_u t0, 0(a0) # L : (stall)
ret (t9) # L0 : Latency=3
- nop
- nop
- nop
-
- .end __stxncpy
+ cfi_endproc
diff --git a/ports/sysdeps/alpha/bzero.S b/ports/sysdeps/alpha/bzero.S
index 091024b1e..a691ff68b 100644
--- a/ports/sysdeps/alpha/bzero.S
+++ b/ports/sysdeps/alpha/bzero.S
@@ -36,23 +36,19 @@
.set noreorder
.text
+ .type __bzero, @function
+ .globl __bzero
+ .usepv __bzero, USEPV_PROF
-/* There is a problem with either gdb (as of 4.16) or gas (as of 2.7) that
- doesn't like putting the entry point for a procedure somewhere in the
- middle of the procedure descriptor. Work around this by putting the main
- loop in its own procedure descriptor. */
+ cfi_startproc
/* On entry to this basic block:
t3 == loop counter
t4 == bytes in partial final word
a0 == possibly misaligned destination pointer */
- .ent bzero_loop
.align 3
bzero_loop:
- .frame sp, 0, ra, 0
- .prologue 0
-
beq t3, $tail #
blbc t3, 0f # skip single store if count even
@@ -75,16 +71,11 @@ $tail: bne t4, 1f # is there a tail to do?
stq_u t0, 0(a0) #
ret #
- .end bzero_loop
-
-ENTRY(__bzero)
+__bzero:
#ifdef PROF
ldgp gp, 0(pv)
lda AT, _mcount
jsr AT, (AT), _mcount
- .prologue 1
-#else
- .prologue 0
#endif
mov a0, v0 # e0 : move return value in place
@@ -115,5 +106,5 @@ $oneq:
$done: ret
- END(__bzero)
+ cfi_endproc
weak_alias (__bzero, bzero)
diff --git a/ports/sysdeps/alpha/fpu/e_sqrt.c b/ports/sysdeps/alpha/fpu/e_sqrt.c
index 22b24b53f..ad10dade0 100644
--- a/ports/sysdeps/alpha/fpu/e_sqrt.c
+++ b/ports/sysdeps/alpha/fpu/e_sqrt.c
@@ -16,7 +16,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#include <features.h>
+#include <math.h>
+#include <math_private.h>
#if !defined(_IEEE_FP_INEXACT)
diff --git a/ports/sysdeps/alpha/memset.S b/ports/sysdeps/alpha/memset.S
index 4ac70929c..db92771e2 100644
--- a/ports/sysdeps/alpha/memset.S
+++ b/ports/sysdeps/alpha/memset.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@tamu.edu)
This file is part of the GNU C Library.
@@ -37,11 +37,11 @@
.set noreorder
.text
+ .type memset, @function
+ .globl memset
+ .usepv memset, USEPV_PROF
-/* There is a problem with either gdb (as of 4.16) or gas (as of 2.7) that
- doesn't like putting the entry point for a procedure somewhere in the
- middle of the procedure descriptor. Work around this by putting the main
- loop in its own procedure descriptor. */
+ cfi_startproc
/* On entry to this basic block:
t3 == loop counter
@@ -49,12 +49,8 @@
a0 == possibly misaligned destination pointer
a1 == replicated source character */
- .ent memset_loop
.align 3
memset_loop:
- .frame sp, 0, ra, 0
- .prologue 0
-
beq t3, $tail
blbc t3, 0f # skip single store if count even
@@ -80,19 +76,14 @@ $tail: bne t4, 1f # is there a tail to do?
stq_u t0, 0(a0) # e0 :
ret # .. e1 :
- .end memset_loop
-
-ENTRY(memset)
+memset:
#ifdef PROF
ldgp gp, 0(pv)
lda AT, _mcount
jsr AT, (AT), _mcount
- .prologue 1
-#else
- .prologue 0
#endif
- zapnot a1, 1, a1 # e0 : zero extend input character
+ and a1, 0xff, a1 # e0 : zero extend input character
mov a0, v0 # .. e1 : move return value in place
sll a1, 8, t0 # e0 : begin replicating the char
beq a2, $done # .. e1 : early exit for zero-length store
@@ -132,5 +123,5 @@ $oneq:
$done: ret
- END(memset)
+ cfi_endproc
libc_hidden_builtin_def (memset)
diff --git a/ports/sysdeps/alpha/strncmp.S b/ports/sysdeps/alpha/strncmp.S
index c9981e1b6..828f1b970 100644
--- a/ports/sysdeps/alpha/strncmp.S
+++ b/ports/sysdeps/alpha/strncmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@tamu.edu)
This file is part of the GNU C Library.
@@ -23,6 +23,15 @@
.set noat
.set noreorder
+/* EV6 only predicts one branch per octaword. We'll use these to push
+ subsequent branches back to the next bundle. This will generally add
+ a fetch+decode cycle to older machines, so skip in that case. */
+#ifdef __alpha_fix__
+# define ev6_unop unop
+#else
+# define ev6_unop
+#endif
+
.text
ENTRY(strncmp)
@@ -35,128 +44,140 @@ ENTRY(strncmp)
.prologue 0
#endif
- xor a0, a1, t2 # e0 : are s1 and s2 co-aligned?
- beq a2, $zerolength # .. e1 :
- ldq_u t0, 0(a0) # e0 : give cache time to catch up
- ldq_u t1, 0(a1) # .. e1 :
- and t2, 7, t2 # e0 :
- and a0, 7, t4 # .. e1 : find s1 misalignment
- lda t3, -1 # e0 :
- addq a2, t4, a2 # .. e1 : bias count by s1 misalignment
- and a2, 7, t10 # e1 : ofs of last byte in last word
- srl a2, 3, a2 # .. e0 : remaining full words in count
- and a1, 7, t5 # e0 : find s2 misalignment
- bne t2, $unaligned # .. e1 :
+ xor a0, a1, t2 # are s1 and s2 co-aligned?
+ beq a2, $zerolength
+ ldq_u t0, 0(a0) # load asap to give cache time to catch up
+ ldq_u t1, 0(a1)
+ lda t3, -1
+ and t2, 7, t2
+ srl t3, 1, t6
+ and a0, 7, t4 # find s1 misalignment
+ and a1, 7, t5 # find s2 misalignment
+ cmovlt a2, t6, a2 # bound neg count to LONG_MAX
+ addq a1, a2, a3 # s2+count
+ addq a2, t4, a2 # bias count by s1 misalignment
+ and a2, 7, t10 # ofs of last byte in s1 last word
+ srl a2, 3, a2 # remaining full words in s1 count
+ bne t2, $unaligned
/* On entry to this basic block:
t0 == the first word of s1.
t1 == the first word of s2.
t3 == -1. */
-
$aligned:
- mskqh t3, a1, t3 # e0 : mask off leading garbage
- nop # .. e1 :
- ornot t1, t3, t1 # e0 :
- ornot t0, t3, t0 # .. e1 :
- cmpbge zero, t1, t7 # e0 : bits set iff null found
- beq a2, $eoc # .. e1 : check end of count
- unop # e0 :
- bne t7, $eos # .. e1 :
- unop # e0 :
- beq t10, $ant_loop # .. e1 :
+ mskqh t3, a1, t8 # mask off leading garbage
+ ornot t1, t8, t1
+ ornot t0, t8, t0
+ cmpbge zero, t1, t7 # bits set iff null found
+ beq a2, $eoc # check end of count
+ bne t7, $eos
+ beq t10, $ant_loop
/* Aligned compare main loop.
On entry to this basic block:
t0 == an s1 word.
t1 == an s2 word not containing a null. */
+ .align 4
$a_loop:
xor t0, t1, t2 # e0 :
bne t2, $wordcmp # .. e1 (zdb)
ldq_u t1, 8(a1) # e0 :
ldq_u t0, 8(a0) # .. e1 :
+
subq a2, 1, a2 # e0 :
addq a1, 8, a1 # .. e1 :
addq a0, 8, a0 # e0 :
beq a2, $eoc # .. e1 :
+
cmpbge zero, t1, t7 # e0 :
beq t7, $a_loop # .. e1 :
- unop # e0 :
- br $eos # .. e1 :
+
+ br $eos
/* Alternate aligned compare loop, for when there's no trailing
bytes on the count. We have to avoid reading too much data. */
+ .align 4
$ant_loop:
xor t0, t1, t2 # e0 :
+ ev6_unop
+ ev6_unop
bne t2, $wordcmp # .. e1 (zdb)
+
subq a2, 1, a2 # e0 :
beq a2, $zerolength # .. e1 :
ldq_u t1, 8(a1) # e0 :
ldq_u t0, 8(a0) # .. e1 :
+
addq a1, 8, a1 # e0 :
addq a0, 8, a0 # .. e1 :
cmpbge zero, t1, t7 # e0 :
beq t7, $ant_loop # .. e1 :
- unop # e0 :
- br $eos # .. e1 :
+
+ br $eos
/* The two strings are not co-aligned. Align s1 and cope. */
+ /* On entry to this basic block:
+ t0 == the first word of s1.
+ t1 == the first word of s2.
+ t3 == -1.
+ t4 == misalignment of s1.
+ t5 == misalignment of s2.
+ t10 == misalignment of s1 end. */
+ .align 4
$unaligned:
- subq a1, t4, a1 # e0 :
- unop # :
-
- /* If s2 misalignment is larger than s2 misalignment, we need
+ /* If s1 misalignment is larger than s2 misalignment, we need
extra startup checks to avoid SEGV. */
+ subq a1, t4, a1 # adjust s2 for s1 misalignment
+ cmpult t4, t5, t9
+ subq a3, 1, a3 # last byte of s2
+ bic a1, 7, t8
+ mskqh t3, t5, t7 # mask garbage in s2
+ subq a3, t8, a3
+ ornot t1, t7, t7
+ srl a3, 3, a3 # remaining full words in s2 count
+ beq t9, $u_head
+
+ /* Failing that, we need to look for both eos and eoc within the
+ first word of s2. If we find either, we can continue by
+ pretending that the next word of s2 is all zeros. */
+ lda t2, 0 # next = zero
+ cmpeq a3, 0, t8 # eoc in the first word of s2?
+ cmpbge zero, t7, t7 # eos in the first word of s2?
+ or t7, t8, t8
+ bne t8, $u_head_nl
- cmplt t4, t5, t8 # .. e1 :
- beq t8, $u_head # e1 :
-
- mskqh t3, t5, t3 # e0 :
- ornot t1, t3, t3 # e0 :
- cmpbge zero, t3, t7 # e1 : is there a zero?
- beq t7, $u_head # e1 :
-
- /* We've found a zero in the first partial word of s2. Align
- our current s1 and s2 words and compare what we've got. */
-
- extql t1, t5, t1 # e0 :
- lda t3, -1 # .. e1 :
- insql t1, a0, t1 # e0 :
- mskqh t3, a0, t3 # e0 :
- ornot t1, t3, t1 # e0 :
- ornot t0, t3, t0 # .. e1 :
- cmpbge zero, t1, t7 # e0 : find that zero again
- beq a2, $eoc # .. e1 : and finish up
- br $eos # e1 :
-
- .align 3
-$u_head:
/* We know just enough now to be able to assemble the first
full word of s2. We can still find a zero at the end of it.
On entry to this basic block:
t0 == first word of s1
- t1 == first partial word of s2. */
-
- ldq_u t2, 8(a1) # e0 : load second partial s2 word
- lda t3, -1 # .. e1 : create leading garbage mask
- extql t1, a1, t1 # e0 : create first s2 word
- mskqh t3, a0, t3 # e0 :
- extqh t2, a1, t4 # e0 :
- ornot t0, t3, t0 # .. e1 : kill s1 garbage
- or t1, t4, t1 # e0 : s2 word now complete
- ornot t1, t3, t1 # e1 : kill s2 garbage
- cmpbge zero, t0, t7 # e0 : find zero in first s1 word
- beq a2, $eoc # .. e1 :
- lda t3, -1 # e0 :
- bne t7, $eos # .. e1 :
- subq a2, 1, a2 # e0 :
- xor t0, t1, t4 # .. e1 : compare aligned words
- mskql t3, a1, t3 # e0 : mask out s2[1] bits we have seen
- bne t4, $wordcmp # .. e1 :
- or t2, t3, t3 # e0 :
- cmpbge zero, t3, t7 # e1 : find zero in high bits of s2[1]
- bne t7, $u_final # e1 :
+ t1 == first partial word of s2.
+ t3 == -1.
+ t10 == ofs of last byte in s1 last word.
+ t11 == ofs of last byte in s2 last word. */
+$u_head:
+ ldq_u t2, 8(a1) # load second partial s2 word
+ subq a3, 1, a3
+$u_head_nl:
+ extql t1, a1, t1 # create first s2 word
+ mskqh t3, a0, t8
+ extqh t2, a1, t4
+ ornot t0, t8, t0 # kill s1 garbage
+ or t1, t4, t1 # s2 word now complete
+ cmpbge zero, t0, t7 # find eos in first s1 word
+ ornot t1, t8, t1 # kill s2 garbage
+ beq a2, $eoc
+ subq a2, 1, a2
+ bne t7, $eos
+ mskql t3, a1, t8 # mask out s2[1] bits we have seen
+ xor t0, t1, t4 # compare aligned words
+ or t2, t8, t8
+ bne t4, $wordcmp
+ cmpbge zero, t8, t7 # eos in high bits of s2[1]?
+ cmpeq a3, 0, t8 # eoc in s2[1]?
+ or t7, t8, t7
+ bne t7, $u_final
/* Unaligned copy main loop. In order to avoid reading too much,
the loop is structured to detect zeros in aligned words from s2.
@@ -166,43 +187,54 @@ $u_head:
to run as fast as possible.
On entry to this basic block:
- t2 == the unshifted low-bits from the next s2 word. */
-
- .align 3
+ t2 == the unshifted low-bits from the next s2 word.
+ t10 == ofs of last byte in s1 last word.
+ t11 == ofs of last byte in s2 last word. */
+ .align 4
$u_loop:
extql t2, a1, t3 # e0 :
ldq_u t2, 16(a1) # .. e1 : load next s2 high bits
ldq_u t0, 8(a0) # e0 : load next s1 word
addq a1, 8, a1 # .. e1 :
+
addq a0, 8, a0 # e0 :
- nop # .. e1 :
+ subq a3, 1, a3 # .. e1 :
extqh t2, a1, t1 # e0 :
- cmpbge zero, t0, t7 # .. e1 : find zero in current s1 word
+ cmpbge zero, t0, t7 # .. e1 : eos in current s1 word
+
or t1, t3, t1 # e0 :
- beq a2, $eoc # .. e1 : check for end of count
+ beq a2, $eoc # .. e1 : eoc in current s1 word
subq a2, 1, a2 # e0 :
+ cmpbge zero, t2, t4 # .. e1 : eos in s2[1]
+
+ xor t0, t1, t3 # e0 : compare the words
+ ev6_unop
+ ev6_unop
bne t7, $eos # .. e1 :
- xor t0, t1, t4 # e0 : compare the words
- bne t4, $wordcmp # .. e1 (zdb)
- cmpbge zero, t2, t4 # e0 : find zero in next low bits
+
+ cmpeq a3, 0, t5 # e0 : eoc in s2[1]
+ ev6_unop
+ ev6_unop
+ bne t3, $wordcmp # .. e1 :
+
+ or t4, t5, t4 # e0 : eos or eoc in s2[1].
beq t4, $u_loop # .. e1 (zdb)
/* We've found a zero in the low bits of the last s2 word. Get
the next s1 word and align them. */
+ .align 3
$u_final:
- ldq_u t0, 8(a0) # e1 :
- extql t2, a1, t1 # .. e0 :
- cmpbge zero, t1, t7 # e0 :
- bne a2, $eos # .. e1 :
+ ldq_u t0, 8(a0)
+ extql t2, a1, t1
+ cmpbge zero, t1, t7
+ bne a2, $eos
/* We've hit end of count. Zero everything after the count
and compare whats left. */
-
.align 3
$eoc:
mskql t0, t10, t0
mskql t1, t10, t1
- unop
cmpbge zero, t1, t7
/* We've found a zero somewhere in a word we just read.
@@ -210,32 +242,31 @@ $eoc:
t0 == s1 word
t1 == s2 word
t7 == cmpbge mask containing the zero. */
-
+ .align 3
$eos:
- negq t7, t6 # e0 : create bytemask of valid data
- and t6, t7, t8 # e1 :
- subq t8, 1, t6 # e0 :
- or t6, t8, t7 # e1 :
- zapnot t0, t7, t0 # e0 : kill the garbage
- zapnot t1, t7, t1 # .. e1 :
- xor t0, t1, v0 # e0 : and compare
- beq v0, $done # .. e1 :
+ negq t7, t6 # create bytemask of valid data
+ and t6, t7, t8
+ subq t8, 1, t6
+ or t6, t8, t7
+ zapnot t0, t7, t0 # kill the garbage
+ zapnot t1, t7, t1
+ xor t0, t1, v0 # ... and compare
+ beq v0, $done
/* Here we have two differing co-aligned words in t0 & t1.
Bytewise compare them and return (t0 > t1 ? 1 : -1). */
.align 3
$wordcmp:
- cmpbge t0, t1, t2 # e0 : comparison yields bit mask of ge
- cmpbge t1, t0, t3 # .. e1 :
- xor t2, t3, t0 # e0 : bits set iff t0/t1 bytes differ
- negq t0, t1 # e1 : clear all but least bit
- and t0, t1, t0 # e0 :
- lda v0, -1 # .. e1 :
- and t0, t2, t1 # e0 : was bit set in t0 > t1?
- cmovne t1, 1, v0 # .. e1 (zdb)
-
+ cmpbge t0, t1, t2 # comparison yields bit mask of ge
+ cmpbge t1, t0, t3
+ xor t2, t3, t0 # bits set iff t0/t1 bytes differ
+ negq t0, t1 # clear all but least bit
+ and t0, t1, t0
+ lda v0, -1
+ and t0, t2, t1 # was bit set in t0 > t1?
+ cmovne t1, 1, v0
$done:
- ret # e1 :
+ ret
.align 3
$zerolength:
diff --git a/ports/sysdeps/alpha/stxcpy.S b/ports/sysdeps/alpha/stxcpy.S
index 46f19a985..c55d00589 100644
--- a/ports/sysdeps/alpha/stxcpy.S
+++ b/ports/sysdeps/alpha/stxcpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@tamu.edu)
This file is part of the GNU C Library.
@@ -43,22 +43,18 @@
.set noreorder
.text
+ .type __stxcpy, @function
+ .globl __stxcpy
+ .usepv __stxcpy, no
-/* There is a problem with either gdb (as of 4.16) or gas (as of 2.7) that
- doesn't like putting the entry point for a procedure somewhere in the
- middle of the procedure descriptor. Work around this by putting the
- aligned copy in its own procedure descriptor */
-
- .ent stxcpy_aligned
- .align 3
-stxcpy_aligned:
- .frame sp, 0, t9
- .prologue 0
+ cfi_startproc
+ cfi_return_column (t9)
/* On entry to this basic block:
t0 == the first destination word for masking back in
t1 == the first source word. */
-
+ .align 3
+stxcpy_aligned:
/* Create the 1st output word and detect 0's in the 1st input word. */
lda t2, -1 # e1 : build a mask against false zero
mskqh t2, a1, t2 # e0 : detection in the src word
@@ -72,7 +68,6 @@ stxcpy_aligned:
/* On entry to this basic block:
t0 == the first destination word for masking back in
t1 == a source word not containing a null. */
-
$a_loop:
stq_u t1, 0(a0) # e0 :
addq a0, 8, a0 # .. e1 :
@@ -106,15 +101,8 @@ $a_eos:
1: stq_u t1, 0(a0) # e0 :
ret (t9) # .. e1 :
- .end stxcpy_aligned
-
.align 3
- .ent __stxcpy
- .globl __stxcpy
__stxcpy:
- .frame sp, 0, t9
- .prologue 0
-
/* Are source and destination co-aligned? */
xor a0, a1, t0 # e0 :
unop # :
@@ -303,4 +291,4 @@ $unaligned:
stq_u t1, 0(a0) # .. e0 :
ret (t9)
- .end __stxcpy
+ cfi_endproc
diff --git a/ports/sysdeps/alpha/stxncpy.S b/ports/sysdeps/alpha/stxncpy.S
index 5b81ac907..d2cb9c3c9 100644
--- a/ports/sysdeps/alpha/stxncpy.S
+++ b/ports/sysdeps/alpha/stxncpy.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@tamu.edu)
This file is part of the GNU C Library.
@@ -52,22 +52,18 @@
.set noreorder
.text
+ .type __stxncpy, @function
+ .globl __stxncpy
+ .usepv __stxncpy, no
-/* There is a problem with either gdb (as of 4.16) or gas (as of 2.7) that
- doesn't like putting the entry point for a procedure somewhere in the
- middle of the procedure descriptor. Work around this by putting the
- aligned copy in its own procedure descriptor */
-
- .ent stxncpy_aligned
- .align 3
-stxncpy_aligned:
- .frame sp, 0, t9, 0
- .prologue 0
+ cfi_startproc
+ cfi_return_column (t9)
/* On entry to this basic block:
t0 == the first destination word for masking back in
t1 == the first source word. */
-
+ .align 3
+stxncpy_aligned:
/* Create the 1st output word and detect 0's in the 1st input word. */
lda t2, -1 # e1 : build a mask against false zero
mskqh t2, a1, t2 # e0 : detection in the src word
@@ -81,7 +77,6 @@ stxncpy_aligned:
/* On entry to this basic block:
t0 == a source word not containing a null. */
-
$a_loop:
stq_u t0, 0(a0) # e0 :
addq a0, 8, a0 # .. e1 :
@@ -98,7 +93,6 @@ $a_loop:
On entry to this basic block we have:
t0 == the source word containing the null
t7 == the cmpbge mask that found it. */
-
$a_eos:
negq t7, t8 # e0 : find low bit set
and t7, t8, t8 # e1 (stall)
@@ -126,26 +120,22 @@ $a_eoc:
or t10, t7, t7
br $a_eos
- .end stxncpy_aligned
-
.align 3
- .ent __stxncpy
- .globl __stxncpy
__stxncpy:
- .frame sp, 0, t9, 0
- .prologue 0
-
/* Are source and destination co-aligned? */
- xor a0, a1, t1 # e0 :
- and a0, 7, t0 # .. e1 : find dest misalignment
- and t1, 7, t1 # e0 :
- addq a2, t0, a2 # .. e1 : bias count by dest misalignment
- subq a2, 1, a2 # e0 :
- and a2, 7, t2 # e1 :
- srl a2, 3, a2 # e0 : a2 = loop counter = (count - 1)/8
- addq zero, 1, t10 # .. e1 :
- sll t10, t2, t10 # e0 : t10 = bitmask of last count byte
- bne t1, $unaligned # .. e1 :
+ lda t2, -1
+ xor a0, a1, t1
+ srl t2, 1, t2
+ and a0, 7, t0 # find dest misalignment
+ cmovlt a2, t2, a2 # bound neg count to LONG_MAX
+ and t1, 7, t1
+ addq a2, t0, a2 # bias count by dest misalignment
+ subq a2, 1, a2
+ and a2, 7, t2
+ srl a2, 3, a2 # a2 = loop counter = (count - 1)/8
+ addq zero, 1, t10
+ sll t10, t2, t10 # t10 = bitmask of last count byte
+ bne t1, $unaligned
/* We are co-aligned; take care of a partial first word. */
@@ -359,4 +349,4 @@ $unaligned:
stq_u t0, 0(a0) # e0 :
ret (t9) # .. e1 :
- .end __stxncpy
+ cfi_endproc
diff --git a/libc/sysdeps/x86_64/bits/string.h b/ports/sysdeps/unix/alpha/getegid.S
index 0ca5fe28d..a564f6c7a 100644
--- a/libc/sysdeps/x86_64/bits/string.h
+++ b/ports/sysdeps/unix/alpha/getegid.S
@@ -1,5 +1,4 @@
-/* Optimized, inlined string functions. AMD x86-64 version.
- Copyright (C) 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 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
@@ -13,13 +12,15 @@
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, see
+ License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _STRING_H
-# error "Never use <bits/string.h> directly; include <string.h> instead."
-#endif
+#include <sysdep.h>
-/* Currently the only purpose of this file is to tell the generic inline
- macros that unaligned memory access is possible for x86-64. */
-#define _STRING_ARCH_unaligned 1
+
+PSEUDO (__getegid, getxgid, 0)
+ MOVE (r1, r0)
+ ret
+PSEUDO_END (__getegid)
+
+weak_alias (__getegid, getegid)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/sys/perm.h b/ports/sysdeps/unix/alpha/geteuid.S
index c26868114..289acbd1e 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/sys/perm.h
+++ b/ports/sysdeps/unix/alpha/geteuid.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 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
@@ -12,24 +12,15 @@
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, see
+ License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _SYS_PERM_H
+#include <sysdep.h>
-#define _SYS_PERM_H 1
-#include <features.h>
-__BEGIN_DECLS
+PSEUDO (__geteuid, getxuid, 0)
+ MOVE (r1, r0)
+ ret
+PSEUDO_END (__geteuid)
-/* Set port input/output permissions. */
-extern int ioperm (unsigned long int __from, unsigned long int __num,
- int __turn_on) __THROW;
-
-
-/* Change I/O privilege level. */
-extern int iopl (int __level) __THROW;
-
-__END_DECLS
-
-#endif /* _SYS_PERM_H */
+weak_alias (__geteuid, geteuid)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/sys/reg.h b/ports/sysdeps/unix/alpha/getppid.S
index b993f999a..8f7e7746d 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/sys/reg.h
+++ b/ports/sysdeps/unix/alpha/getppid.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 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
@@ -12,31 +12,15 @@
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, see
+ License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _SYS_REG_H
-#define _SYS_REG_H 1
+#include <sysdep.h>
-/* Index into an array of 4 byte integers returned from ptrace for
- * location of the users' stored general purpose registers. */
-#define EBX 0
-#define ECX 1
-#define EDX 2
-#define ESI 3
-#define EDI 4
-#define EBP 5
-#define EAX 6
-#define DS 7
-#define ES 8
-#define FS 9
-#define GS 10
-#define ORIG_EAX 11
-#define EIP 12
-#define CS 13
-#define EFL 14
-#define UESP 15
-#define SS 16
+PSEUDO (__getppid, getxpid, 0)
+ MOVE (r1, r0)
+ ret
+PSEUDO_END (__getppid)
-#endif /* _SYS_REG_H */
+weak_alias (__getppid, getppid)
diff --git a/ports/sysdeps/unix/alpha/sysdep.h b/ports/sysdeps/unix/alpha/sysdep.h
index e17bf211b..4ee0746ac 100644
--- a/ports/sysdeps/unix/alpha/sysdep.h
+++ b/ports/sysdeps/unix/alpha/sysdep.h
@@ -71,6 +71,12 @@
.prologue 1
#endif /* PROF */
+#ifdef PROF
+# define USEPV_PROF std
+#else
+# define USEPV_PROF no
+#endif
+
#if RTLD_PRIVATE_ERRNO
# define SYSCALL_ERROR_LABEL $syscall_error
# define SYSCALL_ERROR_HANDLER \
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S b/ports/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
index 96069c72b..42062b084 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
+++ b/ports/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth@cygnus.com>, 1998
@@ -28,7 +28,7 @@
.text
ENTRY(__syscall_rt_sigaction)
- .frame sp,0,ra,0
+ cfi_startproc
ldgp gp,0(pv)
#ifdef PROF
.set noat
@@ -39,18 +39,12 @@ ENTRY(__syscall_rt_sigaction)
.prologue 1
beq a1, 0f
- ldl t0, 8(a1) # sa_flags
-
- /* The unwinder will subtract one from the return address when
- attempting to find the call instruction that led us here.
- Since we didn't get here via a normal call, if we do nothing
- we would pick up the wrong symbol and the wrong FDE. Account
- for this by adding a nop to the start of the function and
- then skipping it here by adding 4. */
- ldah a4, __syscall_sigreturn+4(gp) !gprelhigh
- ldah t1, __syscall_rt_sigreturn+4(gp) !gprelhigh
- lda a4, __syscall_sigreturn+4(a4) !gprellow
- lda t1, __syscall_rt_sigreturn+4(t1) !gprellow
+ ldl t0, 8(a1) # sa_flags
+
+ ldah a4, __syscall_sigreturn(gp) !gprelhigh
+ ldah t1, __syscall_rt_sigreturn(gp) !gprelhigh
+ lda a4, __syscall_sigreturn(a4) !gprellow
+ lda t1, __syscall_rt_sigreturn(t1) !gprellow
and t0, 0x40, t0 # SA_SIGINFO
cmovne t0, t1, a4
@@ -58,7 +52,7 @@ ENTRY(__syscall_rt_sigaction)
callsys
bne a3, SYSCALL_ERROR_LABEL
ret
-
+ cfi_endproc
PSEUDO_END(__syscall_rt_sigaction)
/* To enable unwinding through the signal frame without special hackery
@@ -90,26 +84,23 @@ PSEUDO_END(__syscall_rt_sigaction)
.endm
.align 4
- nop
- nop
- nop
cfi_startproc
cfi_return_column (64)
+ .cfi_signal_frame
SIGCONTEXT_REGS -648
cfi_def_cfa_offset (648)
__syscall_sigreturn:
- nop
mov sp, a0
ldi v0, __NR_sigreturn
callsys
.size __syscall_sigreturn, .-__syscall_sigreturn
.type __syscall_sigreturn, @function
+ .align 4
cfi_def_cfa_offset (176 + 648)
__syscall_rt_sigreturn:
- nop
mov sp,a0
ldi v0,__NR_rt_sigreturn
callsys
diff --git a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist
index eb54f653a..43015f4e9 100644
--- a/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist
+++ b/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist
@@ -1762,6 +1762,7 @@ GLIBC_2.15
GLIBC_2.16
GLIBC_2.16 A
__getauxval F
+ __mcount_internal F
__poll_chk F
__ppoll_chk F
aligned_alloc F