public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo commit in src/patchsets/glibc/2.19: 00_all_0015-hppa-name-setjmp-union.patch 00_all_0016-hppa-fix-build-problems-with-atomic-code.patch 00_all_0017-hppa-fix-bug-in-floating-point-exception-support.patch 00_all_0018-hppa-fix-pthread-spinlock.patch 00_all_0019-hppa-fix-__O_SYNC-to-match-the-kernel.patch 00_all_0020-nptl-handle-EAGAIN-with-some-futex-operations.patch README.history
@ 2014-08-11 13:47 Mike Frysinger (vapier)
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger (vapier) @ 2014-08-11 13:47 UTC (permalink / raw
  To: gentoo-commits

vapier      14/08/11 13:47:10

  Modified:             README.history
  Added:                00_all_0015-hppa-name-setjmp-union.patch
                        00_all_0016-hppa-fix-build-problems-with-atomic-code.patch
                        00_all_0017-hppa-fix-bug-in-floating-point-exception-support.patch
                        00_all_0018-hppa-fix-pthread-spinlock.patch
                        00_all_0019-hppa-fix-__O_SYNC-to-match-the-kernel.patch
                        00_all_0020-nptl-handle-EAGAIN-with-some-futex-operations.patch
  Log:
  pull in some more hppa patches #518460

Revision  Changes    Path
1.3                  src/patchsets/glibc/2.19/README.history

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/README.history?rev=1.3&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/README.history?rev=1.3&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/README.history?r1=1.2&r2=1.3

Index: README.history
===================================================================
RCS file: /var/cvsroot/gentoo/src/patchsets/glibc/2.19/README.history,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- README.history	14 Jun 2014 23:33:14 -0000	1.2
+++ README.history	11 Aug 2014 13:47:10 -0000	1.3
@@ -1,3 +1,11 @@
+3		10 Aug 2014
+	+ 00_all_0015-hppa-name-setjmp-union.patch
+	+ 00_all_0016-hppa-fix-build-problems-with-atomic-code.patch
+	+ 00_all_0017-hppa-fix-bug-in-floating-point-exception-support.patch
+	+ 00_all_0018-hppa-fix-pthread-spinlock.patch
+	+ 00_all_0019-hppa-fix-__O_SYNC-to-match-the-kernel.patch
+	+ 00_all_0020-nptl-handle-EAGAIN-with-some-futex-operations.patch
+
 2		14 Jun 2014
 	+ 00_all_0012-posix_spawn_file_actions_addopen-needs-to-copy-the-p.patch
 	+ 00_all_0013-posix_spawn_faction_addopen-Add-missing-string.h-inc.patch



1.1                  src/patchsets/glibc/2.19/00_all_0015-hppa-name-setjmp-union.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0015-hppa-name-setjmp-union.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0015-hppa-name-setjmp-union.patch?rev=1.1&content-type=text/plain

Index: 00_all_0015-hppa-name-setjmp-union.patch
===================================================================
From fcf3bc5b09f1a97943999360921f9be730c2116d Mon Sep 17 00:00:00 2001
From: John David Anglin <dave.anglin@bell.net>
Date: Sun, 10 Aug 2014 09:36:50 -0400
Subject: [PATCH 15/20] hppa: name setjmp union

Some of the C++ tests want this, and this is what all other arches
have done, so do it on hppa too.

2013-07-07  John David Anglin  <dave.anglin@bell.net>

	* ports/sysdeps/hppa/bits/setjmp.h: Name anonymous union.
---
 ports/sysdeps/hppa/bits/setjmp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ports/sysdeps/hppa/bits/setjmp.h b/ports/sysdeps/hppa/bits/setjmp.h
index 9a404e7..de05899 100644
--- a/ports/sysdeps/hppa/bits/setjmp.h
+++ b/ports/sysdeps/hppa/bits/setjmp.h
@@ -38,7 +38,7 @@
    * 10 x 64-bit fprs in this order:
      - fr12-fr21 (callee saves)
    Note: We have 8 bytes of free space for future uses.  */
-typedef union
+typedef union __jmp_buf_internal
   {
     struct __jmp_buf_internal_tag
       {
-- 
2.0.0




1.1                  src/patchsets/glibc/2.19/00_all_0016-hppa-fix-build-problems-with-atomic-code.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0016-hppa-fix-build-problems-with-atomic-code.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0016-hppa-fix-build-problems-with-atomic-code.patch?rev=1.1&content-type=text/plain

Index: 00_all_0016-hppa-fix-build-problems-with-atomic-code.patch
===================================================================
From 8e9c9f8f712392fc9c9c3abee93d2ac8bcac6c6e Mon Sep 17 00:00:00 2001
From: John David Anglin <dave.anglin@bell.net>
Date: Sun, 10 Aug 2014 09:39:25 -0400
Subject: [PATCH 16/20] hppa: fix build problems with atomic code
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Specifically:
../ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h:68:6: error:
	can’t find a register in class ‘R1_REGS’ while reloading ‘asm’
---
 ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h | 66 +++++++++++++-----------
 1 file changed, 35 insertions(+), 31 deletions(-)

diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
index 76ca0b1..06fa9af 100644
--- a/ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
+++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
@@ -61,42 +61,46 @@ typedef uintmax_t uatomic_max_t;
 
 #if __ASSUME_LWS_CAS
 /* The only basic operation needed is compare and exchange.  */
-# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) 	\
-  ({									\
-     volatile int lws_errno;						\
-     volatile int lws_ret;						\
-     asm volatile(							\
-	"0:					\n\t"			\
-	"copy	%2, %%r26			\n\t"			\
-	"copy	%3, %%r25			\n\t"			\
-	"copy	%4, %%r24			\n\t"			\
-	"ble	" _LWS "(%%sr2, %%r0)		\n\t"			\
-	"ldi	" _LWS_CAS ", %%r20		\n\t"			\
-	"ldi	" _ASM_EAGAIN ", %%r24		\n\t"			\
-	"cmpb,=,n %%r24, %%r21, 0b		\n\t"			\
-	"nop					\n\t"			\
-	"ldi	" _ASM_EDEADLOCK ", %%r25	\n\t"			\
-	"cmpb,=,n %%r25, %%r21, 0b		\n\t"			\
-	"nop					\n\t"			\
-	"stw	%%r28, %0			\n\t"			\
-	"stw	%%r21, %1			\n\t"			\
-	: "=m" (lws_ret), "=m" (lws_errno) 				\
-        : "r" (mem), "r" (oldval), "r" (newval)				\
-	: _LWS_CLOBBER							\
-     );									\
-    									\
-     if(lws_errno == -EFAULT || lws_errno == -ENOSYS)			\
-     	ABORT_INSTRUCTION;						\
-    									\
-     lws_ret;								\
-   })
+static int __attribute__((noinline))
+__atomic_compare_and_exchange_val_acq (int mem, int newval, int oldval)
+{
+  volatile int lws_errno;
+  volatile int lws_ret;
+  asm volatile(
+	"0:					\n\t"
+	"copy	%2, %%r26			\n\t"
+	"copy	%3, %%r25			\n\t"
+	"copy	%4, %%r24			\n\t"
+	"ble	" _LWS "(%%sr2, %%r0)		\n\t"
+	"ldi	" _LWS_CAS ", %%r20		\n\t"
+	"ldi	" _ASM_EAGAIN ", %%r24		\n\t"
+	"cmpb,=,n %%r24, %%r21, 0b		\n\t"
+	"nop					\n\t"
+	"ldi	" _ASM_EDEADLOCK ", %%r25	\n\t"
+	"cmpb,=,n %%r25, %%r21, 0b		\n\t"
+	"nop					\n\t"
+	"stw	%%r28, %0			\n\t"
+	"stw	%%r21, %1			\n\t"
+	: "=m" (lws_ret), "=m" (lws_errno)
+        : "r" (mem), "r" (oldval), "r" (newval)
+	: _LWS_CLOBBER
+   );
+
+  if (lws_errno == -EFAULT || lws_errno == -ENOSYS)
+    ABORT_INSTRUCTION;
+
+  return lws_ret;
+}
+# define atomic_compare_and_exchange_val_acq(mem, newval, oldval)	\
+   ((__typeof__(oldval))						\
+    __atomic_compare_and_exchange_val_acq ((int)mem, (int)newval, (int)oldval))
 
 # define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) 	\
   ({									\
-     int ret;								\
+     __typeof__(oldval) ret;						\
      ret = atomic_compare_and_exchange_val_acq(mem, newval, oldval);	\
      /* Return 1 if it was already acquired.  */			\
-     (ret != (int)oldval);						\
+     (ret != oldval);						\
    })
 #else
 # error __ASSUME_LWS_CAS is required to build glibc.
-- 
2.0.0




1.1                  src/patchsets/glibc/2.19/00_all_0017-hppa-fix-bug-in-floating-point-exception-support.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0017-hppa-fix-bug-in-floating-point-exception-support.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0017-hppa-fix-bug-in-floating-point-exception-support.patch?rev=1.1&content-type=text/plain

Index: 00_all_0017-hppa-fix-bug-in-floating-point-exception-support.patch
===================================================================
From c2934dc5e03bc0369b76d0b1209aea9323345ff8 Mon Sep 17 00:00:00 2001
From: John David Anglin <dave.anglin@bell.net>
Date: Sun, 10 Aug 2014 09:41:27 -0400
Subject: [PATCH 17/20] hppa: fix bug in floating point exception support

---
 ports/sysdeps/hppa/fpu/feholdexcpt.c | 6 +++---
 ports/sysdeps/hppa/fpu/fesetenv.c    | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/ports/sysdeps/hppa/fpu/feholdexcpt.c b/ports/sysdeps/hppa/fpu/feholdexcpt.c
index b121387..2dda85f 100644
--- a/ports/sysdeps/hppa/fpu/feholdexcpt.c
+++ b/ports/sysdeps/hppa/fpu/feholdexcpt.c
@@ -29,8 +29,8 @@ feholdexcept (fenv_t *envp)
   /* Store the environment.  */
   bufptr = clear.buf;
   __asm__ (
-	   "fstd,ma %%fr0,8(%1)\n"
-	   : "=m" (clear), "+r" (bufptr) : : "%r0");
+	   "fstd %%fr0,0(%1)\n"
+	   : "=m" (clear) : "r" (bufptr) : "%r0");
   memcpy (envp, &clear.env, sizeof (fenv_t));
 
   /* Clear exception queues */
@@ -44,7 +44,7 @@ feholdexcept (fenv_t *envp)
      Thus we start bufptr at the end and work backwards */
   bufptr = (unsigned long long *)((unsigned int)(clear.buf) + sizeof(unsigned int)*4);
   __asm__ (
-	   "fldd,mb -8(%0),%%fr0\n"
+	   "fldd 0(%0),%%fr0\n"
 	   : : "r" (bufptr), "m" (clear) : "%r0");
 
   return 0;
diff --git a/ports/sysdeps/hppa/fpu/fesetenv.c b/ports/sysdeps/hppa/fpu/fesetenv.c
index c967bd5..6ebceef 100644
--- a/ports/sysdeps/hppa/fpu/fesetenv.c
+++ b/ports/sysdeps/hppa/fpu/fesetenv.c
@@ -33,7 +33,7 @@ fesetenv (const fenv_t *envp)
      we want to use from the environment specified by the parameter.  */
   bufptr = temp.buf;
   __asm__ (
-	   "fstd,ma %%fr0,8(%1)\n"
+	   "fstd %%fr0,0(%1)\n"
 	   : "=m" (temp) : "r" (bufptr) : "%r0");
 
   temp.env.__status_word &= ~(FE_ALL_EXCEPT
@@ -54,7 +54,7 @@ fesetenv (const fenv_t *envp)
      we take advantage of that to load in reverse order so fr0
      is loaded last and T-Bit is enabled. */
   __asm__ (
-	   "fldd,mb -8(%1),%%fr0\n"
+	   "fldd 0(%1),%%fr0\n"
 	   : : "m" (temp), "r" (bufptr) : "%r0" );
 
   /* Success.  */
-- 
2.0.0




1.1                  src/patchsets/glibc/2.19/00_all_0018-hppa-fix-pthread-spinlock.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0018-hppa-fix-pthread-spinlock.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0018-hppa-fix-pthread-spinlock.patch?rev=1.1&content-type=text/plain

Index: 00_all_0018-hppa-fix-pthread-spinlock.patch
===================================================================
From bb18aaeae7ba7f46ac2897889ee92b3f551fc0b4 Mon Sep 17 00:00:00 2001
From: John David Anglin <dave.anglin@bell.net>
Date: Sun, 10 Aug 2014 09:54:53 -0400
Subject: [PATCH 18/20] hppa: fix pthread spinlock

---
 ports/sysdeps/hppa/nptl/pthread_spin_init.c   | 8 ++++----
 ports/sysdeps/hppa/nptl/pthread_spin_unlock.c | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/ports/sysdeps/hppa/nptl/pthread_spin_init.c b/ports/sysdeps/hppa/nptl/pthread_spin_init.c
index c83669e..b0ff789 100644
--- a/ports/sysdeps/hppa/nptl/pthread_spin_init.c
+++ b/ports/sysdeps/hppa/nptl/pthread_spin_init.c
@@ -20,9 +20,9 @@
 int
 pthread_spin_init (pthread_spinlock_t *lock, int pshared)
 {
-  int tmp = 0;
-  /* This should be a memory barrier to newer compilers */
-  __asm__ __volatile__ ("stw,ma %1,0(%0)"
-                        : : "r" (lock), "r" (tmp) : "memory");
+  /* The LWS-CAS operation on hppa is a synthetic atomic operation
+     that doesn't provide the type of coherency that we need. Therefore
+     we force that coherency by using LWS-CAS again.  */
+  atomic_exchange_rel (lock, 0);
   return 0;
 }
diff --git a/ports/sysdeps/hppa/nptl/pthread_spin_unlock.c b/ports/sysdeps/hppa/nptl/pthread_spin_unlock.c
index 5a8aed8..7a4a996 100644
--- a/ports/sysdeps/hppa/nptl/pthread_spin_unlock.c
+++ b/ports/sysdeps/hppa/nptl/pthread_spin_unlock.c
@@ -20,9 +20,9 @@
 int
 pthread_spin_unlock (pthread_spinlock_t *lock)
 {
-  int tmp = 0;
-  /* This should be a memory barrier to newer compilers */
-  __asm__ __volatile__ ("stw,ma %1,0(%0)"
-                        : : "r" (lock), "r" (tmp) : "memory");
+  /* The LWS-CAS operation on hppa is a synthetic atomic operation
+     that doesn't provide the type of coherency that we need. Therefore
+     we force that coherency by using LWS-CAS again.  */
+  atomic_exchange_rel (lock, 0);
   return 0;
 }
-- 
2.0.0




1.1                  src/patchsets/glibc/2.19/00_all_0019-hppa-fix-__O_SYNC-to-match-the-kernel.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0019-hppa-fix-__O_SYNC-to-match-the-kernel.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0019-hppa-fix-__O_SYNC-to-match-the-kernel.patch?rev=1.1&content-type=text/plain

Index: 00_all_0019-hppa-fix-__O_SYNC-to-match-the-kernel.patch
===================================================================
From 7aaf74a47f7a851329eda4c1e39c9074e2e9e18f Mon Sep 17 00:00:00 2001
From: John David Anglin <dave.anglin@bell.net>
Date: Sun, 10 Aug 2014 10:00:23 -0400
Subject: [PATCH 19/20] hppa: fix __O_SYNC to match the kernel

---
 ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
index f596d5f..24b564c 100644
--- a/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
+++ b/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
@@ -27,7 +27,7 @@
 #define O_NONBLOCK	00200004 /* HPUX has separate NDELAY & NONBLOCK */
 #define __O_DSYNC	01000000
 #define __O_RSYNC	02000000 /* HPUX only */
-#define __O_SYNC	01000000
+#define __O_SYNC	00100000
 #define O_SYNC		(__O_SYNC|__O_DSYNC)
 
 #define O_BLKSEEK	00000100 /* HPUX only */
-- 
2.0.0




1.1                  src/patchsets/glibc/2.19/00_all_0020-nptl-handle-EAGAIN-with-some-futex-operations.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0020-nptl-handle-EAGAIN-with-some-futex-operations.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.19/00_all_0020-nptl-handle-EAGAIN-with-some-futex-operations.patch?rev=1.1&content-type=text/plain

Index: 00_all_0020-nptl-handle-EAGAIN-with-some-futex-operations.patch
===================================================================
From 9559080132dcd991176e5eb48604405e610534d1 Mon Sep 17 00:00:00 2001
From: Carlos O'Donell <carlos@systemhalted.org>
Date: Sun, 10 Aug 2014 10:01:43 -0400
Subject: [PATCH 20/20] nptl: handle EAGAIN with some futex operations

---
 nptl/sysdeps/pthread/aio_misc.h | 4 ++--
 nptl/sysdeps/pthread/gai_misc.h | 4 ++--
 sunrpc/clnt_udp.c               | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/nptl/sysdeps/pthread/aio_misc.h b/nptl/sysdeps/pthread/aio_misc.h
index ac3488c..ac35771 100644
--- a/nptl/sysdeps/pthread/aio_misc.h
+++ b/nptl/sysdeps/pthread/aio_misc.h
@@ -50,7 +50,7 @@
 	  {								      \
 	    status = lll_futex_timed_wait (futexaddr, oldval, timeout,	      \
 					   LLL_PRIVATE);		      \
-	    if (status != -EWOULDBLOCK)					      \
+	    if (status != -EWOULDBLOCK && status != -EAGAIN)		      \
 	      break;							      \
 									      \
 	    oldval = *futexaddr;					      \
@@ -65,7 +65,7 @@
 	else if (status == -ETIMEDOUT)					      \
 	  result = EAGAIN;						      \
 	else								      \
-	  assert (status == 0 || status == -EWOULDBLOCK);		      \
+	  assert (status == 0 || status == -EWOULDBLOCK || status == -EAGAIN);\
 									      \
 	pthread_mutex_lock (&__aio_requests_mutex);			      \
       }									      \
diff --git a/nptl/sysdeps/pthread/gai_misc.h b/nptl/sysdeps/pthread/gai_misc.h
index 946275e..aa72c4a 100644
--- a/nptl/sysdeps/pthread/gai_misc.h
+++ b/nptl/sysdeps/pthread/gai_misc.h
@@ -51,7 +51,7 @@
 	  {								      \
 	    status = lll_futex_timed_wait (futexaddr, oldval, timeout,	      \
 					   LLL_PRIVATE);		      \
-	    if (status != -EWOULDBLOCK)					      \
+	    if (status != -EWOULDBLOCK && status != -EAGAIN)		      \
 	      break;							      \
 									      \
 	    oldval = *futexaddr;					      \
@@ -66,7 +66,7 @@
 	else if (status == -ETIMEDOUT)					      \
 	  result = EAGAIN;						      \
 	else								      \
-	  assert (status == 0 || status == -EWOULDBLOCK);		      \
+	  assert (status == 0 || status == -EWOULDBLOCK || status == -EAGAIN);\
 									      \
 	pthread_mutex_lock (&__gai_requests_mutex);			      \
       }									      \
diff --git a/sunrpc/clnt_udp.c b/sunrpc/clnt_udp.c
index 1b6a20b..41ac54b 100644
--- a/sunrpc/clnt_udp.c
+++ b/sunrpc/clnt_udp.c
@@ -463,7 +463,7 @@ send_again:
       while (inlen < 0 && errno == EINTR);
       if (inlen < 0)
 	{
-	  if (errno == EWOULDBLOCK)
+	  if (errno == EWOULDBLOCK || errno == EAGAIN)
 	    continue;
 	  cu->cu_error.re_errno = errno;
 	  return (cu->cu_error.re_status = RPC_CANTRECV);
-- 
2.0.0






^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-08-11 19:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-11 13:47 [gentoo-commits] gentoo commit in src/patchsets/glibc/2.19: 00_all_0015-hppa-name-setjmp-union.patch 00_all_0016-hppa-fix-build-problems-with-atomic-code.patch 00_all_0017-hppa-fix-bug-in-floating-point-exception-support.patch 00_all_0018-hppa-fix-pthread-spinlock.patch 00_all_0019-hppa-fix-__O_SYNC-to-match-the-kernel.patch 00_all_0020-nptl-handle-EAGAIN-with-some-futex-operations.patch README.history Mike Frysinger (vapier)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox