This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, ibm/2.8/master, updated. glibc-2.8-21-gfd178a7


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, ibm/2.8/master has been updated
       via  fd178a794dcd98b27b074cef2d72b16cade6ed2d (commit)
       via  11e1f64a3ed25433ff1e61ce361f4d26b262b9c3 (commit)
       via  57bfaad007444674ad3b06411662d097f92502bf (commit)
       via  3fc074ffb1c4c1dce50901f49e7b59768905a889 (commit)
       via  c78ee9626525b2f309a8136274c0aca74f17f070 (commit)
       via  0458691afa2a4df59125eb49769000c7016ed366 (commit)
       via  f66ecd702a6e58e54b50cf91ad86f7d269b1a92d (commit)
       via  b35745e509d6cd0939b1f97d4d46dcacc6e4b4d8 (commit)
       via  3353ea9028f569552e12bef515582a48c49100e0 (commit)
       via  c2621cbf6d0502ebbf27ea2e2165d8bfae6feb99 (commit)
       via  a14f7dce07b58c6af4d7af89eb596320ecee7f9b (commit)
       via  3385d53cf549e798489e03522344e318d3e684f7 (commit)
       via  e52b0ccf5d1e31f154572c0b7ccaf0dd1e592b50 (commit)
       via  cc9ed35042bd17054d266bbde08f42aa9ad77ba3 (commit)
       via  7bb672b9de470892efd5699d575fb057b4d9d4ee (commit)
       via  39581449dc4cb7fff696f2a847b9f8b6d49d0108 (commit)
       via  8645b695f1b7e4d17df66a204fa7514342da5acc (commit)
       via  edcdec2249c2e03ac30204d6f3270e7f3f6a31da (commit)
       via  590e37258c2da42c17404304515f9216afdc069b (commit)
      from  39546e34c289751c4614eb592ca43469431cd944 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=fd178a794dcd98b27b074cef2d72b16cade6ed2d

commit fd178a794dcd98b27b074cef2d72b16cade6ed2d
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:   Fri Jul 24 12:55:45 2009 -0500

    backport the pre glibc 2.10 patch which added -mcpu=<CPU> to ASFLAGS to the IBM 2.8 branch. It includes two merged patch sets.
    
    commit ed27dcf1bc22bb3b011bfefc392d6900c3bbeeb9
    Author: Ryan S. Arnold <rsa@us.ibm.com>
    Date:   Fri Jul 24 00:11:42 2009 -0500
    
    2009-05-09  Ulrich Drepper  <drepper@redhat.com>
    
    	* Makeconfig: Undo last change.  Add asflags-cpu to ASFLAGS in the
    	same place we add ASFLAGS-config.
    
    2009-05-06  Ryan S. Arnold  <rsa@us.ibm.com>
    
    	[BZ #10118]
    	* Makeconfig (+asflags): New variable based upon ASFLAG or
    	asflags-cpu.
    	(ASFLAGS): Add override to set ASFLAGS to +asflags.
    	* config.make.in (asflags-cpu): Add variable based upon
    	@libc_cv_cc_submachine@ to propagate -mcpu=CPU from --with-cpu=CPU to
    	the assembler.
    	* sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/setcontext.S:
    	Remove unneeded file now that the assembler emits _ARCH_PWR6 and
    	recognizes power6 instruction set due to passing -mcpu=power6 from
    	--with-cpu=power6 when compiling .S files.
    	* sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/swapcontext.S:
    	Likewise.
    	* sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/setcontext.S:
    	Likewise.
    	* sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/swapcontext.S:
    	Likewise.

diff --git a/Makeconfig b/Makeconfig
index d269936..ac381d4 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2003,2004,2005,2006,2007,2008
+# Copyright (C) 1991-2003,2004,2005,2006,2007,2008,2009
 #	Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
@@ -766,7 +766,7 @@ else
 ASFLAGS :=
 endif
 endif
-ASFLAGS += $(ASFLAGS-config)
+ASFLAGS += $(ASFLAGS-config) $(asflags-cpu)
 
 ifndef BUILD_CC
 BUILD_CC = $(CC)
diff --git a/config.make.in b/config.make.in
index 3fd0abc..7baec73 100644
--- a/config.make.in
+++ b/config.make.in
@@ -31,7 +31,8 @@ base-machine = @base_machine@
 config-vendor = @host_vendor@
 config-os = @host_os@
 config-sysdirs = @sysnames@
-with-cpu = @submachine@
+cflags-cpu = @libc_cv_cc_submachine@
+asflags-cpu = @libc_cv_cc_submachine@
 
 defines = @DEFINES@
 sysincludes = @SYSINCLUDES@
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/setcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/setcontext.S
deleted file mode 100644
index 7e44cdf..0000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/setcontext.S
+++ /dev/null
@@ -1,2 +0,0 @@
-#define _ARCH_PWR6
-#include_next <setcontext.S>
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/swapcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/swapcontext.S
deleted file mode 100644
index 616e3db..0000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/swapcontext.S
+++ /dev/null
@@ -1,2 +0,0 @@
-#define _ARCH_PWR6
-#include_next <swapcontext.S>
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/setcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/setcontext.S
deleted file mode 100644
index 7e44cdf..0000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/setcontext.S
+++ /dev/null
@@ -1,2 +0,0 @@
-#define _ARCH_PWR6
-#include_next <setcontext.S>
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/swapcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/swapcontext.S
deleted file mode 100644
index 616e3db..0000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/swapcontext.S
+++ /dev/null
@@ -1,2 +0,0 @@
-#define _ARCH_PWR6
-#include_next <swapcontext.S>

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=11e1f64a3ed25433ff1e61ce361f4d26b262b9c3

commit 11e1f64a3ed25433ff1e61ce361f4d26b262b9c3
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:   Fri Jul 24 12:42:07 2009 -0500

    Add new AT_BASE_PLATFORM bits to AUXV.
    
    commit f53713a8e729c441aef2b4ccc7562306fc306fbe
    Author: Ulrich Drepper <drepper@redhat.com>
    Date:   Sat Mar 14 18:33:58 2009 +0000
    
    	* elf/dl-sysdep.c (_dl_show_auxv): Add support for AT_BASE_PLATFORM.
    	* elf/dl-sysdep.c (auxvars): Compress data structure.

diff --git a/elf/dl-sysdep.c b/elf/dl-sysdep.c
index dd55905..ae720a7 100644
--- a/elf/dl-sysdep.c
+++ b/elf/dl-sysdep.c
@@ -265,34 +265,35 @@ _dl_show_auxv (void)
     {
       static const struct
       {
-	const char label[20];
-	enum { unknown = 0, dec, hex, str, ignore } form;
+	const char label[17];
+	enum { unknown = 0, dec, hex, str, ignore } form : 8;
       } auxvars[] =
 	{
-	  [AT_EXECFD - 2] =		{ "AT_EXECFD:       ", dec },
-	  [AT_PHDR - 2] =		{ "AT_PHDR:         0x", hex },
-	  [AT_PHENT - 2] =		{ "AT_PHENT:        ", dec },
-	  [AT_PHNUM - 2] =		{ "AT_PHNUM:        ", dec },
-	  [AT_PAGESZ - 2] =		{ "AT_PAGESZ:       ", dec },
-	  [AT_BASE - 2] =		{ "AT_BASE:         0x", hex },
-	  [AT_FLAGS - 2] =		{ "AT_FLAGS:        0x", hex },
-	  [AT_ENTRY - 2] =		{ "AT_ENTRY:        0x", hex },
-	  [AT_NOTELF - 2] =		{ "AT_NOTELF:       ", hex },
-	  [AT_UID - 2] =		{ "AT_UID:          ", dec },
-	  [AT_EUID - 2] =		{ "AT_EUID:         ", dec },
-	  [AT_GID - 2] =		{ "AT_GID:          ", dec },
-	  [AT_EGID - 2] =		{ "AT_EGID:         ", dec },
-	  [AT_PLATFORM - 2] =		{ "AT_PLATFORM:     ", str },
-	  [AT_HWCAP - 2] =		{ "AT_HWCAP:        ", hex },
-	  [AT_CLKTCK - 2] =		{ "AT_CLKTCK:       ", dec },
-	  [AT_FPUCW - 2] =		{ "AT_FPUCW:        ", hex },
-	  [AT_DCACHEBSIZE - 2] =	{ "AT_DCACHEBSIZE:  0x", hex },
-	  [AT_ICACHEBSIZE - 2] =	{ "AT_ICACHEBSIZE:  0x", hex },
-	  [AT_UCACHEBSIZE - 2] =	{ "AT_UCACHEBSIZE:  0x", hex },
-	  [AT_IGNOREPPC - 2] =		{ "AT_IGNOREPPC", ignore },
-	  [AT_SECURE - 2] =		{ "AT_SECURE:       ", dec },
-	  [AT_SYSINFO - 2] =		{ "AT_SYSINFO:      0x", hex },
-	  [AT_SYSINFO_EHDR - 2] =	{ "AT_SYSINFO_EHDR: 0x", hex },
+	  [AT_EXECFD - 2] =		{ "EXECFD:       ", dec },
+	  [AT_PHDR - 2] =		{ "PHDR:         0x", hex },
+	  [AT_PHENT - 2] =		{ "PHENT:        ", dec },
+	  [AT_PHNUM - 2] =		{ "PHNUM:        ", dec },
+	  [AT_PAGESZ - 2] =		{ "PAGESZ:       ", dec },
+	  [AT_BASE - 2] =		{ "BASE:         0x", hex },
+	  [AT_FLAGS - 2] =		{ "FLAGS:        0x", hex },
+	  [AT_ENTRY - 2] =		{ "ENTRY:        0x", hex },
+	  [AT_NOTELF - 2] =		{ "NOTELF:       ", hex },
+	  [AT_UID - 2] =		{ "UID:          ", dec },
+	  [AT_EUID - 2] =		{ "EUID:         ", dec },
+	  [AT_GID - 2] =		{ "GID:          ", dec },
+	  [AT_EGID - 2] =		{ "EGID:         ", dec },
+	  [AT_PLATFORM - 2] =		{ "PLATFORM:     ", str },
+	  [AT_HWCAP - 2] =		{ "HWCAP:        ", hex },
+	  [AT_CLKTCK - 2] =		{ "CLKTCK:       ", dec },
+	  [AT_FPUCW - 2] =		{ "FPUCW:        ", hex },
+	  [AT_DCACHEBSIZE - 2] =	{ "DCACHEBSIZE:  0x", hex },
+	  [AT_ICACHEBSIZE - 2] =	{ "ICACHEBSIZE:  0x", hex },
+	  [AT_UCACHEBSIZE - 2] =	{ "UCACHEBSIZE:  0x", hex },
+	  [AT_IGNOREPPC - 2] =		{ "IGNOREPPC", ignore },
+	  [AT_SECURE - 2] =		{ "SECURE:       ", dec },
+	  [AT_BASE_PLATFORM - 2] =	{ "BASE_PLATFORM:", str },
+	  [AT_SYSINFO - 2] =		{ "SYSINFO:      0x", hex },
+	  [AT_SYSINFO_EHDR - 2] =	{ "SYSINFO_EHDR: 0x", hex },
 	};
       unsigned int idx = (unsigned int) (av->a_type - 2);
 
@@ -321,7 +322,7 @@ _dl_show_auxv (void)
 	    val = _itoa ((unsigned long int) av->a_un.a_val,
 			 buf + sizeof buf - 1, 16, 0);
 
-	  _dl_printf ("%s%s\n", auxvars[idx].label, val);
+	  _dl_printf ("AT_%s%s\n", auxvars[idx].label, val);
 
 	  continue;
 	}
diff --git a/locale/iso-639.def b/locale/iso-639.def
index 68a4c5e..12cbbd0 100644
--- a/locale/iso-639.def
+++ b/locale/iso-639.def
@@ -301,6 +301,7 @@ DEFINE_LANGUAGE_CODE3 ("Mayan languages", myn, myn)
 DEFINE_LANGUAGE_CODE3 ("Mende", men, men)
 DEFINE_LANGUAGE_CODE3 ("Mi'kmaq; Micmac", mic, mic)
 DEFINE_LANGUAGE_CODE3 ("Minangkabau", min, min)
+DEFINE_LANGUAGE_CODE3 ("Min Nan", nan, nan)
 DEFINE_LANGUAGE_CODE3 ("Mirandese", mwl, mwl)
 DEFINE_LANGUAGE_CODE3 ("Miscellaneous languages", mis, mis)
 DEFINE_LANGUAGE_CODE3 ("Mohawk", moh, moh)
diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
index e97c1a4..884dd71 100644
--- a/localedata/SUPPORTED
+++ b/localedata/SUPPORTED
@@ -283,6 +283,7 @@ ms_MY.UTF-8/UTF-8 \
 ms_MY/ISO-8859-1 \
 mt_MT.UTF-8/UTF-8 \
 mt_MT/ISO-8859-3 \
+nan_TW@latin/UTF-8 \
 nb_NO.UTF-8/UTF-8 \
 nb_NO/ISO-8859-1 \
 nds_DE/UTF-8 \
diff --git a/localedata/locales/nan_TW@latin b/localedata/locales/nan_TW@latin
new file mode 100644
index 0000000..bf8a6cd
--- /dev/null
+++ b/localedata/locales/nan_TW@latin
@@ -0,0 +1,205 @@
+comment_char %
+escape_char  /
+%
+% Minnan Language Locale for Taiwan
+% Source:
+% Contact: Arne Goetje
+% Email: arne@ubuntu.com
+% Language: nan
+% Territory: TW
+% Revision: 0.1
+% Date: 2008-06-16
+% Users: general
+% Charset: UTF-8
+% Distribution and use is free, also
+% for commercial purposes.
+
+LC_IDENTIFICATION
+title "Minnan language locale for Taiwan"
+source ""
+address ""
+contact "Arne Goetje"
+email "arne@canonical.com"
+tel ""
+fax ""
+language "Minnan"
+territory "Taiwan"
+revision "0.1"
+date "2008-06-16"
+
+category "nan_TW@latin:2000";LC_IDENTIFICATION
+category "nan_TW@latin:2000";LC_CTYPE
+category "nan_TW@latin:2000";LC_COLLATE
+category "nan_TW@latin:2000";LC_TIME
+category "nan_TW@latin:2000";LC_NUMERIC
+category "nan_TW@latin:2000";LC_PAPER
+category "nan_TW@latin:2000";LC_TELEPHONE
+category "nan_TW@latin:2000";LC_MEASUREMENT
+category "nan_TW@latin:2000";LC_ADDRESS
+category "nan_TW@latin:2000";LC_MESSAGES
+category "nan_TW@latin:2000";LC_MONETARY
+
+END LC_IDENTIFICATION
+
+LC_CTYPE
+copy "i18n"
+
+translit_start
+
+% accents are simply omitted if they cannot be represented.
+include "translit_combining";""
+
+translit_end
+
+END LC_CTYPE
+
+LC_COLLATE
+copy "iso14651_t1"
+
+%% a b c d e f g h i j k l m n o oÍ? p q r s t u v w x y z â?¿
+
+collating-element <oo> from "<U006F><U0358>"
+collating-element <OO> from "<U004F><U0358>"
+collating-element <nn> from "<U207F>"
+
+collating-symbol <CAP-MIN>
+collating-symbol <MIN-CAP>
+
+reorder-after <MIN>
+<MIN-CAP>
+reorder-after <CAP>
+<CAP-MIN>
+
+reorder-after <U006E>
+<oo>
+reorder-after <U004E>
+<OO>
+reorder-after <U007A>
+<nn>
+reorder-after <U005A>
+<nn>
+
+reorder-end
+
+END LC_COLLATE
+
+LC_MONETARY
+copy "zh_TW"
+END LC_MONETARY
+
+LC_NUMERIC
+copy "zh_TW"
+END LC_NUMERIC
+
+LC_TIME
+abday   "<U006C><U0070>";/
+	"<U0070><U0031>";/
+	"<U0070><U0032>";/
+	"<U0070><U0033>";/
+	"<U0070><U0034>";/
+	"<U0070><U0035>";/
+	"<U0070><U0036>"
+day     "<U006C><U00E9><U002D><U0070><U00E0><U0069><U002D><U006A><U0069><U030D><U0074>";/
+        "<U0070><U00E0><U0069><U002D><U0069><U0074>";/
+        "<U0070><U00E0><U0069><U002D><U006A><U012B>";/
+        "<U0070><U00E0><U0069><U002D><U0073><U0061><U207F>";/
+        "<U0070><U00E0><U0069><U002D><U0073><U00EC>";/
+        "<U0070><U00E0><U0069><U002D><U0067><U014D><U0358>";/
+        "<U0070><U00E0><U0069><U002D><U006C><U0061><U030D><U006B>"
+abmon   "<U0031><U0067>";/
+	"<U0032><U0067>";/
+	"<U0033><U0067>";/
+	"<U0034><U0067>";/
+	"<U0035><U0067>";/
+	"<U0036><U0067>";/
+	"<U0037><U0067>";/
+	"<U0038><U0067>";/
+	"<U0039><U0067>";/
+	"<U0031><U0030><U0067>";/
+	"<U0031><U0031><U0067>";/
+	"<U0031><U0032><U0067>"
+mon     "<U0031><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0032><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0033><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0034><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0035><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0036><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0037><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0038><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0039><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0031><U0030><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0031><U0031><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0031><U0032><U0067><U006F><U0065><U030D><U0068>"
+%
+d_t_fmt    "<U0025><U0059><U0020><U0025><U0062><U0020><U0025><U0064><U0020><U0028><U0025><U0061><U0029><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A>"
+d_fmt       "<U0025><U0046>"
+t_fmt       "<U0025><U0072>"
+am_pm       "<U0074><U00E9><U006E><U0067><U002D><U0070><U006F><U0358>";"<U0113><U002D><U0070><U006F><U0358>"
+t_fmt_ampm  "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
+timezone    "<U0054><U0053><U0054><U002D><U0038>"
+date_fmt    "<U0025><U0059><U0020><U0025><U0062><U0020><U0025><U0064><U0020><U0028><U0025><U0061><U0029><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A>"
+END LC_TIME
+
+LC_MESSAGES
+
+% "^[sS].*" for "Yes"
+yesexpr "<U005E><U005B><U0073><U0053><U005D><U002E><U002A>"
+
+% "^[mM].*" for "No"
+noexpr "<U005E><U005B><U006D><U004D><U005D><U002E><U002A>"
+
+% "SÄ«" for "Yes"
+yesstr "<U0053><U012B>"
+
+% "MÌ?-sÄ«" for "No"
+nostr "<U004D><U0304><U002D><U0053><U012B>"
+
+END LC_MESSAGES
+
+LC_PAPER
+height      297
+width       210
+END LC_PAPER
+
+LC_MEASUREMENT
+measurement 1
+END LC_MEASUREMENT
+
+LC_NAME
+%FIXME
+name_fmt    "<U0025><U0064><U0025><U0074><U0025><U0067><U0025><U0074>/
+<U0025><U006D><U0025><U0074><U0025><U0066>"
+name_miss   "<U006B><U006F><U0358><U002D><U006E><U0069><U00FB>"
+name_mr     "<U0073><U0069><U0061><U006E><U002D><U0073><U0069><U207F>"
+name_mrs    "<U006C><U00FA><U002D><U0073><U016B>"
+name_ms     "<U0073><U0069><U00F3><U002D><U0063><U0068><U0069><U00E1>"
+END LC_NAME
+
+LC_ADDRESS
+% postal_fmt: "%f%N%a%N%d%N%b%N%r %e %h %s%N%z %T%N%c%N"
+postal_fmt    "<U0025><U0066><U0025><U004E><U0025><U0061><U0025><U004E>/
+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0072>/
+<U0020><U0025><U0065><U0020><U0025><U0068><U0020><U0025><U0073><U0025>/
+<U004E><U0025><U007A><U0020><U0025><U0054><U0025>/
+<U004E><U0025><U0063><U0025><U004E>"
+% Reference:	http://www.un.org/Depts/unsd/methods/m49alpha.htm
+%		http://www.isbn.spk-berlin.de/html/prefix.htm
+% country_ab2:	TW
+% country_ab3:	TWN
+% country_isbn:	957
+country_name	"<U0054><U00E2><U0069><U002D><U006F><U00E2><U006E>"
+%country_post	"FIXME"
+country_ab2	"<U0054><U0057>"
+country_ab3	"<U0054><U0057><U004E>"
+country_num	158
+%country_car    "FIXME"
+country_isbn	"<U0039><U0035><U0037>"
+%lang_name "Bân-lâm-gú, HÅ?-ló-oÄ?"
+lang_name "<U0042><U00E2><U006E><U002D><U006C><U00E2><U006D><U002D><U0067><U00FA><U002C><U0020><U0048><U014D><U002D><U006C><U00F3><U002D><U006F><U0113>"
+lang_term "<U006E><U0061><U006E>"
+lang_lib "<U006E><U0061><U006E>"
+END LC_ADDRESS
+
+LC_TELEPHONE
+copy "zh_TW"
+END LC_TELEPHONE

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=57bfaad007444674ad3b06411662d097f92502bf

commit 57bfaad007444674ad3b06411662d097f92502bf
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:   Fri Jul 24 12:37:12 2009 -0500

    Fix mixed up PPC_FEATURE_* values related to VSX.
    
    REALLY DID remove redundant mathinline.h this time.
    
    commit 2123d5815eaaa53a772be4b6069bdc6332f2f491
    Author: Andreas Schwab <aschwab@redhat.com>
    Date:   Sun Jul 5 23:46:03 2009 -0700
    
    Fix wrong PPC_FEATURE_* values.
    
    Nothing uses these wrong values yet, but it fixes a warning due to
    conflicting definitions in <asm/cputable.h>.

diff --git a/sysdeps/powerpc/sysdep.h b/sysdeps/powerpc/sysdep.h
index 43edeb7..f5c79c5 100644
--- a/sysdeps/powerpc/sysdep.h
+++ b/sysdeps/powerpc/sysdep.h
@@ -44,8 +44,8 @@
 #define PPC_FEATURE_PA6T		0x00000800 /* PA Semi 6T Core */
 #define PPC_FEATURE_HAS_DFP		0x00000400 /* Decimal FP Unit */
 #define PPC_FEATURE_POWER6_EXT		0x00000200 /* P6 + mffgpr/mftgpr */
-#define PPC_FEATURE_HAS_VSX		0x00000100 /* P7 Vector Extension.  */
-#define PPC_FEATURE_ARCH_2_06	        0x00000080 /* ISA 2.06 */
+#define PPC_FEATURE_ARCH_2_06	        0x00000100 /* ISA 2.06 */
+#define PPC_FEATURE_HAS_VSX		0x00000080 /* P7 Vector Extension.  */
 #define PPC_FEATURE_970 (PPC_FEATURE_POWER4 + PPC_FEATURE_HAS_ALTIVEC)
 
 #ifdef __ASSEMBLER__
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/mathinline.h b/sysdeps/unix/sysv/linux/powerpc/bits/mathinline.h
deleted file mode 100644
index 4fa4bca..0000000
--- a/sysdeps/unix/sysv/linux/powerpc/bits/mathinline.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/* Inline math functions for powerpc.
-   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2004, 2006, 2007, 2008
-   Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#ifndef _MATH_H
-# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
-#endif
-
-#ifndef __extern_inline
-# define __MATH_INLINE __inline
-#else
-# define __MATH_INLINE __extern_inline
-#endif  /* __cplusplus */
-
-#if defined __GNUC__ && !defined _SOFT_FLOAT
-
-#ifdef __USE_ISOC99
-# if !__GNUC_PREREQ (2,97)
-#  define __unordered_cmp(x, y) \
-  (__extension__							      \
-   ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);			      \
-      unsigned __r;							      \
-      __asm__("fcmpu 7,%1,%2 ; mfcr %0" : "=r" (__r) : "f" (__x), "f"(__y)    \
-              : "cr7");  \
-      __r; }))
-
-#  undef isgreater
-#  undef isgreaterequal
-#  undef isless
-#  undef islessequal
-#  undef islessgreater
-#  undef isunordered
-
-#  define isgreater(x, y) (__unordered_cmp (x, y) >> 2 & 1)
-#  define isgreaterequal(x, y) ((__unordered_cmp (x, y) & 6) != 0)
-#  define isless(x, y) (__unordered_cmp (x, y) >> 3 & 1)
-#  define islessequal(x, y) ((__unordered_cmp (x, y) & 0xA) != 0)
-#  define islessgreater(x, y) ((__unordered_cmp (x, y) & 0xC) != 0)
-#  define isunordered(x, y) (__unordered_cmp (x, y) & 1)
-
-# endif /* __GNUC_PREREQ (2,97) */
-
-/* The gcc, version 2.7 or below, has problems with all this inlining
-   code.  So disable it for this version of the compiler.  */
-# if __GNUC_PREREQ (2, 8)
-/* Test for negative number.  Used in the signbit() macro.  */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
-  __extension__ union { float __f; int __i; } __u = { __f: __x };
-  return __u.__i < 0;
-}
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
-  __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
-  return __u.__i[0] < 0;
-}
-#  ifdef __LONG_DOUBLE_128__
-__MATH_INLINE int
-__NTH (__signbitl (long double __x))
-{
-  __extension__ union { long double __d; int __i[4]; } __u = { __d: __x };
-  return __u.__i[0] < 0;
-}
-#  endif
-# endif
-#endif /* __USE_ISOC99 */
-
-#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
-
-#ifdef __USE_ISOC99
-
-# ifndef __powerpc64__
-__MATH_INLINE long int lrint (double __x) __THROW;
-__MATH_INLINE long int
-__NTH (lrint (double __x))
-{
-  union {
-    double __d;
-    int __ll[2];
-  } __u;
-  __asm__ ("fctiw %0,%1" : "=f"(__u.__d) : "f"(__x));
-  return __u.__ll[1];
-}
-
-__MATH_INLINE long int lrintf (float __x) __THROW;
-__MATH_INLINE long int
-__NTH (lrintf (float __x))
-{
-  union {
-    double __d;
-    int __ll[2];
-  } __u;
-  __asm__ ("fctiw %0,%1" : "=f"(__u.__d) : "f"(__x));
-  return __u.__ll[1];
-}
-# endif
-
-__MATH_INLINE double fdim (double __x, double __y) __THROW;
-__MATH_INLINE double
-__NTH (fdim (double __x, double __y))
-{
-  return __x <= __y ? 0 : __x - __y;
-}
-
-__MATH_INLINE float fdimf (float __x, float __y) __THROW;
-__MATH_INLINE float
-__NTH (fdimf (float __x, float __y))
-{
-  return __x <= __y ? 0 : __x - __y;
-}
-
-#endif /* __USE_ISOC99 */
-#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
-#endif /* __GNUC__ && !_SOFT_FLOAT */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3fc074ffb1c4c1dce50901f49e7b59768905a889

commit 3fc074ffb1c4c1dce50901f49e7b59768905a889
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:   Fri Jul 24 12:34:13 2009 -0500

    Fixed up sed invocation to work with newer linker scripts.
    
    Also committed changes from previous patch set which removed redundant
    mathinline.h file.
    
    commit 7c8a67320e26b8c11108bf0a3410d3aef9cf3486
    Author: Ulrich Drepper <drepper@redhat.com>
    Date:   Sat Jan 31 00:21:15 2009 +0000
    
            * elf/Makefile (ld.so): Adjust the sed script to insert _begin in to
            newer linker scripts.

diff --git a/ChangeLog b/ChangeLog
index 873ddb6..9af5191 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6673,6 +6673,14 @@
 
 2006-10-06  Ulrich Drepper  <drepper@redhat.com>
 
+	* sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Declare fallocate{,64}.
+	* sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Likewise.
+
 	* po/pl.po: Update from translation team.
 
 	* nscd/nscd.c (main): Fix typo in message.
diff --git a/elf/Makefile b/elf/Makefile
index 861485d..2c0f68f 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1995-2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 1995-2007, 2008, 2009 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -299,7 +299,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
 		  $(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 |	\
 		  LC_ALL=C \
 		  sed -e '/^=========/,/^=========/!d;/^=========/d'	\
-		      -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
+		      -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
 		  > $@.lds
 	$(LINK.o) -nostdlib -nostartfiles -shared -o $@			\
 		  $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now))	\

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c78ee9626525b2f309a8136274c0aca74f17f070

commit c78ee9626525b2f309a8136274c0aca74f17f070
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:   Fri Jul 24 12:31:41 2009 -0500

    POWER7 powerpc-cpu support for optimized libraries.
    
    commit 134a97667f1d50963af87713840ffd2efddfc1f2
    Author: Ulrich Drepper <drepper@redhat.com>
    Date:   Mon Mar 2 13:50:16 2009 +0000
    
    	* sysdeps/powerpc/powerpc32/power7/fpu/Implies: New file.
    	* sysdeps/powerpc/powerpc32/power7/Implies: Likewise.
    	* sysdeps/powerpc/powerpc64/power7/fpu/Implies: Likewise.
    	* sysdeps/powerpc/powerpc64/power7/Implies: Likewise.
    	* sysdeps/unix/sysv/linux/powerpc/powerpc32/power7/fpu/Implies:
    	Likewise.
    	* sysdeps/unix/sysv/linux/powerpc/powerpc64/power7/fpu/Implies:
    	Likewise.

diff --git a/sysdeps/powerpc/powerpc32/power7/Implies b/sysdeps/powerpc/powerpc32/power7/Implies
new file mode 100644
index 0000000..03899d8
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/power7/Implies
@@ -0,0 +1 @@
+powerpc/powerpc32/power5
diff --git a/sysdeps/powerpc/powerpc64/power7/Implies b/sysdeps/powerpc/powerpc64/power7/Implies
new file mode 100644
index 0000000..13b0330
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power7/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/power5
diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/Implies b/sysdeps/powerpc/powerpc64/power7/fpu/Implies
new file mode 100644
index 0000000..13b0330
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power7/fpu/Implies
@@ -0,0 +1 @@
+powerpc/powerpc64/power5
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/power7/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/power7/fpu/Implies
new file mode 100644
index 0000000..d379a2d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/power7/fpu/Implies
@@ -0,0 +1,3 @@
+# Make sure this comes before the powerpc/powerpc32/fpu that's
+# listed in unix/sysv/linux/powerpc/powerpc32/fpu/Implies.
+powerpc/powerpc32/power5/fpu
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/power7/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/power7/fpu/Implies
new file mode 100644
index 0000000..c46b3d4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/power7/fpu/Implies
@@ -0,0 +1,3 @@
+# Make sure this comes before the powerpc/powerpc64/fpu that's
+# listed in unix/sysv/linux/powerpc/powerpc64/fpu/Implies.
+powerpc/powerpc64/power5/fpu

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0458691afa2a4df59125eb49769000c7016ed366

commit 0458691afa2a4df59125eb49769000c7016ed366
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:   Fri Jul 24 12:28:57 2009 -0500

    POWER7 VSX HWCAP enablement.
    
    commit 1642331d3066e43daea5a33a6c12db6edf0e34f7
    Author: Ulrich Drepper <drepper@redhat.com>
    Date:   Fri Aug 8 04:51:57 2008 +0000
    
    2008-08-01  Steven Munroe  <sjmunroe@us.ibm.com>
                Carlos Eduardo Seo  <cseo@linux.vnet.ibm.com>
    
    	[BZ #6817]
    	* sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_cap_flags):
    	Added the members 'vsx' and 'arch_2_06'.
    	(_dl_powerpc_platforms): Add the member 'power7'.
    	* sysdeps/powerpc/dl-procinfo.h: Modify _DL_HWCAP_FIRST
    	to reflect the changes required by VSX and ISA 2.06.
    	Modify _DL_PLATFORMS_COUNT to reflect the addition of
    	'power7'.
    	Defined PPC_PLATFORM_POWER7.
    	(_dl_string_platform): Add support for POWER7.
    	* sysdeps/powerpc/sysdep.h: Define bit masks for VSX
    	capability and ISA 2.06.

diff --git a/sysdeps/powerpc/dl-procinfo.c b/sysdeps/powerpc/dl-procinfo.c
index a732e94..325bf67 100644
--- a/sysdeps/powerpc/dl-procinfo.c
+++ b/sysdeps/powerpc/dl-procinfo.c
@@ -46,11 +46,12 @@
 #if !defined PROCINFO_DECL && defined SHARED
   ._dl_powerpc_cap_flags
 #else
-PROCINFO_CLASS const char _dl_powerpc_cap_flags[23][10]
+PROCINFO_CLASS const char _dl_powerpc_cap_flags[25][10]
 #endif
 #ifndef PROCINFO_DECL
 = {
-    "power6x", "dfp", "pa6t",
+    "vsx",
+    "arch_2_06", "power6x", "dfp", "pa6t",
     "arch_2_05", "ic_snoop", "smt", "booke",
     "cellbe", "power5+", "power5", "power4",
     "notb", "efpdouble", "efpsingle", "spe",
@@ -67,7 +68,7 @@ PROCINFO_CLASS const char _dl_powerpc_cap_flags[23][10]
 #if !defined PROCINFO_DECL && defined SHARED
   ._dl_powerpc_platforms
 #else
-PROCINFO_CLASS const char _dl_powerpc_platforms[7][12]
+PROCINFO_CLASS const char _dl_powerpc_platforms[8][12]
 #endif
 #ifndef PROCINFO_DECL
 = {
@@ -77,7 +78,8 @@ PROCINFO_CLASS const char _dl_powerpc_platforms[7][12]
     [PPC_PLATFORM_POWER5_PLUS] = "power5+",
     [PPC_PLATFORM_POWER6] = "power6",
     [PPC_PLATFORM_CELL_BE] = "ppc-cell-be",
-    [PPC_PLATFORM_POWER6X] = "power6x"
+    [PPC_PLATFORM_POWER6X] = "power6x",
+    [PPC_PLATFORM_POWER7] = "power7"
   }
 #endif
 #if !defined SHARED || defined PROCINFO_DECL
diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h
index 0bf9353..254195a 100644
--- a/sysdeps/powerpc/dl-procinfo.h
+++ b/sysdeps/powerpc/dl-procinfo.h
@@ -23,15 +23,15 @@
 #include <ldsodefs.h>
 #include <sysdep.h>		/* This defines the PPC_FEATURE_* macros.  */
 
-/* There are 20 bits used, but they are bits 12..31.  */
-#define _DL_HWCAP_FIRST		9
+/* There are 25 bits used, but they are bits 7..31.  */
+#define _DL_HWCAP_FIRST		7
 #define _DL_HWCAP_COUNT		32
 
 /* These bits influence library search.  */
 #define HWCAP_IMPORTANT		(PPC_FEATURE_HAS_ALTIVEC \
 				+ PPC_FEATURE_HAS_DFP)
 
-#define _DL_PLATFORMS_COUNT	7
+#define _DL_PLATFORMS_COUNT	8
 
 #define _DL_FIRST_PLATFORM      32
 /* Mask to filter out platforms.  */
@@ -46,6 +46,7 @@
 #define PPC_PLATFORM_POWER6		4
 #define PPC_PLATFORM_CELL_BE		5
 #define PPC_PLATFORM_POWER6X		6
+#define PPC_PLATFORM_POWER7		7
 
 static inline const char *
 __attribute__ ((unused))
@@ -103,6 +104,9 @@ _dl_string_platform (const char *str)
 	      ++str;
 	    }
 	  break;
+	case '7':
+	  ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER7;
+	  break;
 	default:
 	  return -1;
 	}
diff --git a/sysdeps/powerpc/sysdep.h b/sysdeps/powerpc/sysdep.h
index 2ae52b7..43edeb7 100644
--- a/sysdeps/powerpc/sysdep.h
+++ b/sysdeps/powerpc/sysdep.h
@@ -44,6 +44,8 @@
 #define PPC_FEATURE_PA6T		0x00000800 /* PA Semi 6T Core */
 #define PPC_FEATURE_HAS_DFP		0x00000400 /* Decimal FP Unit */
 #define PPC_FEATURE_POWER6_EXT		0x00000200 /* P6 + mffgpr/mftgpr */
+#define PPC_FEATURE_HAS_VSX		0x00000100 /* P7 Vector Extension.  */
+#define PPC_FEATURE_ARCH_2_06	        0x00000080 /* ISA 2.06 */
 #define PPC_FEATURE_970 (PPC_FEATURE_POWER4 + PPC_FEATURE_HAS_ALTIVEC)
 
 #ifdef __ASSEMBLER__

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f66ecd702a6e58e54b50cf91ad86f7d269b1a92d

commit f66ecd702a6e58e54b50cf91ad86f7d269b1a92d
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:   Fri Jul 24 12:24:32 2009 -0500

    Remove redundant mathinline.h.
    
    commit 7df49c5d81b9f8ea55f16af939e0662d24cc099e
    Author: Ulrich Drepper <drepper@redhat.com>
    Date:   Sun Aug 17 07:34:10 2008 +0000
    
    2008-08-14  Ryan S. Arnold  <rsa@us.ibm.com>
    
    	[BZ #6845]
    	* sysdeps/powerpc/fpu/bits/mathinline.h (__signbitl): Copy new
    	__signbitl definition and __LONG_DOUBLE_128__ guard from:
    	* sysdeps/unix/sysv/linux/powerpc/bits/mathinline.h: Remove as
    	redundant.  Functions which call floating point assembler operations
    	should go into a sysdeps powerpc/fpu directory.

diff --git a/sysdeps/powerpc/fpu/bits/mathinline.h b/sysdeps/powerpc/fpu/bits/mathinline.h
index 4d4612d..4fa4bca 100644
--- a/sysdeps/powerpc/fpu/bits/mathinline.h
+++ b/sysdeps/powerpc/fpu/bits/mathinline.h
@@ -1,5 +1,5 @@
 /* Inline math functions for powerpc.
-   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2004, 2006, 2007
+   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2004, 2006, 2007, 2008
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -72,6 +72,14 @@ __NTH (__signbit (double __x))
   __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
   return __u.__i[0] < 0;
 }
+#  ifdef __LONG_DOUBLE_128__
+__MATH_INLINE int
+__NTH (__signbitl (long double __x))
+{
+  __extension__ union { long double __d; int __i[4]; } __u = { __d: __x };
+  return __u.__i[0] < 0;
+}
+#  endif
 # endif
 #endif /* __USE_ISOC99 */
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b35745e509d6cd0939b1f97d4d46dcacc6e4b4d8

commit b35745e509d6cd0939b1f97d4d46dcacc6e4b4d8
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:   Fri Jul 24 12:21:48 2009 -0500

    Fix to avoid using the fields 3 and 4 of the CR.
    
    commit 9ea8bfec35c54cb5769209227d94ab61f9efb935
    Author: Ulrich Drepper <drepper@redhat.com>
    Date:   Fri Jun 13 01:18:22 2008 +0000
    
    	* sysdeps/powerpc/powerpc64/fpu/s_llround.S (__llround): Avoid using
    	cr[34] registers.
    	* sysdeps/powerpc/powerpc64/fpu/s_llroundf.S (__llroundf): Likewise.
    	* sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S (__llround):
    	Likewise.
    	* sysdeps/powerpc/powerpc32/fpu/s_lround.S (__lround): Avoid using cr3
    	register.
    
    2008-06-12  Ulrich Drepper  <drepper@redhat.com>
    
    	* nscd/nscd.h (struct database_dyn): Add inotify_descr and clear_cache

diff --git a/sysdeps/powerpc/powerpc32/fpu/s_lround.S b/sysdeps/powerpc/powerpc32/fpu/s_lround.S
index ebacccc..d73749e 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_lround.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_lround.S
@@ -1,5 +1,5 @@
 /* lround function.  PowerPC32 version.
-   Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2007, 2008 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
@@ -65,10 +65,10 @@ ENTRY (__lround)
 	fabs	fp2, fp1	/* Get the absolute value of x.  */
 	fsub	fp12,fp10,fp10	/* Compute 0.0.  */
 	fcmpu	cr6, fp2, fp10	/* if |x| < 0.5  */
-	fcmpu	cr3, fp1, fp12	/* x is negative? x < 0.0  */
+	fcmpu	cr7, fp1, fp12	/* x is negative? x < 0.0  */
 	blt-	cr6,.Lretzero
 	fadd	fp3,fp2,fp10	/* |x|+=0.5 bias to prepare to round.  */
-	bge	cr3,.Lconvert	/* x is positive so don't negate x.  */
+	bge	cr7,.Lconvert	/* x is positive so don't negate x.  */
 	fnabs	fp3,fp3		/* -(|x|+=0.5)  */ 
 .Lconvert:
 	fctiwz	fp4,fp3		/* Convert to Integer word lround toward 0.  */
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S b/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S
index 4b1691e..e10a379 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S
@@ -1,5 +1,5 @@
 /* llround function.  PowerPC32 on PowerPC64 version.
-   Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2007, 2008 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
@@ -75,12 +75,12 @@ ENTRY (__llround)
 	fabs	fp2,fp1		/* Get the absolute value of x.  */
 	fsub	fp12,fp10,fp10	/* Compute 0.0 into fpr12.  */
 	fcmpu	cr6,fp2,fp10	/* if |x| < 0.5  */
-	fcmpu	cr4,fp2,fp9	/* if |x| >= 2^52  */
-	fcmpu	cr3,fp1,fp12	/* x is negative? x < 0.0  */
+	fcmpu	cr7,fp2,fp9	/* if |x| >= 2^52  */
+	fcmpu	cr1,fp1,fp12	/* x is negative? x < 0.0  */
 	blt-	cr6,.Lretzero	/* 0.5 > x < -0.5 so just return 0.  */
-	bge-	cr4,.Lnobias	/* 2^52 > x < -2^52 just convert with no bias.  */
+	bge-	cr7,.Lnobias	/* 2^52 > x < -2^52 just convert with no bias.  */
 	fadd	fp3,fp2,fp10	/* |x|+=0.5 bias to prepare to round.  */
-	bge	cr3,.Lconvert	/* x is positive so don't negate x.  */
+	bge	cr1,.Lconvert	/* x is positive so don't negate x.  */
 	fnabs	fp3,fp3		/* -(|x|+=0.5)  */
 .Lconvert:
 	fctidz	fp4,fp3		/* Convert to Integer double word round toward 0.  */
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_llround.S b/sysdeps/powerpc/powerpc64/fpu/s_llround.S
index 4134847..cdfdd02 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_llround.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_llround.S
@@ -1,5 +1,5 @@
 /* llround function.  PowerPC64 version.
-   Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2007, 2008 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
@@ -52,12 +52,12 @@ ENTRY (__llround)
 	fabs	fp2,fp1		/* Get the absolute value of x.  */
 	fsub	fp12,fp10,fp10	/* Compute 0.0 into fp12.  */
 	fcmpu	cr6,fp2,fp10	/* if |x| < 0.5  */
-	fcmpu	cr4,fp2,fp9	/* if |x| >= 2^52  */
-	fcmpu	cr3,fp1,fp12	/* x is negative? x < 0.0  */
+	fcmpu	cr7,fp2,fp9	/* if |x| >= 2^52  */
+	fcmpu	cr1,fp1,fp12	/* x is negative? x < 0.0  */
 	blt-	cr6,.Lretzero	/* 0.5 > x < -0.5 so just return 0.  */
-	bge-	cr4,.Lnobias	/* 2^52 > x < -2^52 just convert with no bias.  */
+	bge-	cr7,.Lnobias	/* 2^52 > x < -2^52 just convert with no bias.  */
 	fadd	fp3,fp2,fp10	/* |x|+=0.5 bias to prepare to round.  */
-	bge	cr3,.Lconvert	/* x is positive so don't negate x.  */
+	bge	cr1,.Lconvert	/* x is positive so don't negate x.  */
 	fnabs	fp3,fp3		/* -(|x|+=0.5)  */
 .Lconvert:
 	fctidz	fp4,fp3		/* Convert to Integer double word round toward 0.  */
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_llroundf.S b/sysdeps/powerpc/powerpc64/fpu/s_llroundf.S
index a211879..e617bca 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_llroundf.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_llroundf.S
@@ -1,5 +1,5 @@
 /* llroundf function.  PowerPC64 version.
-   Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2007, 2008 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
@@ -51,12 +51,12 @@ ENTRY (__llroundf)
 	fabs	fp2,fp1		/* Get the absolute value of x.  */
 	fsub	fp12,fp10,fp10	/* Compute 0.0 into fp12.  */
 	fcmpu	cr6,fp2,fp10	/* if |x| < 0.5  */
-	fcmpu	cr4,fp2,fp9	/* if |x| >= 2^23  */
-	fcmpu	cr3,fp1,fp12	/* x is negative? x < 0.0  */
+	fcmpu	cr7,fp2,fp9	/* if |x| >= 2^23  */
+	fcmpu	cr1,fp1,fp12	/* x is negative? x < 0.0  */
 	blt-	cr6,.Lretzero	/* 0.5 > x < -0.5 so just return 0.  */
-	bge-	cr4,.Lnobias	/* 2^23 > x < -2^23 just convert with no bias.  */
+	bge-	cr7,.Lnobias	/* 2^23 > x < -2^23 just convert with no bias.  */
 	fadd	fp3,fp2,fp10	/* |x|+=0.5 bias to prepare to round.  */
-	bge	cr3,.Lconvert	/* x is positive so don't negate x.  */
+	bge	cr1,.Lconvert	/* x is positive so don't negate x.  */
 	fnabs	fp3,fp3		/* -(|x|+=0.5)  */
 .Lconvert:
 	fctidz	fp4,fp3		/* Convert to Integer double word round toward 0.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3353ea9028f569552e12bef515582a48c49100e0

commit 3353ea9028f569552e12bef515582a48c49100e0
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:   Fri Jul 24 10:49:00 2009 -0500

    Handle old kernel headers with new fallocate patches.
    
    commit 353f210707092e3e57418b4954888f2d15cc3da3
    Author: Ulrich Drepper <drepper@redhat.com>
    Date:   Wed Apr 15 00:39:57 2009 +0000
    
    2009-03-17  Ryan S. Arnold  <rsa@us.ibm.com>
                Ulrich Drepper  <drepper@redhat.com>
    
    	* sysdeps/unix/sysv/linux/fallocate.c: Handle old kernel headers.
    	* sysdeps/unix/sysv/linux/fallocate64.c: Likewise.

diff --git a/sysdeps/unix/sysv/linux/fallocate.c b/sysdeps/unix/sysv/linux/fallocate.c
index a45b0f8..116f000 100644
--- a/sysdeps/unix/sysv/linux/fallocate.c
+++ b/sysdeps/unix/sysv/linux/fallocate.c
@@ -25,7 +25,12 @@
 int
 fallocate (int fd, int mode, __off_t offset, __off_t len)
 {
+#ifndef __NR_fallocate
   return INLINE_SYSCALL (fallocate, 6, fd, mode,
 			 __LONG_LONG_PAIR (offset >> 31, offset),
 			 __LONG_LONG_PAIR (len >> 31, len));
+#else
+  __set_errno (ENOSYS);
+  return -1;
+#endif
 }
diff --git a/sysdeps/unix/sysv/linux/fallocate64.c b/sysdeps/unix/sysv/linux/fallocate64.c
index 601a70b..2fbe988 100644
--- a/sysdeps/unix/sysv/linux/fallocate64.c
+++ b/sysdeps/unix/sysv/linux/fallocate64.c
@@ -25,9 +25,14 @@
 int
 __fallocate64_l64 (int fd, int mode, __off64_t offset, __off64_t len)
 {
+#ifndef __NR_fallocate
   return INLINE_SYSCALL (fallocate, 6, fd, mode,
 			 __LONG_LONG_PAIR ((long int) (offset >> 32),
 					   (long int) offset),
 			 __LONG_LONG_PAIR ((long int) (len >> 32),
 					   (long int) len));
+#else
+  __set_errno (ENOSYS);
+  return -1;
+#endif
 }

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c2621cbf6d0502ebbf27ea2e2165d8bfae6feb99

commit c2621cbf6d0502ebbf27ea2e2165d8bfae6feb99
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:   Fri Jul 24 10:46:10 2009 -0500

    More Linux fallocate patches.
    
    commit 99eb932f75c941f08b7cb66890b7d406bf37ba9b
    Author: Ulrich Drepper <drepper@redhat.com>
    Date:   Tue Mar 3 13:53:19 2009 +0000
    
            * sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Declare fallocate{,64}.
            * sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise.
            * sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise.
            * sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Likewise.
            * sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Likewise.
            * sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Likewise.
            * sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Likewise.

diff --git a/sysdeps/unix/sysv/linux/fallocate.c b/sysdeps/unix/sysv/linux/fallocate.c
index f65864f..a45b0f8 100644
--- a/sysdeps/unix/sysv/linux/fallocate.c
+++ b/sysdeps/unix/sysv/linux/fallocate.c
@@ -16,6 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <errno.h>
 #include <fcntl.h>
 #include <sysdep.h>
 
@@ -24,7 +25,7 @@
 int
 fallocate (int fd, int mode, __off_t offset, __off_t len)
 {
-  return INLINE_SYSCALL (fallocate, err, 6, fd, mode,
+  return INLINE_SYSCALL (fallocate, 6, fd, mode,
 			 __LONG_LONG_PAIR (offset >> 31, offset),
 			 __LONG_LONG_PAIR (len >> 31, len));
 }
diff --git a/sysdeps/unix/sysv/linux/fallocate64.c b/sysdeps/unix/sysv/linux/fallocate64.c
index b20486d..601a70b 100644
--- a/sysdeps/unix/sysv/linux/fallocate64.c
+++ b/sysdeps/unix/sysv/linux/fallocate64.c
@@ -16,6 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <errno.h>
 #include <fcntl.h>
 #include <sysdep.h>
 
diff --git a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
index fdf0df3..35ef665 100644
--- a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
@@ -235,6 +235,23 @@ extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
 extern ssize_t tee (int __fdin, int __fdout, size_t __len,
 		    unsigned int __flags);
 
+/* Reserve storage for the data of the file associated with FD.  */
+# ifndef __USE_FILE_OFFSET64
+extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset,
+				   __off_t __len),
+		       fallocate64);
+#  else
+#   define fallocate fallocate64
+#  endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
+			__off64_t __len);
+# endif
+
 #endif
 
 __END_DECLS
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
index c5d5c15..6abc5ce 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
@@ -229,6 +229,23 @@ extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
 extern ssize_t tee (int __fdin, int __fdout, size_t __len,
 		    unsigned int __flags);
 
+/* Reserve storage for the data of the file associated with FD.  */
+# ifndef __USE_FILE_OFFSET64
+extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset,
+				   __off_t __len),
+		       fallocate64);
+#  else
+#   define fallocate fallocate64
+#  endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
+			__off64_t __len);
+# endif
+
 #endif
 
 __END_DECLS
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
index 556e83d..90b669a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
@@ -235,6 +235,23 @@ extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
 extern ssize_t tee (int __fdin, int __fdout, size_t __len,
 		    unsigned int __flags);
 
+/* Reserve storage for the data of the file associated with FD.  */
+# ifndef __USE_FILE_OFFSET64
+extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset,
+				   __off_t __len),
+		       fallocate64);
+#  else
+#   define fallocate fallocate64
+#  endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
+			__off64_t __len);
+# endif
+
 #endif
 
 __END_DECLS
diff --git a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
index e0cc664..ff5941d 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
@@ -255,6 +255,23 @@ extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
 extern ssize_t tee (int __fdin, int __fdout, size_t __len,
 		    unsigned int __flags);
 
+/* Reserve storage for the data of the file associated with FD.  */
+# ifndef __USE_FILE_OFFSET64
+extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset,
+				   __off_t __len),
+		       fallocate64);
+#  else
+#   define fallocate fallocate64
+#  endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
+			__off64_t __len);
+# endif
+
 #endif
 
 __END_DECLS
diff --git a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
index fdf0df3..35ef665 100644
--- a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
@@ -235,6 +235,23 @@ extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
 extern ssize_t tee (int __fdin, int __fdout, size_t __len,
 		    unsigned int __flags);
 
+/* Reserve storage for the data of the file associated with FD.  */
+# ifndef __USE_FILE_OFFSET64
+extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset,
+				   __off_t __len),
+		       fallocate64);
+#  else
+#   define fallocate fallocate64
+#  endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
+			__off64_t __len);
+# endif
+
 #endif
 
 __END_DECLS
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
index c5c035c..d59744a 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
@@ -254,6 +254,23 @@ extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
 extern ssize_t tee (int __fdin, int __fdout, size_t __len,
 		    unsigned int __flags);
 
+/* Reserve storage for the data of the file associated with FD.  */
+# ifndef __USE_FILE_OFFSET64
+extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset,
+				   __off_t __len),
+		       fallocate64);
+#  else
+#   define fallocate fallocate64
+#  endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
+			__off64_t __len);
+# endif
+
 #endif
 
 __END_DECLS
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c b/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c
index c89e318..0eabab9 100644
--- a/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c
+++ b/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c
@@ -16,6 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <errno.h>
 #include <fcntl.h>
 #include <sysdep.h>
 
@@ -26,4 +27,4 @@ fallocate (int fd, int mode, __off_t offset, __off_t len)
 {
   return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
 }
-strong_alias (posix_fallocate, posix_fallocate64)
+strong_alias (fallocate, fallocate64)
diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
index cf96ac7..bc0f4d6 100644
--- a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
@@ -249,6 +249,22 @@ extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
 extern ssize_t tee (int __fdin, int __fdout, size_t __len,
 		    unsigned int __flags);
 
+/* Reserve storage for the data of the file associated with FD.  */
+# ifndef __USE_FILE_OFFSET64
+extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
+# else
+#  ifdef __REDIRECT
+extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset,
+				   __off_t __len),
+		       fallocate64);
+#  else
+#   define fallocate fallocate64
+#  endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
+			__off64_t __len);
+# endif
 #endif
 
 __END_DECLS

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a14f7dce07b58c6af4d7af89eb596320ecee7f9b

commit a14f7dce07b58c6af4d7af89eb596320ecee7f9b
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:   Fri Jul 24 10:44:27 2009 -0500

    Add Linux fallocate support.
    
    commit 749f5cc96803f5a2ec0ca76b4bb290cea44fb3f1
    Author: Ulrich Drepper <drepper@redhat.com>
    Date:   Mon Mar 2 16:15:58 2009 +0000
    
    	* sysdeps/unix/sysv/linux/fallocate.c: New file.
    	* sysdeps/unix/sysv/linux/fallocate64.c: New file.
    	* sysdeps/unix/sysv/linux/wordsize-64/fallocate64.c: New file.
    	* sysdeps/unix/sysv/linux/wordsize-64/fallocate.c: New file.
    	* sysdeps/unix/sysv/linux/i386/fallocate64.c: New file.
    	* sysdeps/unix/sysv/linux/i386/fallocate.c: New file.
    	* sysdeps/unix/sysv/linux/Versions: Export fallocate and fallocate64
    	for GLIBC_2.10.
    	* sysdeps/unix/sysv/linux/Makefile [subdir=io] (sysdep_routines):
    	Add fallocate and fallocate64.
    	* io/fcntl.h: Pretty printing.

diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index ddbb4f6..3dcad74 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -139,7 +139,7 @@ endif
 
 ifeq ($(subdir),io)
 sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \
-		   sync_file_range open_2 open64_2
+		   sync_file_range open_2 open64_2 fallocate fallocate64
 endif
 
 ifeq ($(subdir),elf)
diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
index af4c293..af12084 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -135,6 +135,9 @@ libc {
   GLIBC_2.8 {
     timerfd_create; timerfd_settime; timerfd_gettime;
   }
+  GLIBC_2.10 {
+    fallocate; fallocate64;
+  }
   GLIBC_PRIVATE {
     # functions used in other libraries
     __syscall_rt_sigqueueinfo;
diff --git a/sysdeps/unix/sysv/linux/fallocate.c b/sysdeps/unix/sysv/linux/fallocate.c
new file mode 100644
index 0000000..f65864f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/fallocate.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 2007, 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <fcntl.h>
+#include <sysdep.h>
+
+
+/* Reserve storage for the data of the file associated with FD.  */
+int
+fallocate (int fd, int mode, __off_t offset, __off_t len)
+{
+  return INLINE_SYSCALL (fallocate, err, 6, fd, mode,
+			 __LONG_LONG_PAIR (offset >> 31, offset),
+			 __LONG_LONG_PAIR (len >> 31, len));
+}
diff --git a/sysdeps/unix/sysv/linux/fallocate64.c b/sysdeps/unix/sysv/linux/fallocate64.c
new file mode 100644
index 0000000..b20486d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/fallocate64.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 2007, 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <fcntl.h>
+#include <sysdep.h>
+
+
+/* Reserve storage for the data of the file associated with FD.  */
+int
+__fallocate64_l64 (int fd, int mode, __off64_t offset, __off64_t len)
+{
+  return INLINE_SYSCALL (fallocate, 6, fd, mode,
+			 __LONG_LONG_PAIR ((long int) (offset >> 32),
+					   (long int) offset),
+			 __LONG_LONG_PAIR ((long int) (len >> 32),
+					   (long int) len));
+}
diff --git a/sysdeps/unix/sysv/linux/i386/fallocate.c b/sysdeps/unix/sysv/linux/i386/fallocate.c
new file mode 100644
index 0000000..7a943e4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/fallocate.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 2007, 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <fcntl.h>
+#include <sysdep.h>
+
+
+extern int __call_fallocate (int fd, int mode, __off64_t offset, __off64_t len)
+     attribute_hidden;
+
+
+/* Reserve storage for the data of the file associated with FD.  */
+int
+fallocate (int fd, int mode, __off_t offset, __off_t len)
+{
+  return __call_fallocate (fd, mode, offset, len);
+}
diff --git a/sysdeps/unix/sysv/linux/i386/fallocate64.c b/sysdeps/unix/sysv/linux/i386/fallocate64.c
new file mode 100644
index 0000000..b744710
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/fallocate64.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 2007, 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <fcntl.h>
+#include <sysdep.h>
+
+
+extern int __call_fallocate (int fd, int mode, __off64_t offset, __off64_t len)
+     attribute_hidden;
+
+
+/* Reserve storage for the data of the file associated with FD.  */
+int
+__fallocate64_l64 (int fd, int mode, __off64_t offset, __off64_t len)
+{
+  return __call_fallocate (fd, mode, offset, len);
+}
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c b/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c
new file mode 100644
index 0000000..c89e318
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 2007, 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <fcntl.h>
+#include <sysdep.h>
+
+
+/* Reserve storage for the data of the file associated with FD.  */
+int
+fallocate (int fd, int mode, __off_t offset, __off_t len)
+{
+  return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
+}
+strong_alias (posix_fallocate, posix_fallocate64)
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/fallocate64.c b/sysdeps/unix/sysv/linux/wordsize-64/fallocate64.c
new file mode 100644
index 0000000..df33112
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/wordsize-64/fallocate64.c
@@ -0,0 +1 @@
+/* fallocate64 is in posix_fallocate.c */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3385d53cf549e798489e03522344e318d3e684f7

commit 3385d53cf549e798489e03522344e318d3e684f7
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:   Fri Jul 24 10:41:04 2009 -0500

    Added .machine push; .machine "power6"; .machine pop in macros.
    
    commit 1454da21955742494232aa8b34c5e238263ad37a
    Author: Ulrich Drepper <drepper@redhat.com>
    Date:   Tue Mar 10 04:47:30 2009 +0000
    
    	* sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S: Use
    	.machine push; .machine "power6" and .machine pop around mtfsf
    	insns outside of _ARCH_PWR6 define.
    	* sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S: Likewise.
    	* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S:
    	Likewise.
    	* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S:
    	Likewise.
    	* sysdeps/powerpc/fpu/tst-setcontext-fpscr.c (_SET_DI_FPSCR): Likewise.
    	* sysdeps/powerpc/fpu/fenv_libc.h (fesetenv_register,
    	relax_fenv_state): Likewise.

diff --git a/sysdeps/powerpc/fpu/fenv_libc.h b/sysdeps/powerpc/fpu/fenv_libc.h
index c70f851..0a4a57d 100644
--- a/sysdeps/powerpc/fpu/fenv_libc.h
+++ b/sysdeps/powerpc/fpu/fenv_libc.h
@@ -1,5 +1,5 @@
 /* Internal libc stuff for floating point environment routines.
-   Copyright (C) 1997, 2006, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2006, 2008, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -39,7 +39,10 @@ libm_hidden_proto (__fe_nomask_env)
 	do { \
 	  double d = (env); \
 	  if(GLRO(dl_hwcap) & PPC_FEATURE_HAS_DFP) \
-	    asm volatile ("mtfsf 0xff,%0,1,0" : : "f" (d)); \
+	    asm volatile (".machine push; " \
+			  ".machine \"power6\"; " \
+			  "mtfsf 0xff,%0,1,0; " \
+			  ".machine pop" : : "f" (d)); \
 	  else \
 	    asm volatile ("mtfsf 0xff,%0" : : "f" (d)); \
 	} while(0)
@@ -52,8 +55,9 @@ libm_hidden_proto (__fe_nomask_env)
    functions.  */
 #define relax_fenv_state() \
 	do { \
-	   if(GLRO(dl_hwcap) & PPC_FEATURE_HAS_DFP) \
-	       asm ("mtfsfi 7,0,1"); \
+	   if (GLRO(dl_hwcap) & PPC_FEATURE_HAS_DFP) \
+	     asm (".machine push; .machine \"power6\"; " \
+		  "mtfsfi 7,0,1; .machine pop"); \
 	   asm ("mtfsfi 7,0"); \
 	} while(0)
 
diff --git a/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c b/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c
index a15fe86..e75a7f1 100644
--- a/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c
+++ b/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c
@@ -111,7 +111,11 @@ typedef unsigned int si_fpscr_t __attribute__ ((__mode__ (__SI__)));
     tmp __attribute__ ((__aligned__(8)));				     \
   tmp.fpscr = __fpscr;							     \
   /* Set the entire 64-bit FPSCR.  */					     \
-  __asm__ ("lfd%U0 0,%0; mtfsf 255,0,1,0" : : "m" (tmp.d) : "fr0");	     \
+  __asm__ ("lfd%U0 0,%0; "						     \
+	   ".machine push; "						     \
+	   ".machine \"power6\"; "					     \
+	   "mtfsf 255,0,1,0; "						     \
+	   ".machine pop" : : "m" (tmp.d) : "fr0");			     \
   tmp.d = 0;								     \
   __asm__("lfd%U0 0,%0" : : "m" (tmp.d) : "fr0");			     \
 }

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e52b0ccf5d1e31f154572c0b7ccaf0dd1e592b50

commit e52b0ccf5d1e31f154572c0b7ccaf0dd1e592b50
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:   Fri Jul 24 10:36:31 2009 -0500

    Use .machine push; .machine "power6" and .machine pop around mtfsf insns outside of _ARCH_PWR6 define.
    
    commit bddec78c7b827fde3f086f6a576237508f7099b0
    Author: Ulrich Drepper <drepper@redhat.com>
    Date:   Tue Mar 10 04:46:08 2009 +0000
    
        Use .machine push; .machine "power6" and .machine pop around mtfsf insns outside of _ARCH_PWR6 define.

diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
index d83a0ef..127c9e4 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
@@ -204,6 +204,8 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	/* Use the extended four-operand version of the mtfsf insn.  */
 	mtfsf	0xff,fp31,1,0
 # else
+	.machine push
+	.machine "power6"
 	/* Availability of DFP indicates a 64-bit FPSCR.  */
 	andi.	r6,r7,PPC_FEATURE_HAS_DFP
 	beq	7f
@@ -212,7 +214,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	b	8f
 	/* Continue to operate on the FPSCR as if it were 32-bits.  */
 7:	mtfsf	0xff,fp31
-8:
+8:	.machine pop
 # endif /* _ARCH_PWR6 */
 	lfd	fp1,_UC_FREGS+(1*8)(r31)
 	lfd	fp2,_UC_FREGS+(2*8)(r31)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
index 243a66a..89b1a61 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
@@ -430,6 +430,8 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	/* Use the extended four-operand version of the mtfsf insn.  */
 	mtfsf	0xff,fp31,1,0
 # else
+	.machine push
+	.machine "power6"
 	/* Availability of DFP indicates a 64-bit FPSCR.  */
 	andi.	r6,r7,PPC_FEATURE_HAS_DFP
 	beq	7f
@@ -438,7 +440,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	b	8f
 	/* Continue to operate on the FPSCR as if it were 32-bits.  */
 7:	mtfsf	0xff,fp31
-8:
+8:	.machine pop
 #endif /* _ARCH_PWR6 */
 	lfd	fp1,_UC_FREGS+(1*8)(r31)
 	lfd	fp2,_UC_FREGS+(2*8)(r31)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
index b4e28b4..24413e0 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
@@ -1,5 +1,6 @@
 /* Switch to context.
-   Copyright (C) 2002, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005, 2006, 2008, 2009
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -86,6 +87,8 @@ ENTRY(__novec_setcontext)
   /* Use the extended four-operand version of the mtfsf insn.  */
   mtfsf  0xff,fp0,1,0
 # else
+  .machine push
+  .machine "power6"
   /* Availability of DFP indicates a 64-bit FPSCR.  */
   andi.  r6,r5,PPC_FEATURE_HAS_DFP
   beq    5f
@@ -96,6 +99,7 @@ ENTRY(__novec_setcontext)
 5:
   mtfsf  0xff,fp0
 6:
+  .machine pop
 # endif /* _ARCH_PWR6 */
   lfd  fp29,(SIGCONTEXT_FP_REGS+(PT_R29*8))(r31)
   lfd  fp28,(SIGCONTEXT_FP_REGS+(PT_R28*8))(r31)
@@ -374,6 +378,8 @@ L(has_no_vec):
   /* Use the extended four-operand version of the mtfsf insn.  */
   mtfsf  0xff,fp0,1,0
 # else
+  .machine push
+  .machine "power6"
   /* Availability of DFP indicates a 64-bit FPSCR.  */
   andi.  r6,r5,PPC_FEATURE_HAS_DFP
   beq    7f
@@ -384,6 +390,7 @@ L(has_no_vec):
 7:
   mtfsf  0xff,fp0
 8:
+  .machine pop
 # endif /* _ARCH_PWR6 */
   lfd  fp29,(SIGCONTEXT_FP_REGS+(PT_R29*8))(r31)
   lfd  fp28,(SIGCONTEXT_FP_REGS+(PT_R28*8))(r31)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
index c42ccfb..6c075a9 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
@@ -1,5 +1,6 @@
 /* Save current context and install the given one.
-   Copyright (C) 2002, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005, 2006, 2008, 2009
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -180,6 +181,8 @@ ENTRY(__novec_swapcontext)
   /* Use the extended four-operand version of the mtfsf insn.  */
   mtfsf  0xff,fp0,1,0
 # else
+  .machine push
+  .machine "power6"
   /* Availability of DFP indicates a 64-bit FPSCR.  */
   andi.  r6,r8,PPC_FEATURE_HAS_DFP
   beq    5f
@@ -190,6 +193,7 @@ ENTRY(__novec_swapcontext)
 5:
   mtfsf  0xff,fp0
 6:
+  .machine pop
 #endif /* _ARCH_PWR6 */
   lfd  fp29,(SIGCONTEXT_FP_REGS+(PT_R29*8))(r31)
   lfd  fp28,(SIGCONTEXT_FP_REGS+(PT_R28*8))(r31)
@@ -672,6 +676,8 @@ L(has_no_vec2):
   /* Use the extended four-operand version of the mtfsf insn.  */
   mtfsf  0xff,fp0,1,0
 # else
+  .machine push
+  .machine "power6"
   /* Availability of DFP indicates a 64-bit FPSCR.  */
   andi.  r6,r8,PPC_FEATURE_HAS_DFP
   beq    7f
@@ -682,6 +688,7 @@ L(has_no_vec2):
 7:
   mtfsf  0xff,fp0
 8:
+  .machine pop
 #endif /* _ARCH_PWR6 */
   lfd  fp29,(SIGCONTEXT_FP_REGS+(PT_R29*8))(r31)
   lfd  fp28,(SIGCONTEXT_FP_REGS+(PT_R28*8))(r31)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=cc9ed35042bd17054d266bbde08f42aa9ad77ba3

commit cc9ed35042bd17054d266bbde08f42aa9ad77ba3
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:   Fri Jul 24 10:33:47 2009 -0500

    Fix up some bugs with the 64-bit FPSCR patch including erroneous test-case passes.
    
    commit b7219e53bcd54d874f85c67469f4c1dd4f2ad5d2
    Author: Ulrich Drepper <drepper@redhat.com>
    Date:   Fri Jan 30 20:30:46 2009 +0000
    
    2009-01-11  Ryan S. Arnold  <rsa@us.ibm.com>
    
            [BZ #9726]
            * sysdeps/powerpc/fpu/tst-setcontext-fpscr.c (_SET_DI_FPSCR,
            _SET_SI_FPSCR): Clobber fp0 to prevent erroneous test-case passes.
    
    2009-01-08  Ryan S. Arnold  <rsa@us.ibm.com>
    
            [BZ #9726]
            * sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
            (__CONTEXT_FUNC_NAME): Fix mtfsf to use fp31 instead of fp0.
            * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
            (__CONTEXT_FUNC_NAME): Fix mtfsf to use fp31 instead of fp0.

diff --git a/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c b/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c
index 973fb3f..a15fe86 100644
--- a/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c
+++ b/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001,2002,2004,2006,2007,2008 Free Software Foundation, Inc.
+/* Copyright (C) 2001,2002,2004,2006-2008,2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ryan S. Arnold <rsa@us.ibm.com>
                   Sean Curry <spcurry@us.ibm.com>
@@ -104,12 +104,16 @@ typedef unsigned int si_fpscr_t __attribute__ ((__mode__ (__SI__)));
    (__fpscr)=tmp.fpscr;							     \
    tmp.fpscr; })
 
+/* We make sure to zero fp0 after we use it in order to prevent stale data
+   in an fp register from making a test-case pass erroneously.  */
 # define _SET_DI_FPSCR(__fpscr) {					     \
   union { double d; di_fpscr_t fpscr; }					     \
     tmp __attribute__ ((__aligned__(8)));				     \
   tmp.fpscr = __fpscr;							     \
   /* Set the entire 64-bit FPSCR.  */					     \
   __asm__ ("lfd%U0 0,%0; mtfsf 255,0,1,0" : : "m" (tmp.d) : "fr0");	     \
+  tmp.d = 0;								     \
+  __asm__("lfd%U0 0,%0" : : "m" (tmp.d) : "fr0");			     \
 }
 
 # define _GET_SI_FPSCR(__fpscr) ({					     \
@@ -120,6 +124,8 @@ typedef unsigned int si_fpscr_t __attribute__ ((__mode__ (__SI__)));
    (__fpscr)=tmp.cw[1];							     \
    tmp.cw[0]; })
 
+/* We make sure to zero fp0 after we use it in order to prevent stale data
+   in an fp register from making a test-case pass erroneously.  */
 # define _SET_SI_FPSCR(__fpscr) {					     \
   union { double d; si_fpscr_t fpscr[2]; }				     \
     tmp __attribute__ ((__aligned__(8)));				     \
@@ -127,6 +133,8 @@ typedef unsigned int si_fpscr_t __attribute__ ((__mode__ (__SI__)));
   tmp.fpscr[0] = 0xFFF80000;						     \
   tmp.fpscr[1] = __fpscr;						     \
   __asm__ ("lfd%U0 0,%0; mtfsf 255,0" : : "m" (tmp.d) : "fr0");		     \
+  tmp.d = 0;								     \
+  __asm__("lfd%U0 0,%0" : : "m" (tmp.d) : "fr0");			     \
 }
 
 void prime_special_regs(int which)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
index 91ac436..d83a0ef 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
@@ -1,5 +1,5 @@
 /* Jump to a new context powerpc32 common.
-   Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,13 +18,13 @@
    02110-1301 USA.  */
 
 /* This is the common implementation of setcontext for powerpc32.
-   It not complete in itself should be included in to a framework that 
+   It not complete in itself should be included in to a framework that
    defines:
      __CONTEXT_FUNC_NAME
    and if appropriate:
      __CONTEXT_ENABLE_FPRS
      __CONTEXT_ENABLE_VRS
-   Any archecture that implements the Vector unit is assumed to also 
+   Any archecture that implements the Vector unit is assumed to also
    implement the floating unit.  */
 
 /* Stack frame offsets.  */
@@ -202,7 +202,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	lfd	fp0,_UC_FREGS+(0*8)(r31)
 # ifdef _ARCH_PWR6
 	/* Use the extended four-operand version of the mtfsf insn.  */
-	mtfsf  0xff,fp0,1,0
+	mtfsf	0xff,fp31,1,0
 # else
 	/* Availability of DFP indicates a 64-bit FPSCR.  */
 	andi.	r6,r7,PPC_FEATURE_HAS_DFP
@@ -304,4 +304,3 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	/* NOTREACHED */
 
 END (__CONTEXT_FUNC_NAME)
-
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
index 77c9822..243a66a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
@@ -1,5 +1,5 @@
 /* Save current context and jump to a new context.
-   Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,13 +18,13 @@
    02110-1301 USA.  */
 
 /* This is the common implementation of setcontext for powerpc32.
-   It not complete in itself should be included in to a framework that 
+   It not complete in itself should be included in to a framework that
    defines:
      __CONTEXT_FUNC_NAME
    and if appropriate:
      __CONTEXT_ENABLE_FPRS
      __CONTEXT_ENABLE_VRS
-   Any archecture that implements the Vector unit is assumed to also 
+   Any archecture that implements the Vector unit is assumed to also
    implement the floating unit.  */
 
 /* Stack frame offsets.  */
@@ -51,7 +51,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	stw	r0,_UC_GREGS+(PT_R0*4)(r3)
 	mflr	r0
 	stw	r2,_UC_GREGS+(PT_R2*4)(r3)
-	stw	r4,_UC_GREGS+(PT_R4*4)(r3)			
+	stw	r4,_UC_GREGS+(PT_R4*4)(r3)
 /* Set the callers LR_SAVE, and the ucontext LR and NIP to the callers
    return address.  */
 	stw	r0,_UC_GREGS+(PT_LNK*4)(r3)
@@ -85,7 +85,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	stw	r29,_UC_GREGS+(PT_R29*4)(r3)
 	stw	r30,_UC_GREGS+(PT_R30*4)(r3)
 	stw	r31,_UC_GREGS+(PT_R31*4)(r3)
-	
+
 /* Save the value of R1.  We had to push the stack before we
    had the address of uc_reg_space.  So compute the address of
    the callers stack pointer and save it as R1.  */
@@ -174,10 +174,10 @@ ENTRY(__CONTEXT_FUNC_NAME)
 
 	la	r10,(_UC_VREGS)(r3)
 	la	r9,(_UC_VREGS+16)(r3)
-	
+
 /*	beq	L(no_vec)*/
 	beq	2f
-/* address of the combined VSCR/VSAVE quadword.  */	
+/* address of the combined VSCR/VSAVE quadword.  */
 	la	r8,(_UC_VREGS+512)(r3)
 
 /* Save the vector registers */
@@ -194,7 +194,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	stvx  v3,0,r9
 	addi  r10,r10,32
 	addi  r9,r9,32
-	
+
 	stvx	v0,0,r8
 
 	stvx  v4,0,r10
@@ -266,7 +266,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	stvx  v30,0,r10
 	stvx  v31,0,r9
  	stw	r0,0(r8)
-	
+
 2: /*L(no_vec):*/
 # endif /* __CONTEXT_ENABLE_VRS */
 #endif /* __CONTEXT_ENABLE_FPRS */
@@ -428,7 +428,7 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	lfd	fp0,_UC_FREGS+(0*8)(r31)
 # ifdef _ARCH_PWR6
 	/* Use the extended four-operand version of the mtfsf insn.  */
-	mtfsf  0xff,fp0,1,0
+	mtfsf	0xff,fp31,1,0
 # else
 	/* Availability of DFP indicates a 64-bit FPSCR.  */
 	andi.	r6,r7,PPC_FEATURE_HAS_DFP
@@ -514,13 +514,13 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	lwz	r31,_UC_GREGS+(PT_R31*4)(r31)
 
 	bctr
-	
+
 3:/*L(error_exit):*/
 	lwz	r0,_FRAME_LR_SAVE+16(r1)
 	addi	r1,r1,16
 	mtlr	r0
 	blr
-	
+
 4:/*L(do_sigret):*/
 	addi	r1,r4,-0xd0
 	li	r0,SYS_ify(rt_sigreturn)
@@ -528,4 +528,3 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	/* NOTREACHED */
 
 END(__CONTEXT_FUNC_NAME)
-

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7bb672b9de470892efd5699d575fb057b4d9d4ee

commit 7bb672b9de470892efd5699d575fb057b4d9d4ee
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:   Fri Jul 24 10:30:00 2009 -0500

    Enable 64-bit FPSCR for POWER6 and include some dynamic feature checks for DFP facility availability.
    
    commit edba7a54eb83c37610b15454a21d54f47ec9dee7
    Author: Ulrich Drepper <drepper@redhat.com>
    Date:   Mon Nov 17 02:49:45 2008 +0000
    
    2008-11-13  Ryan S. Arnold  <rsa@us.ibm.com>
    
            [BZ #6411]
            * sysdeps/powerpc/fpu/Makefile: Added test case tst-setcontext-fpscr.
            * sysdeps/powerpc/fpu/feholdexcpt.c (_FPU_MASK_ALL): Define to replace
            magic numbers.
            * sysdeps/powerpc/fpu/fenv_libc.h (fesetenv_register): Dynamically
            choose mtfsf insn based on PPC_FEATURE_HAS_DFP.
            (relax_fenv_state): Same as above.
            (FPSCR_29): Reserve bit in ISA 2.05.
            (FPSCR_NI): Provide define for compat.
            * sysdeps/powerpc/fpu/fesetenv.c (_FPU_MASK_ALL): Define to replace
            magic numbers.
            * sysdeps/powerpc/fpu/feupdateenv.c (_FPU_MASK_ALL): Define to replace
            magic numbers.
            * sysdeps/powerpc/fpu/tst-setcontext-fpscr.c: New file.  Test case to
            test setcontext and swapcontext with dynamic 64-bit FPSCR detection.
            * sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S (__longjmp): Adjust
            access to hwcap to account for hwcap size increase to uint64_t.
            * sysdeps/powerpc/powerpc32/fpu/setjmp-common.S (__sigsetjmp ):
            Likewise.
            * sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
            (*setcontext): Likewise.
            * sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/setcontext.S:
            New file.
            * sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/swapcontext.S:
            New file.
            * sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
            (*setcontext): dynamically select mtfsf insn based on
            PPC_FEATURE_HAS_DFP. Adjust access to hwcap to account for hwcap size
            increase to uint64_t.
            * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
            (*swapcontext): dynamically select mtfsf insn based on
            PPC_FEATURE_HAS_DFP.  Adjust access to hwcap to account for hwcap size
            increase to uint64_t.
            * sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/setcontext.S:
            New file.
            * sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/swapcontext.S:
            New file.
            * sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
            (*setcontext): dynamically select mtfsf insn based on
            PPC_FEATURE_HAS_DFP.
            * sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
            (*swapcontext): dynamically select mtfsf insn based on
            PPC_FEATURE_HAS_DFP.

diff --git a/sysdeps/powerpc/fpu/Makefile b/sysdeps/powerpc/fpu/Makefile
index ce67ff8..ffacf1a 100644
--- a/sysdeps/powerpc/fpu/Makefile
+++ b/sysdeps/powerpc/fpu/Makefile
@@ -5,3 +5,7 @@ libm-tests += test-powerpc-snan
 # libm needs ld.so to access dl_hwcap
 $(objpfx)libm.so: $(elfobjdir)/ld.so
 endif
+
+ifeq ($(subdir),stdlib)
+tests += tst-setcontext-fpscr
+endif
diff --git a/sysdeps/powerpc/fpu/feholdexcpt.c b/sysdeps/powerpc/fpu/feholdexcpt.c
index c943224..b74b18a 100644
--- a/sysdeps/powerpc/fpu/feholdexcpt.c
+++ b/sysdeps/powerpc/fpu/feholdexcpt.c
@@ -1,5 +1,5 @@
 /* Store current floating-point environment and clear exceptions.
-   Copyright (C) 1997, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2005, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,8 @@
    02111-1307 USA.  */
 
 #include <fenv_libc.h>
+#include <fpu_control.h>
+#define _FPU_MASK_ALL (_FPU_MASK_ZM | _FPU_MASK_OM | _FPU_MASK_UM | _FPU_MASK_XM | _FPU_MASK_IM)
 
 int
 feholdexcept (fenv_t *envp)
@@ -35,7 +37,7 @@ feholdexcept (fenv_t *envp)
   /* If the old env had any eabled exceptions, then mask SIGFPE in the
      MSR FE0/FE1 bits.  This may allow the FPU to run faster because it
      always takes the default action and can not generate SIGFPE. */
-  if ((old.l[1] & 0x000000F8) != 0)
+  if ((old.l[1] & _FPU_MASK_ALL) != 0)
     (void)__fe_mask_env ();
 
   /* Put the new state in effect.  */
diff --git a/sysdeps/powerpc/fpu/fenv_libc.h b/sysdeps/powerpc/fpu/fenv_libc.h
index 6f116b6..c70f851 100644
--- a/sysdeps/powerpc/fpu/fenv_libc.h
+++ b/sysdeps/powerpc/fpu/fenv_libc.h
@@ -21,6 +21,8 @@
 #define _FENV_LIBC_H	1
 
 #include <fenv.h>
+#include <ldsodefs.h>
+#include <sysdep.h>
 
 libm_hidden_proto (__fe_nomask_env)
 
@@ -34,7 +36,13 @@ libm_hidden_proto (__fe_nomask_env)
 
 /* Equivalent to fesetenv, but takes a fenv_t instead of a pointer.  */
 #define fesetenv_register(env) \
-        ({ double d = (env); asm volatile ("mtfsf 0xff,%0" : : "f" (d)); })
+	do { \
+	  double d = (env); \
+	  if(GLRO(dl_hwcap) & PPC_FEATURE_HAS_DFP) \
+	    asm volatile ("mtfsf 0xff,%0,1,0" : : "f" (d)); \
+	  else \
+	    asm volatile ("mtfsf 0xff,%0" : : "f" (d)); \
+	} while(0)
 
 /* This very handy macro:
    - Sets the rounding mode to 'round to nearest';
@@ -42,7 +50,12 @@ libm_hidden_proto (__fe_nomask_env)
    - Prevents exceptions from being raised for inexact results.
    These things happen to be exactly what you need for typical elementary
    functions.  */
-#define relax_fenv_state() asm ("mtfsfi 7,0")
+#define relax_fenv_state() \
+	do { \
+	   if(GLRO(dl_hwcap) & PPC_FEATURE_HAS_DFP) \
+	       asm ("mtfsfi 7,0,1"); \
+	   asm ("mtfsfi 7,0"); \
+	} while(0)
 
 /* Set/clear a particular FPSCR bit (for instance,
    reset_fpscr_bit(FPSCR_VE);
@@ -122,10 +135,19 @@ enum {
   FPSCR_UE,        /* underflow exception enable */
   FPSCR_ZE,        /* zero divide exception enable */
   FPSCR_XE,        /* inexact exception enable */
+#ifdef _ARCH_PWR6
+  FPSCR_29,        /* Reserved in ISA 2.05  */
+#else
   FPSCR_NI         /* non-IEEE mode (typically, no denormalised numbers) */
+#endif /* _ARCH_PWR6 */
   /* the remaining two least-significant bits keep the rounding mode */
 };
 
+#ifdef _ARCH_PWR6
+  /* Not supported in ISA 2.05.  Provided for source compat only.  */
+# define FPSCR_NI 29
+#endif /* _ARCH_PWR6 */
+
 /* This operation (i) sets the appropriate FPSCR bits for its
    parameter, (ii) converts SNaN to the corresponding NaN, and (iii)
    otherwise passes its parameter through unchanged (in particular, -0
diff --git a/sysdeps/powerpc/fpu/fesetenv.c b/sysdeps/powerpc/fpu/fesetenv.c
index 5a0c742..fa81d78 100644
--- a/sysdeps/powerpc/fpu/fesetenv.c
+++ b/sysdeps/powerpc/fpu/fesetenv.c
@@ -1,5 +1,6 @@
 /* Install given floating-point environment.
-   Copyright (C) 1997,99,2000,01,02,07 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1999, 2000, 2001, 2007, 2008
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,8 +19,11 @@
    02111-1307 USA.  */
 
 #include <fenv_libc.h>
+#include <fpu_control.h>
 #include <bp-sym.h>
 
+#define _FPU_MASK_ALL (_FPU_MASK_ZM | _FPU_MASK_OM | _FPU_MASK_UM | _FPU_MASK_XM | _FPU_MASK_IM)
+
 int
 __fesetenv (const fenv_t *envp)
 {
@@ -29,18 +33,18 @@ __fesetenv (const fenv_t *envp)
   new.fenv = *envp;
   old.fenv = fegetenv_register ();
   
-  /* If the old env has no eabled exceptions and the new env has any enabled
-     exceptions, then unmask SIGFPE in the MSR FE0/FE1 bits.  This will put
-     the hardware into "precise mode" and may cause the FPU to run slower on
-     some hardware.  */
-  if ((old.l[1] & 0x000000F8) == 0 && (new.l[1] & 0x000000F8) != 0)
+  /* If the old env has no enabled exceptions and the new env has any enabled
+     exceptions, then unmask SIGFPE in the MSR FE0/FE1 bits.  This will put the
+     hardware into "precise mode" and may cause the FPU to run slower on some
+     hardware.  */
+  if ((old.l[1] & _FPU_MASK_ALL) == 0 && (new.l[1] & _FPU_MASK_ALL) != 0)
     (void)__fe_nomask_env ();
   
-  /* If the old env had any eabled exceptions and the new env has no enabled
+  /* If the old env had any enabled exceptions and the new env has no enabled
      exceptions, then mask SIGFPE in the MSR FE0/FE1 bits.  This may allow the
      FPU to run faster because it always takes the default action and can not 
      generate SIGFPE. */
-  if ((old.l[1] & 0x000000F8) != 0 && (new.l[1] & 0x000000F8) == 0)
+  if ((old.l[1] & _FPU_MASK_ALL) != 0 && (new.l[1] & _FPU_MASK_ALL) == 0)
     (void)__fe_mask_env ();
     
   fesetenv_register (*envp);
diff --git a/sysdeps/powerpc/fpu/feupdateenv.c b/sysdeps/powerpc/fpu/feupdateenv.c
index 5a4000f..5fca301 100644
--- a/sysdeps/powerpc/fpu/feupdateenv.c
+++ b/sysdeps/powerpc/fpu/feupdateenv.c
@@ -1,5 +1,6 @@
 /* Install given floating-point environment and raise exceptions.
-   Copyright (C) 1997,99,2000,01,07 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1999, 2000, 2001, 2007, 2008
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -19,8 +20,11 @@
    02111-1307 USA.  */
 
 #include <fenv_libc.h>
+#include <fpu_control.h>
 #include <bp-sym.h>
 
+#define _FPU_MASK_ALL (_FPU_MASK_ZM | _FPU_MASK_OM | _FPU_MASK_UM | _FPU_MASK_XM | _FPU_MASK_IM)
+
 int
 __feupdateenv (const fenv_t *envp)
 {
@@ -39,14 +43,14 @@ __feupdateenv (const fenv_t *envp)
      exceptions, then unmask SIGFPE in the MSR FE0/FE1 bits.  This will put
      the hardware into "precise mode" and may cause the FPU to run slower on
      some hardware.  */
-  if ((old.l[1] & 0x000000F8) == 0 && (new.l[1] & 0x000000F8) != 0)
+  if ((old.l[1] & _FPU_MASK_ALL) == 0 && (new.l[1] & _FPU_MASK_ALL) != 0)
     (void)__fe_nomask_env ();
   
   /* If the old env had any eabled exceptions and the new env has no enabled
      exceptions, then mask SIGFPE in the MSR FE0/FE1 bits.  This may allow the
      FPU to run faster because it always takes the default action and can not 
      generate SIGFPE. */
-  if ((old.l[1] & 0x000000F8) != 0 && (new.l[1] & 0x000000F8) == 0)
+  if ((old.l[1] & _FPU_MASK_ALL) != 0 && (new.l[1] & _FPU_MASK_ALL) == 0)
     (void)__fe_mask_env ();
 
   /* Atomically enable and raise (if appropriate) exceptions set in `new'. */
diff --git a/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c b/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c
new file mode 100644
index 0000000..973fb3f
--- /dev/null
+++ b/sysdeps/powerpc/fpu/tst-setcontext-fpscr.c
@@ -0,0 +1,358 @@
+/* Copyright (C) 2001,2002,2004,2006,2007,2008 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ryan S. Arnold <rsa@us.ibm.com>
+                  Sean Curry <spcurry@us.ibm.com>
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ucontext.h>
+#include <unistd.h>
+#include <malloc.h>
+#include <link.h>
+#include <elf.h>
+#include <sysdep.h>
+#include <fpu_control.h>
+
+static ucontext_t ctx[3];
+
+
+volatile int global;
+
+
+static int back_in_main;
+
+
+volatile static ElfW(auxv_t) *auxv = NULL;
+
+ElfW(Addr) query_auxv(int type)
+{
+  FILE *auxv_f;
+  ElfW(auxv_t) auxv_struct;
+  ElfW(auxv_t) *auxv_temp;
+  int i = 0;
+
+  /* if the /proc/self/auxv file has not been manually copied into the heap
+     yet, then do it */
+
+  if(auxv == NULL)
+    {
+      auxv_f = fopen("/proc/self/auxv", "r");
+
+      if(auxv_f == 0)
+	{
+	  perror("Error opening file for reading");
+	  return 0;
+	}
+      auxv = (ElfW(auxv_t) *)malloc(getpagesize());
+
+      do
+	{
+	  fread(&auxv_struct, sizeof(ElfW(auxv_t)), 1, auxv_f);
+	  auxv[i] = auxv_struct;
+	  i++;
+	} while(auxv_struct.a_type != AT_NULL);
+    }
+
+  auxv_temp = (ElfW(auxv_t) *)auxv;
+  i = 0;
+  do
+    {
+      if(auxv_temp[i].a_type == type)
+	{
+	  return auxv_temp[i].a_un.a_val;
+	}
+      i++;
+    } while (auxv_temp[i].a_type != AT_NULL);
+
+  return 0;
+}
+
+typedef unsigned long long di_fpscr_t __attribute__ ((__mode__ (__DI__)));
+typedef unsigned int si_fpscr_t __attribute__ ((__mode__ (__SI__)));
+
+#define _FPSCR_RESERVED 0xfffffff8ffffff04ULL
+
+#define _FPSCR_TEST0_DRN 0x0000000400000000ULL
+#define _FPSCR_TEST0_RN  0x0000000000000003ULL
+
+#define _FPSCR_TEST1_DRN 0x0000000300000000ULL
+#define _FPSCR_TEST1_RN  0x0000000000000002ULL
+
+/* Macros for accessing the hardware control word on Power6[x].  */
+# define _GET_DI_FPSCR(__fpscr) ({					     \
+   union { double d;							     \
+           di_fpscr_t fpscr; }						     \
+     tmp __attribute__ ((__aligned__(8)));				     \
+   __asm__ ("mffs 0; stfd%U0 0,%0" : "=m" (tmp.d) : : "fr0");		     \
+   (__fpscr)=tmp.fpscr;							     \
+   tmp.fpscr; })
+
+# define _SET_DI_FPSCR(__fpscr) {					     \
+  union { double d; di_fpscr_t fpscr; }					     \
+    tmp __attribute__ ((__aligned__(8)));				     \
+  tmp.fpscr = __fpscr;							     \
+  /* Set the entire 64-bit FPSCR.  */					     \
+  __asm__ ("lfd%U0 0,%0; mtfsf 255,0,1,0" : : "m" (tmp.d) : "fr0");	     \
+}
+
+# define _GET_SI_FPSCR(__fpscr) ({					     \
+   union { double d;							     \
+           si_fpscr_t cw[2]; }						     \
+     tmp __attribute__ ((__aligned__(8)));				     \
+   __asm__ ("mffs 0; stfd%U0 0,%0" : "=m" (tmp.d) : : "fr0");		     \
+   (__fpscr)=tmp.cw[1];							     \
+   tmp.cw[0]; })
+
+# define _SET_SI_FPSCR(__fpscr) {					     \
+  union { double d; si_fpscr_t fpscr[2]; }				     \
+    tmp __attribute__ ((__aligned__(8)));				     \
+  /* More-or-less arbitrary; this is a QNaN. */				     \
+  tmp.fpscr[0] = 0xFFF80000;						     \
+  tmp.fpscr[1] = __fpscr;						     \
+  __asm__ ("lfd%U0 0,%0; mtfsf 255,0" : : "m" (tmp.d) : "fr0");		     \
+}
+
+void prime_special_regs(int which)
+{
+  ElfW(Addr) a_val;
+
+  di_fpscr_t di_fpscr __attribute__ ((__aligned__(8)));
+
+  a_val = query_auxv(AT_HWCAP);
+  if(a_val == -1)
+    {
+      puts ("querying the auxv for the hwcap failed");
+      _exit (1);
+    }
+
+  /* Indicates a 64-bit FPSCR.  */
+  if (a_val & PPC_FEATURE_HAS_DFP)
+    {
+      _GET_DI_FPSCR(di_fpscr);
+
+      /* Overwrite the existing DRN and RN if there is one.  */
+      if (which == 0)
+        di_fpscr = ((di_fpscr & _FPSCR_RESERVED) | (_FPSCR_TEST0_DRN | _FPSCR_TEST0_RN));
+      else
+        di_fpscr = ((di_fpscr & _FPSCR_RESERVED) | (_FPSCR_TEST1_DRN | _FPSCR_TEST1_RN));
+      puts ("Priming 64-bit FPSCR with:");
+      printf("0x%.16llx\n",(unsigned long long int)di_fpscr);
+
+      _SET_DI_FPSCR(di_fpscr);
+    }
+  else
+    {
+      puts ("32-bit FPSCR found and will be tested.");
+      _GET_SI_FPSCR(di_fpscr);
+
+      /* Overwrite the existing RN if there is one.  */
+      if (which == 0)
+        di_fpscr = ((di_fpscr & _FPSCR_RESERVED) | (_FPSCR_TEST0_RN));
+      else
+        di_fpscr = ((di_fpscr & _FPSCR_RESERVED) | (_FPSCR_TEST1_RN));
+      puts ("Priming 32-bit FPSCR with:");
+      printf("0x%.8lx\n",(unsigned long int) di_fpscr);
+
+      _SET_SI_FPSCR(di_fpscr);
+    }
+}
+
+void clear_special_regs(void)
+{
+  ElfW(Addr) a_val;
+
+  di_fpscr_t di_fpscr __attribute__ ((__aligned__(8)));
+
+  union {
+	  double d;
+	  unsigned long long int lli;
+	  unsigned int li[2];
+  } dlli;
+
+  a_val = query_auxv(AT_HWCAP);
+  if(a_val == -1)
+    {
+      puts ("querying the auxv for the hwcap failed");
+      _exit (1);
+    }
+
+#if __WORDSIZE == 32
+  dlli.d = ctx[0].uc_mcontext.uc_regs->fpregs.fpscr;
+#else
+  dlli.d = ctx[0].uc_mcontext.fp_regs[32];
+#endif
+
+  puts("The FPSCR value saved in the ucontext_t is:");
+
+  /* Indicates a 64-bit FPSCR.  */
+  if (a_val & PPC_FEATURE_HAS_DFP)
+    {
+      printf("0x%.16llx\n",dlli.lli);
+      di_fpscr = 0x0;
+      puts ("Clearing the 64-bit FPSCR to:");
+      printf("0x%.16llx\n",(unsigned long long int) di_fpscr);
+
+      _SET_DI_FPSCR(di_fpscr);
+    }
+  else
+    {
+      printf("0x%.8x\n",(unsigned int) dlli.li[1]);
+      di_fpscr = 0x0;
+      puts ("Clearing the 32-bit FPSCR to:");
+      printf("0x%.8lx\n",(unsigned long int) di_fpscr);
+
+      _SET_SI_FPSCR(di_fpscr);
+    }
+}
+
+void test_special_regs(int which)
+{
+  ElfW(Addr) a_val;
+  unsigned long long int test;
+
+  di_fpscr_t di_fpscr __attribute__ ((__aligned__(8)));
+
+  a_val = query_auxv(AT_HWCAP);
+  if(a_val == -1)
+    {
+      puts ("querying the auxv for the hwcap failed");
+      _exit (2);
+    }
+
+  /* Indicates a 64-bit FPSCR.  */
+  if (a_val & PPC_FEATURE_HAS_DFP)
+    {
+      _GET_DI_FPSCR(di_fpscr);
+
+      if (which == 0)
+	puts ("After setcontext the 64-bit FPSCR contains:");
+      else
+	puts ("After swapcontext the 64-bit FPSCR contains:");
+
+      printf("0x%.16llx\n",(unsigned long long int) di_fpscr);
+      test = (_FPSCR_TEST0_DRN | _FPSCR_TEST0_RN);
+      if((di_fpscr & (test)) != (test))
+        {
+	  printf ("%s: DRN and RN bits set before getcontext were not preserved across [set|swap]context call: %m",__FUNCTION__);
+	  _exit (3);
+        }
+    }
+  else
+    {
+      _GET_SI_FPSCR(di_fpscr);
+      if (which == 0)
+	puts ("After setcontext the 32-bit FPSCR contains:");
+      else
+	puts ("After swapcontext the 32-bit FPSCR contains:");
+
+      printf("0x%.8lx\n",(unsigned long int) di_fpscr);
+      test = _FPSCR_TEST0_RN;
+      if((di_fpscr & test) != test)
+        {
+	  printf ("%s: RN bit set before getcontext was not preserved across [set|swap]context call: %m",__FUNCTION__);
+	  _exit (4);
+        }
+    }
+}
+
+
+static void
+check_called (void)
+{
+  if (back_in_main == 0)
+    {
+      puts ("program did not reach main again");
+      _exit (5);
+    }
+}
+
+
+int
+main (void)
+{
+  atexit (check_called);
+
+  puts ("priming the FPSCR with a marker");
+  prime_special_regs (0);
+
+  puts ("making contexts");
+  if (getcontext (&ctx[0]) != 0)
+    {
+      if (errno == ENOSYS)
+	{
+	  back_in_main = 1;
+	  exit (0);
+	}
+
+      printf ("%s: getcontext: %m\n", __FUNCTION__);
+      exit (6);
+    }
+
+  /* Play some tricks with this context.  */
+  if (++global == 1)
+    {
+    clear_special_regs ( );
+    if (setcontext (&ctx[0]) != 0)
+      {
+	printf ("%s: setcontext: %m\n", __FUNCTION__);
+	exit (7);
+      }
+    }
+  if (global != 2)
+    {
+      printf ("%s: 'global' not incremented twice\n", __FUNCTION__);
+      exit (8);
+    }
+
+  test_special_regs (0);
+
+  global = 0;
+  if (getcontext (&ctx[0]) != 0)
+    {
+      printf ("%s: getcontext: %m\n", __FUNCTION__);
+      exit (9);
+    }
+
+  if (++global == 1)
+    {
+      puts ("priming the FPSCR with a marker");
+      prime_special_regs (1);
+
+      puts ("swapping contexts");
+      if (swapcontext (&ctx[1], &ctx[0]) != 0)
+        {
+          printf ("%s: swapcontext: %m\n", __FUNCTION__);
+          exit (9);
+        }
+    }
+  if (global != 2)
+    {
+      printf ("%s: 'global' not incremented twice\n", __FUNCTION__);
+      exit (10);
+    }
+
+  test_special_regs (1);
+
+  puts ("back at main program");
+  back_in_main = 1;
+
+  puts ("test succeeded");
+  return 0;
+}
diff --git a/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S b/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
index 404f403..7c6e27c 100644
--- a/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
+++ b/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
@@ -47,16 +47,16 @@ ENTRY (BP_SYM (__longjmp))
 	lwz     r5,_rtld_global_ro@got(r5)
 	mtlr    r6
 	cfi_same_value (lr)
-	lwz     r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r5)
+	lwz     r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r5)
 #  else
 	lwz     r5,_dl_hwcap@got(r5)
 	mtlr    r6
 	cfi_same_value (lr)
-	lwz     r5,0(r5)
+	lwz     r5,4(r5)
 #  endif
 # else
-	lis	r5,_dl_hwcap@ha
-	lwz     r5,_dl_hwcap@l(r5)
+	lis	r5,(_dl_hwcap+4)@ha
+	lwz     r5,(_dl_hwcap+4)@l(r5)
 # endif
 	andis.	r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16)
 	beq	L(no_vmx)
diff --git a/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S b/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
index 851480d..b7d1abc 100644
--- a/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
+++ b/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
@@ -98,14 +98,14 @@ ENTRY (BP_SYM (__sigsetjmp))
 	cfi_same_value (lr)
 #  ifdef SHARED
 	lwz     r5,_rtld_global_ro@got(r5)
-	lwz     r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r5)
+	lwz     r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r5)
 #  else
 	lwz     r5,_dl_hwcap@got(r5)
-	lwz     r5,0(r5)
+	lwz     r5,4(r5)
 #  endif
 # else
-	lis	r6,_dl_hwcap@ha
-	lwz     r5,_dl_hwcap@l(r6)
+	lis	r6,(_dl_hwcap+4)@ha
+	lwz     r5,(_dl_hwcap+4)@l(r6)
 # endif
 	andis.	r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16)
 	beq	L(no_vmx)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
index c28c346..63e1773 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
@@ -157,15 +157,15 @@ ENTRY(__CONTEXT_FUNC_NAME)
 #   ifdef SHARED
 	lwz     r7,_rtld_global_ro@got(r7)
 	mtlr    r8
-	lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r7)
+	lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7)
 #   else
 	lwz     r7,_dl_hwcap@got(r7)
 	mtlr    r8
-	lwz     r7,0(r7)
+	lwz     r7,4(r7)
 #   endif
 #  else
-	lis	r7,_dl_hwcap@ha
-	lwz     r7,_dl_hwcap@l(r7)
+	lis	r7,(_dl_hwcap+4)@ha
+	lwz     r7,(_dl_hwcap+4)@l(r7)
 #  endif
 	andis.	r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
 
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/setcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/setcontext.S
new file mode 100644
index 0000000..7e44cdf
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/setcontext.S
@@ -0,0 +1,2 @@
+#define _ARCH_PWR6
+#include_next <setcontext.S>
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/swapcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/swapcontext.S
new file mode 100644
index 0000000..616e3db
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/power6/fpu/swapcontext.S
@@ -0,0 +1,2 @@
+#define _ARCH_PWR6
+#include_next <swapcontext.S>
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
index 40a7a24..91ac436 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
@@ -1,5 +1,5 @@
 /* Jump to a new context powerpc32 common.
-   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006, 2008 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
@@ -71,33 +71,34 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	cmpwi	r3,0
 	bne	3f	/* L(error_exit) */
 
-#ifdef __CONTEXT_ENABLE_FPRS
-# ifdef __CONTEXT_ENABLE_VRS
-#  ifdef PIC
+#ifdef PIC
 	mflr    r8
-#   ifdef HAVE_ASM_PPC_REL16
+# ifdef HAVE_ASM_PPC_REL16
 	bcl	20,31,1f
 1:	mflr	r7
 	addis	r7,r7,_GLOBAL_OFFSET_TABLE_-1b@ha
 	addi	r7,r7,_GLOBAL_OFFSET_TABLE_-1b@l
-#   else
+# else
 	bl      _GLOBAL_OFFSET_TABLE_@local-4
 	mflr    r7
-#   endif
-#   ifdef SHARED
+# endif
+# ifdef SHARED
 	lwz     r7,_rtld_global_ro@got(r7)
 	mtlr    r8
-	lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r7)
-#   else
+	lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7)
+# else
 	lwz     r7,_dl_hwcap@got(r7)
 	mtlr    r8
-	lwz     r7,0(r7)
-#   endif
-#  else
-	lis	r7,_dl_hwcap@ha
-	lwz     r7,_dl_hwcap@l(r7)
-#  endif
-	andis.	r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
+	lwz     r7,4(r7)
+# endif
+#else
+	lis	r7,(_dl_hwcap+4)@ha
+	lwz     r7,(_dl_hwcap+4)@l(r7)
+#endif
+
+#ifdef __CONTEXT_ENABLE_FPRS
+# ifdef __CONTEXT_ENABLE_VRS
+	andis.	r6,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
 	la	r10,(_UC_VREGS)(r31)
 	beq	2f	/* L(has_no_vec) */
 
@@ -199,7 +200,20 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	/* Restore the floating-point registers */
 	lfd	fp31,_UC_FREGS+(32*8)(r31)
 	lfd	fp0,_UC_FREGS+(0*8)(r31)
-	mtfsf	0xff,fp31
+# ifdef _ARCH_PWR6
+	/* Use the extended four-operand version of the mtfsf insn.  */
+	mtfsf  0xff,fp0,1,0
+# else
+	/* Availability of DFP indicates a 64-bit FPSCR.  */
+	andi.	r6,r7,PPC_FEATURE_HAS_DFP
+	beq	7f
+	/* Use the extended four-operand version of the mtfsf insn.  */
+	mtfsf	0xff,fp31,1,0
+	b	8f
+	/* Continue to operate on the FPSCR as if it were 32-bits.  */
+7:	mtfsf	0xff,fp31
+8:
+# endif /* _ARCH_PWR6 */
 	lfd	fp1,_UC_FREGS+(1*8)(r31)
 	lfd	fp2,_UC_FREGS+(2*8)(r31)
 	lfd	fp3,_UC_FREGS+(3*8)(r31)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
index 0c7b945..77c9822 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
@@ -1,5 +1,5 @@
 /* Save current context and jump to a new context.
-   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006, 2008 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
@@ -143,33 +143,34 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	stfd	fp30,_UC_FREGS+(30*8)(r3)
 	stfd	fp31,_UC_FREGS+(31*8)(r3)
 	stfd	fp0,_UC_FREGS+(32*8)(r3)
-	
-# ifdef __CONTEXT_ENABLE_VRS
-#  ifdef PIC
+
+# ifdef PIC
 	mflr    r8
-#   ifdef HAVE_ASM_PPC_REL16
+#  ifdef HAVE_ASM_PPC_REL16
 	bcl	20,31,1f
 1:	mflr	r7
 	addis	r7,r7,_GLOBAL_OFFSET_TABLE_-1b@ha
 	addi	r7,r7,_GLOBAL_OFFSET_TABLE_-1b@l
-#   else
+#  else
 	bl      _GLOBAL_OFFSET_TABLE_@local-4
 	mflr    r7
-#   endif
-#   ifdef SHARED
+#  endif
+#  ifdef SHARED
 	lwz     r7,_rtld_global_ro@got(r7)
 	mtlr    r8
-	lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r7)
-#   else
+	lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7)
+#  else
 	lwz     r7,_dl_hwcap@got(r7)
 	mtlr    r8
-	lwz     r7,0(r7)
-#   endif
-#  else
-	lis	r7,_dl_hwcap@ha
-	lwz     r7,_dl_hwcap@l(r7)
+	lwz     r7,4(r7)
 #  endif
-	andis.	r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
+# else
+	lis	r7,(_dl_hwcap+4)@ha
+	lwz     r7,(_dl_hwcap+4)@l(r7)
+# endif
+
+# ifdef __CONTEXT_ENABLE_VRS
+	andis.	r6,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
 
 	la	r10,(_UC_VREGS)(r3)
 	la	r9,(_UC_VREGS+16)(r3)
@@ -305,8 +306,8 @@ ENTRY(__CONTEXT_FUNC_NAME)
 #   ifdef HAVE_ASM_PPC_REL16
 	bcl	20,31,5f
 5:	mflr	r7
-	addis	r7,r7,_GLOBAL_OFFSET_TABLE_-1b@ha
-	addi	r7,r7,_GLOBAL_OFFSET_TABLE_-1b@l
+	addis	r7,r7,_GLOBAL_OFFSET_TABLE_-5b@ha
+	addi	r7,r7,_GLOBAL_OFFSET_TABLE_-5b@l
 #   else
 	bl      _GLOBAL_OFFSET_TABLE_@local-4
 	mflr    r7
@@ -314,14 +315,14 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	mtlr    r8
 #   ifdef SHARED
 	lwz     r7,_rtld_global_ro@got(r7)
-	lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r7)
+	lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7)
 #   else
 	lwz     r7,_dl_hwcap@got(r7)
-	lwz     r7,0(r7)
+	lwz     r7,4(r7)
 #   endif
 #  else
-	lis	r7,_dl_hwcap@ha
-	lwz     r7,_dl_hwcap@l(r7)
+	lis	r7,(_dl_hwcap+4)@ha
+	lwz     r7,(_dl_hwcap+4)@l(r7)
 #  endif
 	andis.	r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
 	la	r10,(_UC_VREGS)(r31)
@@ -425,7 +426,20 @@ ENTRY(__CONTEXT_FUNC_NAME)
 	/* Restore the floating-point registers */
 	lfd	fp31,_UC_FREGS+(32*8)(r31)
 	lfd	fp0,_UC_FREGS+(0*8)(r31)
-	mtfsf	0xff,fp31
+# ifdef _ARCH_PWR6
+	/* Use the extended four-operand version of the mtfsf insn.  */
+	mtfsf  0xff,fp0,1,0
+# else
+	/* Availability of DFP indicates a 64-bit FPSCR.  */
+	andi.	r6,r7,PPC_FEATURE_HAS_DFP
+	beq	7f
+	/* Use the extended four-operand version of the mtfsf insn.  */
+	mtfsf	0xff,fp31,1,0
+	b	8f
+	/* Continue to operate on the FPSCR as if it were 32-bits.  */
+7:	mtfsf	0xff,fp31
+8:
+#endif /* _ARCH_PWR6 */
 	lfd	fp1,_UC_FREGS+(1*8)(r31)
 	lfd	fp2,_UC_FREGS+(2*8)(r31)
 	lfd	fp3,_UC_FREGS+(3*8)(r31)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/setcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/setcontext.S
new file mode 100644
index 0000000..7e44cdf
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/setcontext.S
@@ -0,0 +1,2 @@
+#define _ARCH_PWR6
+#include_next <setcontext.S>
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/swapcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/swapcontext.S
new file mode 100644
index 0000000..616e3db
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/power6/fpu/swapcontext.S
@@ -0,0 +1,2 @@
+#define _ARCH_PWR6
+#include_next <swapcontext.S>
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
index 48e9af3..b4e28b4 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
@@ -1,5 +1,5 @@
 /* Switch to context.
-   Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005, 2006, 2008 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
@@ -27,6 +27,15 @@
 #include "ucontext_i.h"
 #include <asm/errno.h>
 
+	.section	".toc","aw"
+.LC__dl_hwcap:
+#ifdef SHARED
+	.tc _rtld_global_ro[TC],_rtld_global_ro
+#else
+	.tc _dl_hwcap[TC],_dl_hwcap
+#endif
+	.section ".text"
+
 #if SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)
 ENTRY(__novec_setcontext)
 	CALL_MCOUNT 1
@@ -62,10 +71,32 @@ ENTRY(__novec_setcontext)
   cmpdi r3,0
   bne   L(nv_error_exit)
 
+# ifdef SHARED
+/* Load _rtld-global._dl_hwcap.  */
+  ld    r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r5)
+# else
+  ld    r5,0(r5) /* Load extern _dl_hwcap.  */
+# endif
+
   lfd  fp0,(SIGCONTEXT_FP_REGS+(32*8))(r31)
   lfd  fp31,(SIGCONTEXT_FP_REGS+(PT_R31*8))(r31)
   lfd  fp30,(SIGCONTEXT_FP_REGS+(PT_R30*8))(r31)
+
+# ifdef _ARCH_PWR6
+  /* Use the extended four-operand version of the mtfsf insn.  */
+  mtfsf  0xff,fp0,1,0
+# else
+  /* Availability of DFP indicates a 64-bit FPSCR.  */
+  andi.  r6,r5,PPC_FEATURE_HAS_DFP
+  beq    5f
+  /* Use the extended four-operand version of the mtfsf insn.  */
+  mtfsf  0xff,fp0,1,0
+  b      6f
+  /* Continue to operate on the FPSCR as if it were 32-bits.  */
+5:
   mtfsf  0xff,fp0
+6:
+# endif /* _ARCH_PWR6 */
   lfd  fp29,(SIGCONTEXT_FP_REGS+(PT_R29*8))(r31)
   lfd  fp28,(SIGCONTEXT_FP_REGS+(PT_R28*8))(r31)
   lfd  fp27,(SIGCONTEXT_FP_REGS+(PT_R27*8))(r31)
@@ -189,15 +220,7 @@ compat_symbol (libc, __novec_setcontext, setcontext, GLIBC_2_3)
 
 #endif
 
-	.section	".toc","aw"
-.LC__dl_hwcap:
-#ifdef SHARED
-	.tc _rtld_global_ro[TC],_rtld_global_ro
-#else
-	.tc _dl_hwcap[TC],_dl_hwcap
-#endif
 	.section ".text"
-
 	.machine	"altivec"
 ENTRY(__setcontext)
 	CALL_MCOUNT 1
@@ -241,7 +264,7 @@ ENTRY(__setcontext)
 # else
   ld    r5,0(r5) /* Load extern _dl_hwcap.  */
 # endif
-  andis.  r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16)
+  andis.  r6,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16)
   beq   L(has_no_vec)
 
   cmpdi r10,0
@@ -346,7 +369,22 @@ L(has_no_vec):
   lfd  fp0,(SIGCONTEXT_FP_REGS+(32*8))(r31)
   lfd  fp31,(SIGCONTEXT_FP_REGS+(PT_R31*8))(r31)
   lfd  fp30,(SIGCONTEXT_FP_REGS+(PT_R30*8))(r31)
+
+# ifdef _ARCH_PWR6
+  /* Use the extended four-operand version of the mtfsf insn.  */
+  mtfsf  0xff,fp0,1,0
+# else
+  /* Availability of DFP indicates a 64-bit FPSCR.  */
+  andi.  r6,r5,PPC_FEATURE_HAS_DFP
+  beq    7f
+  /* Use the extended four-operand version of the mtfsf insn.  */
+  mtfsf  0xff,fp0,1,0
+  b      8f
+  /* Continue to operate on the FPSCR as if it were 32-bits.  */
+7:
   mtfsf  0xff,fp0
+8:
+# endif /* _ARCH_PWR6 */
   lfd  fp29,(SIGCONTEXT_FP_REGS+(PT_R29*8))(r31)
   lfd  fp28,(SIGCONTEXT_FP_REGS+(PT_R28*8))(r31)
   lfd  fp27,(SIGCONTEXT_FP_REGS+(PT_R27*8))(r31)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
index 936d641..c42ccfb 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
@@ -1,5 +1,5 @@
 /* Save current context and install the given one.
-   Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005, 2006, 2008 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
@@ -27,7 +27,16 @@
 #include "ucontext_i.h"
 #include <asm/errno.h>
 
+	.section	".toc","aw"
+.LC__dl_hwcap:
+#ifdef SHARED
+	.tc _rtld_global_ro[TC],_rtld_global_ro
+#else
+	.tc _dl_hwcap[TC],_dl_hwcap
+#endif
+
 #if SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)
+	.section	".text"
 ENTRY(__novec_swapcontext)
 	CALL_MCOUNT 2
 #ifdef __ASSUME_NEW_RT_SIGRETURN_SYSCALL
@@ -157,10 +166,31 @@ ENTRY(__novec_swapcontext)
   cmpdi r0,0
   bne	  L(nv_do_sigret)
 
+# ifdef SHARED
+/* Load _rtld-global._dl_hwcap.  */
+  ld    r8,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r8)
+# else
+  ld    r8,0(r8) /* Load extern _dl_hwcap.  */
+# endif
+
   lfd  fp0,(SIGCONTEXT_FP_REGS+(32*8))(r31)
   lfd  fp31,(SIGCONTEXT_FP_REGS+(PT_R31*8))(r31)
   lfd  fp30,(SIGCONTEXT_FP_REGS+(PT_R30*8))(r31)
+# ifdef _ARCH_PWR6
+  /* Use the extended four-operand version of the mtfsf insn.  */
+  mtfsf  0xff,fp0,1,0
+# else
+  /* Availability of DFP indicates a 64-bit FPSCR.  */
+  andi.  r6,r8,PPC_FEATURE_HAS_DFP
+  beq    5f
+  /* Use the extended four-operand version of the mtfsf insn.  */
+  mtfsf  0xff,fp0,1,0
+  b      6f
+  /* Continue to operate on the FPSCR as if it were 32-bits.  */
+5:
   mtfsf  0xff,fp0
+6:
+#endif /* _ARCH_PWR6 */
   lfd  fp29,(SIGCONTEXT_FP_REGS+(PT_R29*8))(r31)
   lfd  fp28,(SIGCONTEXT_FP_REGS+(PT_R28*8))(r31)
   lfd  fp27,(SIGCONTEXT_FP_REGS+(PT_R27*8))(r31)
@@ -283,15 +313,7 @@ compat_symbol (libc, __novec_swapcontext, swapcontext, GLIBC_2_3)
 
 #endif
 
-	.section	".toc","aw"
-.LC__dl_hwcap:
-#ifdef SHARED
-	.tc _rtld_global_ro[TC],_rtld_global_ro
-#else
-	.tc _dl_hwcap[TC],_dl_hwcap
-#endif
 	.section ".text"
-
 	.machine	"altivec"
 ENTRY(__swapcontext)
 	CALL_MCOUNT 2
@@ -409,7 +431,7 @@ ENTRY(__swapcontext)
   la    r10,(SIGCONTEXT_V_RESERVE+8)(r3)
   la    r9,(SIGCONTEXT_V_RESERVE+24)(r3)
 
-  andis.  r8,r8,(PPC_FEATURE_HAS_ALTIVEC >> 16)
+  andis.  r6,r8,(PPC_FEATURE_HAS_ALTIVEC >> 16)
 
   clrrdi  r10,r10,4
   beq   L(has_no_vec)
@@ -540,7 +562,7 @@ L(has_no_vec):
 # else
   ld    r8,0(r8) /* Load extern _dl_hwcap.  */
 # endif
-  andis.  r8,r8,(PPC_FEATURE_HAS_ALTIVEC >> 16)
+  andis.  r6,r8,(PPC_FEATURE_HAS_ALTIVEC >> 16)
   beq   L(has_no_vec2)
 
   cmpdi r10,0
@@ -646,7 +668,21 @@ L(has_no_vec2):
   lfd  fp0,(SIGCONTEXT_FP_REGS+(32*8))(r31)
   lfd  fp31,(SIGCONTEXT_FP_REGS+(PT_R31*8))(r31)
   lfd  fp30,(SIGCONTEXT_FP_REGS+(PT_R30*8))(r31)
+# ifdef _ARCH_PWR6
+  /* Use the extended four-operand version of the mtfsf insn.  */
+  mtfsf  0xff,fp0,1,0
+# else
+  /* Availability of DFP indicates a 64-bit FPSCR.  */
+  andi.  r6,r8,PPC_FEATURE_HAS_DFP
+  beq    7f
+  /* Use the extended four-operand version of the mtfsf insn.  */
+  mtfsf  0xff,fp0,1,0
+  b      8f
+  /* Continue to operate on the FPSCR as if it were 32-bits.  */
+7:
   mtfsf  0xff,fp0
+8:
+#endif /* _ARCH_PWR6 */
   lfd  fp29,(SIGCONTEXT_FP_REGS+(PT_R29*8))(r31)
   lfd  fp28,(SIGCONTEXT_FP_REGS+(PT_R28*8))(r31)
   lfd  fp27,(SIGCONTEXT_FP_REGS+(PT_R27*8))(r31)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=39581449dc4cb7fff696f2a847b9f8b6d49d0108

commit 39581449dc4cb7fff696f2a847b9f8b6d49d0108
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:   Fri Jul 24 10:25:23 2009 -0500

    Use correct macro to detect use of 128 bit long double.
    
    commit 48b9466105cf4bf7012b90356ae097573a23fc5c
    Author: Ulrich Drepper <drepper@redhat.com>
    Date:   Thu Aug 7 23:06:01 2008 +0000
    
    2008-08-07  Ulrich Drepper  <drepper@redhat.com>
    
            [BZ #6824]
            * sysdeps/unix/sysv/linux/powerpc/bits/mathinline.h: Use correct
            macro to detect use of 128 bit long double.
    
            Patch by Ryan S. Arnold <rsa@us.ibm.com>.

diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/mathinline.h b/sysdeps/unix/sysv/linux/powerpc/bits/mathinline.h
index 4f17391..4fa4bca 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/mathinline.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/mathinline.h
@@ -72,7 +72,7 @@ __NTH (__signbit (double __x))
   __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
   return __u.__i[0] < 0;
 }
-#  ifdef __LONGDOUBLE128
+#  ifdef __LONG_DOUBLE_128__
 __MATH_INLINE int
 __NTH (__signbitl (long double __x))
 {

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8645b695f1b7e4d17df66a204fa7514342da5acc

commit 8645b695f1b7e4d17df66a204fa7514342da5acc
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:   Fri Jul 24 10:21:04 2009 -0500

    Fix to exclude test when IBM 128-bit long double is being used in order to avoid representing an exponent that is out of bounds.
    
    commit 8fb0af98d8fcbdad7a982b41e6b0fe65b7d3b45d
    Author: Ulrich Drepper <drepper@redhat.com>
    Date:   Thu May 22 19:59:10 2008 +0000
    
    	Work around braindead IBM128 long double format.

diff --git a/math/libm-test.inc b/math/libm-test.inc
index 267d607..6d9a3ec 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -2511,8 +2511,8 @@ exp_test (void)
   TEST_f_f (exp, 0.75L, 2.11700001661267466854536981983709561L);
   TEST_f_f (exp, 50.0L, 5184705528587072464087.45332293348538L);
   TEST_f_f (exp, 88.72269439697265625L, 3.40233126623160774937554134772290447915e38L);
-#ifdef TEST_LDOUBLE
-  /* The result can only be represented in long double.  */
+#if defined TEST_LDOUBLE && __LDBL_MAX_EXP__ > 1024
+  /* The result can only be represented in sane long double.  */
   TEST_f_f (exp, 1000.0L, 0.197007111401704699388887935224332313e435L);
 #endif
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=edcdec2249c2e03ac30204d6f3270e7f3f6a31da

commit edcdec2249c2e03ac30204d6f3270e7f3f6a31da
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:   Fri Jul 24 10:14:16 2009 -0500

    Test case addition.
    
    commit a7eb802f1147cc2237be3a410b3c658f59178d72
    Author: Ulrich Drepper <drepper@redhat.com>
    Date:   Sun May 11 17:49:25 2008 +0000
    
    2008-02-11  Joseph Myers  <joseph@codesourcery.com>
    
    	[BZ #3406]
    	* sysdeps/ieee754/flt-32/w_expf.c (o_threshold): Correct value.
    	* math/libm-test.inc (exp_test): Test 88.72269439697265625.

diff --git a/math/libm-test.inc b/math/libm-test.inc
index b8a73ae..267d607 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -2510,6 +2510,7 @@ exp_test (void)
   TEST_f_f (exp, 3, M_E3l);
   TEST_f_f (exp, 0.75L, 2.11700001661267466854536981983709561L);
   TEST_f_f (exp, 50.0L, 5184705528587072464087.45332293348538L);
+  TEST_f_f (exp, 88.72269439697265625L, 3.40233126623160774937554134772290447915e38L);
 #ifdef TEST_LDOUBLE
   /* The result can only be represented in long double.  */
   TEST_f_f (exp, 1000.0L, 0.197007111401704699388887935224332313e435L);
diff --git a/sysdeps/ieee754/flt-32/w_expf.c b/sysdeps/ieee754/flt-32/w_expf.c
index ad38fac..4ba21c7 100644
--- a/sysdeps/ieee754/flt-32/w_expf.c
+++ b/sysdeps/ieee754/flt-32/w_expf.c
@@ -29,7 +29,7 @@ static const float
 #else
 static float
 #endif
-o_threshold=  8.8721679688e+01,  /* 0x42b17180 */
+o_threshold=  8.8722831726e+01,  /* 0x42b17217 */
 u_threshold= -1.0397208405e+02;  /* 0xc2cff1b5 */
 
 #ifdef __STDC__

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=590e37258c2da42c17404304515f9216afdc069b

commit 590e37258c2da42c17404304515f9216afdc069b
Author: Ryan S. Arnold <rsa@us.ibm.com>
Date:   Fri Jul 24 09:54:51 2009 -0500

    Define bit for PROT_SAO.
    
    Backported for ibm/2.8 by Carlos Eduardo Seo  <cseo@linux.vnet.ibm.com>.
    
    commit 30a4429e923d2383a0f2fe9a5fd4b046db1de021
    Author: Ulrich Drepper <drepper@redhat.com>
    Date:   Fri Aug 8 05:13:34 2008 +0000
    
    2008-08-07  Pete Eberlein  <eberlein@us.ibm.com>
    
    	[BZ #6791]
    	* sysdeps/unix/sysv/linux/powerpc/bits/mman.h (PROT_SAO): Define.

diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/mman.h b/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
index e03ab7f..d5729a1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
@@ -1,5 +1,5 @@
 /* Definitions for POSIX memory map interface.  Linux/PowerPC version.
-   Copyright (C) 1997, 2000, 2003, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1997,2000,2003,2005,2006,2008 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
@@ -34,6 +34,7 @@
 #define PROT_WRITE	0x2		/* Page can be written.  */
 #define PROT_EXEC	0x4		/* Page can be executed.  */
 #define PROT_NONE	0x0		/* Page can not be accessed.  */
+#define PROT_SAO	0x10		/* Strong Access Ordering.  */
 #define PROT_GROWSDOWN	0x01000000	/* Extend change to start of
 					   growsdown vma (mprotect only).  */
 #define PROT_GROWSUP	0x02000000	/* Extend change to start of

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |    8 +
 Makeconfig                                         |    4 +-
 config.make.in                                     |    3 +-
 elf/Makefile                                       |    4 +-
 elf/dl-sysdep.c                                    |   55 ++--
 locale/iso-639.def                                 |    1 +
 localedata/SUPPORTED                               |    1 +
 localedata/locales/nan_TW@latin                    |  205 +++++++++++
 math/libm-test.inc                                 |    5 +-
 sysdeps/ieee754/flt-32/w_expf.c                    |    2 +-
 sysdeps/powerpc/dl-procinfo.c                      |   10 +-
 sysdeps/powerpc/dl-procinfo.h                      |   10 +-
 sysdeps/powerpc/fpu/Makefile                       |    4 +
 sysdeps/powerpc/fpu/bits/mathinline.h              |   10 +-
 sysdeps/powerpc/fpu/feholdexcpt.c                  |    6 +-
 sysdeps/powerpc/fpu/fenv_libc.h                    |   32 ++-
 sysdeps/powerpc/fpu/fesetenv.c                     |   20 +-
 sysdeps/powerpc/fpu/feupdateenv.c                  |   10 +-
 sysdeps/powerpc/fpu/tst-setcontext-fpscr.c         |  370 ++++++++++++++++++++
 sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S   |    8 +-
 sysdeps/powerpc/powerpc32/fpu/s_lround.S           |    6 +-
 sysdeps/powerpc/powerpc32/fpu/setjmp-common.S      |    8 +-
 sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S   |   10 +-
 sysdeps/powerpc/powerpc32/power7/Implies           |    1 +
 sysdeps/powerpc/powerpc64/fpu/s_llround.S          |   10 +-
 sysdeps/powerpc/powerpc64/fpu/s_llroundf.S         |   10 +-
 sysdeps/powerpc/powerpc64/power7/Implies           |    1 +
 sysdeps/powerpc/powerpc64/power7/fpu/Implies       |    1 +
 sysdeps/powerpc/sysdep.h                           |    2 +
 sysdeps/unix/sysv/linux/Makefile                   |    2 +-
 sysdeps/unix/sysv/linux/Versions                   |    3 +
 sysdeps/unix/sysv/linux/fallocate.c                |   36 ++
 sysdeps/unix/sysv/linux/fallocate64.c              |   38 ++
 sysdeps/unix/sysv/linux/i386/bits/fcntl.h          |   17 +
 sysdeps/unix/sysv/linux/i386/fallocate.c           |   32 ++
 sysdeps/unix/sysv/linux/i386/fallocate64.c         |   32 ++
 sysdeps/unix/sysv/linux/ia64/bits/fcntl.h          |   17 +
 sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h       |   17 +
 sysdeps/unix/sysv/linux/powerpc/bits/mathinline.h  |  132 -------
 sysdeps/unix/sysv/linux/powerpc/bits/mman.h        |    3 +-
 .../linux/powerpc/powerpc32/getcontext-common.S    |    8 +-
 .../powerpc32/{power5 => power7}/fpu/Implies       |    0
 .../linux/powerpc/powerpc32/setcontext-common.S    |   57 ++--
 .../linux/powerpc/powerpc32/swapcontext-common.S   |   83 +++--
 .../linux/powerpc/powerpc64/power7/fpu/Implies     |    3 +
 .../unix/sysv/linux/powerpc/powerpc64/setcontext.S |   65 +++-
 .../sysv/linux/powerpc/powerpc64/swapcontext.S     |   65 +++-
 sysdeps/unix/sysv/linux/s390/bits/fcntl.h          |   17 +
 sysdeps/unix/sysv/linux/sh/bits/fcntl.h            |   17 +
 sysdeps/unix/sysv/linux/sparc/bits/fcntl.h         |   17 +
 sysdeps/unix/sysv/linux/wordsize-64/fallocate.c    |   30 ++
 sysdeps/unix/sysv/linux/wordsize-64/fallocate64.c  |    1 +
 sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h        |   16 +
 53 files changed, 1226 insertions(+), 299 deletions(-)
 create mode 100644 localedata/locales/nan_TW@latin
 create mode 100644 sysdeps/powerpc/fpu/tst-setcontext-fpscr.c
 create mode 100644 sysdeps/powerpc/powerpc32/power7/Implies
 create mode 100644 sysdeps/powerpc/powerpc64/power7/Implies
 create mode 100644 sysdeps/powerpc/powerpc64/power7/fpu/Implies
 create mode 100644 sysdeps/unix/sysv/linux/fallocate.c
 create mode 100644 sysdeps/unix/sysv/linux/fallocate64.c
 create mode 100644 sysdeps/unix/sysv/linux/i386/fallocate.c
 create mode 100644 sysdeps/unix/sysv/linux/i386/fallocate64.c
 delete mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/mathinline.h
 copy sysdeps/unix/sysv/linux/powerpc/powerpc32/{power5 => power7}/fpu/Implies (100%)
 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/power7/fpu/Implies
 create mode 100644 sysdeps/unix/sysv/linux/wordsize-64/fallocate.c
 create mode 100644 sysdeps/unix/sysv/linux/wordsize-64/fallocate64.c


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]